Becausecyberbullying can happen in different ways, examples based on real-life experiences can provide a deeper understanding of the tactics typically used. Along with other risk factors, bullying can increase the risk for suicide-related behaviors. Furthermore, cyberbullying can be relentless, increasing the likelihood of anxiety and depression. Some states have chosen to prosecute young people who bully for criminal harassment, including encouraging someone to die by suicide. Some forms of cyberbullying are forms of harassment that cross the line into criminal activity, and some tactics occur in dating relationships and can turn into interpersonal violence.
The stories below are examples of different cyberbullying tactics that could happen. In reality, with the right interventions, cyberbullying can be addressed positively to lessen harm and the negative outcomes that could result. When not addressed, cyberbullying can have long-term mental health effects. Cyberbullying and bullying can negatively impact the lives of all who are involved.
A teenage girl sent a nude photo of herself to her boyfriend while they were dating. After they broke up, he shared the photo with other children, who then called her hurtful, derogatory names via text and social media.
A group of students got into trouble at school for being drunk, and accused a girl who knew nothing about it of reporting them to school officials. They began texting her day and night, and posted hateful, derogatory messages on social media. Other students saw their messages and joined in harassing the girl. She was bullied constantly via text, and in person at school. She eventually shut down her social media accounts and changed her phone number. Still, the bullying at school continued.
A teenage boy who was openly gay began receiving death threats via phone, text, and social media for being gay. Students created an anti-gay social media group and harassed him, posting hateful messages about him.
A teenage girl was harassed by other girls in her class for dating a very popular boy. The girls sent her hateful messages via text and social media, and wrote derogatory messages on her school locker.
In this chapter, we describe an alternative approach to constructingproofs, using tactics. A proof term is a representation of amathematical proof; tactics are commands, or instructions, thatdescribe how to build such a proof. Informally, you might begin amathematical proof by saying "to prove the forward direction, unfoldthe definition, apply the previous lemma, and simplify." Just as theseare instructions that tell the reader how to find the relevant proof,tactics are instructions that tell Lean how to construct a proofterm. They naturally support an incremental style of writing proofs,in which you decompose a proof and work on goals one step at a time.
We will describe proofs that consist of sequences of tactics as"tactic-style" proofs, to contrast with the ways of writing proofterms we have seen so far, which we will call "term-style"proofs. Each style has its own advantages and disadvantages. Forexample, tactic-style proofs can be harder to read, because theyrequire the reader to predict or guess the results of eachinstruction. But they can also be shorter and easier towrite. Moreover, tactics offer a gateway to using Lean's automation,since automated procedures are themselves tactics.
Ordinarily, you meet such a goal by writing an explicit term. Butwherever a term is expected, Lean allows us to insert instead a by block, where is a sequence of commands,separated by semicolons or line breaks. You can prove the theorem abovein that way:
The apply tactic applies an expression, viewed as denoting afunction with zero or more arguments. It unifies the conclusion withthe expression in the current goal, and creates new goals for theremaining arguments, provided that no later arguments depend onthem. In the example above, the command apply And.intro yields twosubgoals:
The first goal is met with the command exact hp. The exactcommand is just a variant of apply which signals that theexpression given should fill the goal exactly. It is good form to useit in a tactic proof, since its failure signals that something hasgone wrong. It is also more robust than apply, since theelaborator takes the expected type, given by the target of the goal,into account when processing the expression that is being applied. Inthis case, however, apply would work just as well.
You can write a tactic script incrementally. In VS Code, you can opena window to display messages by pressing Ctrl-Shift-Enter, andthat window will then show you the current goal whenever the cursor isin a tactic block. In Emacs, you can see the goal at the end of anyline by pressing C-c C-g, or see the remaining goal in anincomplete proof by putting the cursor after the first character ofthe last tactic. If the proof is incomplete, the token by isdecorated with a red squiggly line, and the error message contains theremaining goals.
Tactics that may produce multiple subgoals often tag them. Forexample, the tactic apply And.intro tagged the first subgoal asleft, and the second as right. In the case of the applytactic, the tags are inferred from the parameters' names used in theAnd.intro declaration. You can structure your tactics using thenotation case => . The following is a structuredversion of our first tactic proof in this chapter.
Note that Lean hides the other goals inside the case block. We sayit is "focusing" on the selected goal. Moreover, Lean flags an errorif the selected goal is not fully solved at the end of the caseblock.
In addition to apply and exact, another useful tactic isintro, which introduces a hypothesis. What follows is an exampleof an identity from propositional logic that we proved in a previouschapter, now proved using tactics.
As the apply tactic is a command for constructing functionapplications interactively, the intro tactic is a command forconstructing function abstractions interactively (i.e., terms of theform fun x => e). As with lambda abstraction notation, theintro tactic allows us to use an implicit match.
Note that names automatically generated by Lean are inaccessible by default. The motivation is toensure your tactic proofs do not rely on automatically generated names, and are consequently more robust.However, you can use the combinator unhygienic to disable this restriction.
You can also use the rename_i tactic to rename the most recent inaccessible names in your context.In the following example, the tactic rename_i h1 _ h2 renames two of the last three hypotheses inyour context.
But revert is even more clever, in that it will revert not only anelement of the context but also all the subsequent elements of thecontext that depend on it. For example, reverting x in the exampleabove brings h along with it:
The mnemonic in the notation above is that you are generalizing thegoal by setting 3 to an arbitrary variable x. Be careful: notevery generalization preserves the validity of the goal. Here,generalize replaces a goal that could be proved usingrfl with one that is not provable:
In this example, the admit tactic is the analogue of the sorryproof term. It closes the current goal, producing the usual warningthat sorry has been used. To preserve the validity of the previousgoal, the generalize tactic allows us to record the fact that3 has been replaced by x. All you need to do is to provide alabel, and generalize uses it to store the assignment in the localcontext:
You will see in Chapter Inductive Types thatthese tactics are quite general. The cases tactic can be used todecompose any element of an inductively defined type; constructoralways applies the first applicable constructor of an inductively defined type.For example, you can use cases and constructor with an existential quantifier:
Here, the constructor tactic leaves the first component of theexistential assertion, the value of x, implicit. It is representedby a metavariable, which should be instantiated later on. In theprevious example, the proper value of the metavariable is determinedby the tactic exact px, since px has type p x. If you wantto specify a witness to the existential quantifier explicitly, you canuse the exists tactic instead:
Note that up to the names we have chosen for the variables, thedefinitions are identical to the proofs of the analogous propositionsfor conjunction and disjunction. The cases tactic will also do acase distinction on a natural number:
Tactics often provide an efficient way of building a proof, but longsequences of instructions can obscure the structure of theargument. In this section, we describe some means that help providestructure to a tactic-style proof, making such proofs more readableand robust.
One thing that is nice about Lean's proof-writing syntax is that it ispossible to mix term-style and tactic-style proofs, and pass betweenthe two freely. For example, the tactics apply and exactexpect arbitrary terms, which you can write using have, show,and so on. Conversely, when writing an arbitrary Lean term, you canalways invoke the tactic mode by inserting a byblock. The following is a somewhat toy example:
The types in a have tactic can be omitted, so you can write have hp := h.left and have hqr := h.right. In fact, with thisnotation, you can even omit both the type and the label, in which casethe new fact is introduced with the label this:
As with have, you can leave the type implicit by writing let a := 3 * 2. The difference between let and have is thatlet introduces a local definition in the context, so that thedefinition of the local declaration can be unfolded in the proof.
We have used . to create nested tactic blocks. In a nested block,Lean focuses on the first goal, and generates an error if it has notbeen fully solved at the end of the block. This can be helpful inindicating the separate proofs of multiple subgoals introduced by atactic. The notation . is whitespace sensitive and relies on the indentationto detect whether the tactic block ends. Alternatively, you candefine tactic blocks using curly braces and semicolons:
3a8082e126