You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.3 KiB
Plaintext
64 lines
1.3 KiB
Plaintext
import TestGame.Metadata
|
|
import Std.Tactic.RCases
|
|
import Mathlib.Tactic.Cases
|
|
|
|
set_option tactic.hygienic false
|
|
|
|
Game "TestGame"
|
|
World "Logic"
|
|
Level 11
|
|
|
|
Title "Genau dann wenn"
|
|
|
|
Introduction
|
|
"
|
|
Umgekehrt, wenn man eine Annahme `(h : A ↔ B)` hat, kann man auf verschiedene
|
|
Arten die Einzelteile `A → B` und `B → A` extrahieren.
|
|
|
|
- mit `rcases h` oder `rcases h with ⟨h₁, h₂⟩` teilt man die Annahme `h` auf. (Im zweiten Fall gibt
|
|
man explizit an, wie die neuen Annahmen heissen sollen, die Klammern sind `\\<` und `\\>`).
|
|
|
|
"
|
|
Statement
|
|
""
|
|
(A B : Prop) : (A ↔ B) → (A → B) := by
|
|
intro h
|
|
rcases h
|
|
exact mp
|
|
|
|
Message (A : Prop) (B : Prop) : (A ↔ B) → A → B =>
|
|
"Angefangen mit `intro h` kannst du annehmen, dass `(h : A ↔ B)` wahr ist."
|
|
|
|
Conclusion
|
|
"
|
|
Anstatt
|
|
```
|
|
intro h
|
|
rcases h with ⟨h₁, h₂⟩
|
|
```
|
|
kann man direkt `intro ⟨h₁, h₂⟩` schreiben.
|
|
Wie du schon gesehen hast, sind diese Klammern `⟨⟩` Lean's Syntax für eine Struktur aus
|
|
mehreren Teilen.
|
|
|
|
"
|
|
|
|
Tactics intro apply rcases assumption
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- TODO: The new `cases` works differntly. There is also `cases'`
|
|
example (A B : Prop) : (A ↔ B) → (A → B) := by
|
|
intro h
|
|
cases h with
|
|
| intro a b =>
|
|
assumption
|
|
|
|
example (A B : Prop) : (A ↔ B) → (A → B) := by
|
|
intro h
|
|
cases' h with a b
|
|
assumption
|