new levels.
parent
8e3af92c03
commit
90540b158f
@ -0,0 +1,6 @@
|
||||
import TestGame.Levels.Contradiction.L01_Have
|
||||
import TestGame.Levels.Contradiction.L02_Suffices
|
||||
import TestGame.Levels.Contradiction.L03_ByContra
|
||||
import TestGame.Levels.Contradiction.L04_ByContra
|
||||
import TestGame.Levels.Contradiction.L05_Contrapose
|
||||
import TestGame.Levels.Contradiction.L06_Summary
|
||||
@ -0,0 +1,65 @@
|
||||
import TestGame.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
import TestGame.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
World "Contradiction"
|
||||
Level 2
|
||||
|
||||
Title "Suffices"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Die Taktik `suffices` funktioniert genau gleich wie `have`,
|
||||
vertauscht aber die beiden Beweisblöcke:
|
||||
|
||||
```
|
||||
suffices h : [Aussage]
|
||||
[Beweis des Goals (mithilfe von h)]
|
||||
[Beweis der Aussage h]
|
||||
```
|
||||
Auf Deutsch entspricht `suffices h : [Aussage]` dem Ausdruck
|
||||
\"Es genügt zu zeigen, dass `[Aussage]` wahr ist.\"
|
||||
|
||||
Man kann `have` und `suffices` nach belieben vertauschen. Bevorzugt, wählt man es so,
|
||||
dass der erste Beweisblock der kürzere ist. Zum Beispiel wäre bei der vorigen Aufgabe
|
||||
`suffices` schöner gewesen:
|
||||
|
||||
"
|
||||
|
||||
Statement
|
||||
"Angenommen, man hat eine Implikation $A \\Rightarrow \\neg B$ und weiss, dass
|
||||
$A \\land B$ wahr ist. Zeige, dass dies zu einem Widerspruch führt."
|
||||
(A B : Prop) (h : A → ¬ B) (g : A ∧ B) : False := by
|
||||
rcases g with ⟨h₁, h₂⟩
|
||||
suffices k : ¬ B
|
||||
contradiction
|
||||
apply h
|
||||
assumption
|
||||
|
||||
Message (A : Prop) (B : Prop) (h : A → ¬ B) (g : A ∧ B) : False =>
|
||||
" Fang mal damit an, das UND in den Annahmen mit `rcases` aufzuteilen.
|
||||
"
|
||||
|
||||
Message (A : Prop) (B : Prop) (h : A → ¬ B) (g : A) (f : B) : False =>
|
||||
" Auf Deutsch: \"Es genügt `¬ B` zu zeigen, da dies zu einem direkten Widerspruch führt.\"
|
||||
|
||||
In Lean :
|
||||
|
||||
```
|
||||
suffices k : ¬ B
|
||||
contradiction
|
||||
[...]
|
||||
```
|
||||
"
|
||||
|
||||
Conclusion ""
|
||||
|
||||
Tactics contradiction apply assumption rcases sufficesₓ
|
||||
|
||||
Lemmas Even Odd not_even not_odd
|
||||
@ -0,0 +1,55 @@
|
||||
import TestGame.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
import Mathlib
|
||||
|
||||
import TestGame.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
World "Contradiction"
|
||||
Level 3
|
||||
|
||||
Title "Per Widerspruch"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Eine sehr nützliche Beweismethode ist per Widerspruch.
|
||||
|
||||
Wir habe schon gesehen, dass `contradiction` einen Widerspruch in den Annahmen
|
||||
sucht, und damit jegliches beweisen kann.
|
||||
|
||||
Um dorthin zu kommen, können wir `by_contra h` brauchen, welches das aktuelle
|
||||
Goal auf `False` setzt und die Negierung des Goals als Annahme hinzufügt.
|
||||
|
||||
Insbesondere braucht man `by_contra h` meistens, wenn im Goal eine Negierung
|
||||
steht:
|
||||
"
|
||||
|
||||
Statement
|
||||
"Angenommen $B$ ist falsch und es gilt $A \\Rightarrow B$. Zeige, dass $A$ falsch sein
|
||||
muss."
|
||||
(A B : Prop) (h : A → B) (b : ¬ B) : ¬ A := by
|
||||
by_contra a
|
||||
suffices b : B
|
||||
contradiction
|
||||
apply h
|
||||
assumption
|
||||
|
||||
|
||||
Hint (A : Prop) (B : Prop) (h : A → B) (b : ¬ B) : ¬ A =>
|
||||
"`by_contra h` nimmt das Gegenteil des Goal als Annahme `(h : A)` und setzt das
|
||||
Goal auf `False`."
|
||||
|
||||
Message (A : Prop) (B : Prop) (h : A → B) (b : ¬ B) (a : A) : False =>
|
||||
"Jetzt kannst du mit `suffices` oder `have` Fortschritt machen."
|
||||
|
||||
Hint (A : Prop) (B : Prop) (h : A → B) (b : ¬ B) (a : A) : False =>
|
||||
"Zum Beispiel `suffices hb : B`."
|
||||
|
||||
|
||||
Conclusion ""
|
||||
|
||||
Tactics by_contra sufficesₓ haveₓ contradiction apply assumption
|
||||
@ -0,0 +1,49 @@
|
||||
import TestGame.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
import Mathlib
|
||||
|
||||
import TestGame.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
World "Contradiction"
|
||||
Level 4
|
||||
|
||||
Title "Per Widerspruch"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Als Übung zu `by_contra` und dem bisher gelernten, zeige folgendes Lemma welches
|
||||
wir für die Kontraposition brauchen werden:
|
||||
"
|
||||
|
||||
Statement not_imp_not
|
||||
"$A \\Rightarrow B$ ist äquivalent zu $\\neg B \\Rightarrow \\neg A$."
|
||||
(A B : Prop) : A → B ↔ (¬ B → ¬ A) := by
|
||||
constructor
|
||||
intro h b
|
||||
by_contra a
|
||||
suffices b : B
|
||||
contradiction
|
||||
apply h
|
||||
assumption
|
||||
intro h a
|
||||
by_contra b
|
||||
suffices g : ¬ A
|
||||
contradiction
|
||||
apply h
|
||||
assumption
|
||||
|
||||
-- TODO: Forbidden Tactics: apply, rw
|
||||
-- TODO: forbidden Lemma: not_not
|
||||
|
||||
Hint (A : Prop) (B : Prop) : A → B ↔ (¬ B → ¬ A) =>
|
||||
""
|
||||
|
||||
|
||||
Conclusion ""
|
||||
|
||||
Tactics contradiction constructor intro by_contra sufficesₓ haveₓ apply assumption
|
||||
@ -0,0 +1,18 @@
|
||||
import TestGame.Metadata
|
||||
import Mathlib
|
||||
|
||||
-- -- INCORPORATED
|
||||
-- example (A B : Prop) : (A → B) ↔ (¬ B → ¬A) := by
|
||||
-- constructor
|
||||
-- intro h nb
|
||||
-- by_contra
|
||||
-- have : B
|
||||
-- apply h
|
||||
-- assumption
|
||||
-- contradiction
|
||||
-- intro h a
|
||||
-- by_contra
|
||||
-- have : ¬ A
|
||||
-- apply h
|
||||
-- assumption
|
||||
-- contradiction
|
||||
@ -1 +0,0 @@
|
||||
import TestGame.Levels.Proving.L01_Contra
|
||||
Loading…
Reference in New Issue