You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Game/Doc/Tactics.lean
+63-7Lines changed: 63 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -150,36 +150,92 @@ For example, if your goal is `P ∧ Q` then the `constructor` tactic will replac
150
150
TacticDoc constructor
151
151
152
152
/--
153
-
TODO
153
+
# Conjunction/Biconditional
154
+
`cases` will deconstruct an `∧` or an `↔` into it's parts, removing the assumption and replacing it with two new assumptions.
155
+
# Disjunction
156
+
Used with an `∨` cases will split the main goal, replacing it with a goal for each of the two possibilities.
154
157
-/
155
158
TacticDoc cases
156
159
157
160
/--
158
-
TODO
161
+
# It suffices to show
162
+
To prove `Q` by `P → Q`, it suffices to show `P`.
163
+
### More Generally
164
+
To prove `Q` by `P₁ → P₂ → P₃ → ... → Q`, it suffices to show `P₁, P₂, P₃, ...`. One way to convince yourself this is true is to prove that `(P₁ → P₂ → Q) → (P₁ ∧ P₂ → Q)` and convince yourself there exists a procedure for any `(P₁ → P₂ → ... → Q) → (P₁ ∧ P₂ ∧ ... → Q)`
165
+
### In Practice
166
+
The `apply` tactic returns as many subgoals as the number of premises that have not been fixed by the Goal.
167
+
### Example:
168
+
If you have:
169
+
```
170
+
Assumptions:
171
+
h : P → Q
172
+
Goal : Q
173
+
```
174
+
then `apply h` will change your proof state to:
175
+
```
176
+
Assumptions:
177
+
h : P → Q
178
+
Goal : P
179
+
```
159
180
-/
160
181
TacticDoc apply
161
182
162
183
/--
163
-
TODO
184
+
# Sub-Proof
185
+
If your Goal is an implication, this tactic introduces one or more hypotheses, optionally naming and/or pattern-matching them.
186
+
187
+
The effect on a goal like `P → Q` is to add `P` as an assumption and change the Goal to `Q`. If the implication is already a part of a sub-proof, then once you show evidence for `Q`, the assumption `P` is discharged and can not be used for the rest of the proof.
188
+
189
+
This is is the interactive way of defining a function using tactics. You can think of discharging an assumption as the same as parameters being limited in scope to the function's body/definition.
164
190
-/
165
191
TacticDoc intro
166
192
167
193
/--
168
-
TODO
194
+
contradiction closes the current goal there are assumptions which are "trivially contradictory".
195
+
196
+
### Example
197
+
```
198
+
Assumptions:
199
+
h : False
200
+
```
201
+
### Example
202
+
```
203
+
Assumptions:
204
+
h₁ : P
205
+
h₂ : ¬P
206
+
```
169
207
-/
170
208
TacticDoc contradiction
171
209
172
210
/--
173
-
TODO
211
+
Change the goal to `False`. This is only helpful when there are assumptions which are in some way contradictory.
212
+
### Example
213
+
```
214
+
Assumptions
215
+
h : P ∧ ¬P
216
+
Goal: Q
217
+
```
218
+
I cannot show evidence for `Q` directly, but because `False → Q` is trivially true (False implies anything), I can use the tactic `exfalso` which changes the Goal:
219
+
```
220
+
Assumptions
221
+
h : P ∧ ¬P
222
+
Goal: Q
223
+
```
224
+
After which `exact h.right r.left` meets the current goal.
225
+
### Apply
226
+
`exfalso` is the same as `apply false_elim`.
227
+
∴ to show `Q` by `False → Q`, it suffices to show `False`.
174
228
-/
175
229
TacticDoc exfalso
176
230
177
231
/--
178
-
TODO
232
+
# Show a Disjunction
233
+
Evidence for `P ∨ Q` can be created in two ways. `left` changes the goal to `P` while `right` changes the goal to `Q`.
179
234
-/
180
235
TacticDoc left
181
236
182
237
/--
183
-
TODO
238
+
# Show a Disjunction
239
+
Evidence for `P ∨ Q` can be created in two ways. `left` changes the goal to `P` while `right` changes the goal to `Q`.
This is an involved level. It doesn't require you to do anything tricky, but there are a lot of moving parts and it is easy to lose track of what you're doing.
19
+
"
20
+
21
+
Statement (P Q R : Prop): (P ∧ Q ↔ R ∧ Q) ↔ Q → (P ↔ R) := by
0 commit comments