more levels

This commit is contained in:
Jon
2022-12-05 11:40:44 +01:00
parent 4acd791fd7
commit cde0e95c1e
19 changed files with 515 additions and 29 deletions
@@ -0,0 +1,29 @@
import TestGame.Metadata
import Std.Tactic.RCases
import Mathlib.Tactic.LeftRight
Game "TestGame"
World "Contradiction"
Level 1
Title "Widerspruch"
Introduction
"
Ein wichtiges Konzept ist die Verneinung und damit einhergehend die Kontraposition
und der Widerspruch (Kontradiktion).
Als allererstes der Widerspruch.
Wenn man in den Annahmen einen Widerspruch hat, kann man mit `contradiction` den Beweis
schliessen, denn ein Widerspruch beweist alles.
Der einfachste Widerspruch ist wenn man einen Beweis von `false` hat:
"
Statement
"Ein Widerspruch impliziert alles."
(A : Prop) (h : false) : A := by
contradiction
Tactics contradiction
@@ -0,0 +1,29 @@
import TestGame.Metadata
import Std.Tactic.RCases
import Mathlib.Tactic.LeftRight
Game "TestGame"
World "Contradiction"
Level 2
Title "Widerspruch"
Introduction
"
Ähnlich siehts aus, wenn man Annahmen hat, die direkte Negierung voneinander sind,
also `(h : A)` und `(g : ¬ A)`. (`\\not`)
"
Statement
"Ein Widerspruch impliziert alles."
(A : Prop) (n : ℕ) (h : ∃ x, 2 * x = n) (g : ¬ (∃ x, 2 * x = n)) : A := by
contradiction
Conclusion
"
Detail: `¬ A` ist übrigens als `A → false` implementiert, was aussagt, dass
\"falls `A` wahr ist, impliziert das `false` und damit einen Widerspruch\".
"
-- TODO: Oder doch ganz entfernen?
Tactics contradiction
@@ -0,0 +1,31 @@
import TestGame.Metadata
import Std.Tactic.RCases
import Mathlib.Tactic.LeftRight
Game "TestGame"
World "Contradiction"
Level 3
Title "Widerspruch"
Introduction
"
Im weiteren kann man auch Widersprüche erhalten, wenn man Annahmen der Form
`A = B` hat, wo Lean weiss, dass `A und `B` unterschiedlich sind, z.B. `0 = 1` in `ℕ`
oder auch Annahmen der Form `A ≠ A` (`\\ne`).
"
Statement
"Ein Widerspruch impliziert alles."
(A : Prop) (a b c : ℕ) (g₁ : a = b) (g₂ : b = c) (h : a ≠ c) : A := by
rw [g₁] at h
contradiction
Message (A : Prop) (a : ℕ) (b : ℕ) (c : ℕ) (g₁ : a = b) (g₂ : b = c) (h : a ≠ c) : A =>
"Recap: `rw [...] at h` hilft dir hier."
Message (A : Prop) (a : ℕ) (b : ℕ) (c : ℕ) (g₁ : a = b) (g₂ : b = c) (h : b ≠ c) : A =>
"`b ≠ c` muss man als `¬ (b = c)` lesen. Deshalb findet `contradiction` hier direkt
einen Widerspruch."
Tactics contradiction
@@ -0,0 +1,20 @@
import TestGame.Metadata
import Mathlib
Game "TestGame"
World "Contradiction"
Level 4
Title "Widerspruch"
Introduction
"
"
Statement
(A : Prop) : A := by
by_contradiction
Tactics contradiction
@@ -0,0 +1,20 @@
import TestGame.Metadata
import Mathlib
Game "TestGame"
World "Contradiction"
Level 5
Title "Widerspruch"
Introduction
"
"
Statement
(A : Prop) : A := by
not_not
Tactics contradiction
@@ -0,0 +1,20 @@
import TestGame.Metadata
import Mathlib
Game "TestGame"
World "Contradiction"
Level 6
Title "Widerspruch"
Introduction
"
"
Statement
(A : Prop) : A := by
pushNeg
Tactics contradiction
@@ -0,0 +1,23 @@
import TestGame.Metadata
import Std.Tactic.RCases
import Mathlib.Tactic.Contrapose
Game "TestGame"
World "Contradiction"
Level 7
Title "Kontraposition"
Introduction
"
Im Gegensatz zum Widerspruch, wo
"
Statement
"Ein Widerspruch impliziert alles."
(A B : Prop) (h : ¬ B → ¬ A) (hA : A) : B := by
revert hA
contrapose
assumption
Tactics contradiction
@@ -0,0 +1,26 @@
import TestGame.Metadata
import Std.Tactic.RCases
import Mathlib.Tactic.Contrapose
Game "TestGame"
World "Contradiction"
Level 8
Title "Kontraposition"
Introduction
"
Im Gegensatz zum Widerspruch, wo
"
-- TODO: `even`/`odd` sind in Algebra.Parity. Not ported yet
-- Statement
-- "Ist n² ungerade, so ist auch n ungerade. Beweise durch Widerspruch."
-- (n : ℕ) (h : odd n ^ 2) : odd n := by
-- byContradiction g
-- rw [not_odd] at g
-- ...
-- contradiction
Tactics contradiction
@@ -0,0 +1,27 @@
import TestGame.Metadata
import Std.Tactic.RCases
import Mathlib.Tactic.Contrapose
Game "TestGame"
World "Contradiction"
Level 9
Title "Kontraposition"
Introduction
"
Im Gegensatz zum Widerspruch, wo
"
-- TODO: `even`/`odd` sind in Algebra.Parity. Not ported yet
-- Statement
-- "Ist n² ungerade, so ist auch n ungerade. Beweise durch Kontraposition."
-- (n : ℕ) (h : odd n ^ 2) : odd n := by
-- revert h
-- contrapose
-- rw [not_odd]
-- intro
-- trivial (?)
Tactics contradiction