levels
This commit is contained in:
@@ -54,4 +54,6 @@ Statement Set.mem_univ "" {A : Type} (x : A) : x ∈ (univ : Set A) := by
|
||||
**Du**: Also das ist ja dann `trivial`. Hoffentlich sehen die das hier auch so…"
|
||||
trivial
|
||||
|
||||
LemmaTab "Set"
|
||||
|
||||
Conclusion "**Mengea**: Ja das stimmt schon. Dann wünsche ich euch viel Erfolg auf eurer Reise!"
|
||||
|
||||
@@ -27,6 +27,7 @@ Statement Set.not_mem_empty "" {A : Type} (x : A) :
|
||||
tauto
|
||||
|
||||
NewLemma Set.mem_univ
|
||||
LemmaTab "Set"
|
||||
|
||||
Conclusion "Der Junge rennt weiter.
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace MySet
|
||||
|
||||
open Set
|
||||
|
||||
Statement (A : Set ℕ) : A ⊆ univ := by
|
||||
Statement Set.subset_univ (A : Set ℕ) : A ⊆ univ := by
|
||||
Hint "**Robo**: `A ⊆ B` ist als `∀ x, x ∈ A → x ∈ B` definiert.
|
||||
|
||||
**Du**: Also kann ich mit `intro` anfangen, wie ich das bei einem `∀` funktioniert?
|
||||
@@ -43,6 +43,7 @@ Statement (A : Set ℕ) : A ⊆ univ := by
|
||||
|
||||
DisabledTactic tauto simp
|
||||
NewDefinition Symbol.Subset
|
||||
LemmaTab "Set"
|
||||
|
||||
Conclusion "Damit drehen sich die beiden Mädchen um und folgen dem Jungen."
|
||||
|
||||
|
||||
@@ -52,4 +52,5 @@ Statement Set.subset_empty_iff {A : Type _} (s : Set A) :
|
||||
rw [h]
|
||||
|
||||
DisabledTactic tauto
|
||||
NewLemma Set.Subset.antisymm Set.Subset.antisymm_iff Set.empty_subset
|
||||
NewLemma Set.Subset.antisymm Set.Subset.antisymm_iff Set.empty_subset Set.subset_univ
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -32,3 +32,4 @@ Statement Set.eq_empty_iff_forall_not_mem
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
NewLemma Set.subset_empty_iff
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -34,3 +34,4 @@ Statement Set.nonempty_iff_ne_empty
|
||||
|
||||
NewLemma ne_eq Set.eq_empty_iff_forall_not_mem
|
||||
NewDefinition Set.Nonempty
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -27,3 +27,4 @@ Statement
|
||||
simp
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -12,12 +12,12 @@ Title "Schnittmenge und Vereinigung"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Ansonsten gibt es jegliche Lemmas in
|
||||
|
||||
`import Mathlib.Data.Set.Basic`
|
||||
|
||||
Ansonsten gibt es jegliche Lemmas in der Mathlib
|
||||
die beim Umgang mit diesen Operationen weiterhelfen. Schaue in der Bibliothek auf
|
||||
der Seite nach Lemmas, die dir hier weiterhelfen!
|
||||
|
||||
Denk daran, die lemma Namen sind blockweise aus der Aussage konstruiert. Ein lemma mit
|
||||
der Aussage `C \\ (A ∩ B) + …` wird vermutlich mit `diff_inter_…` anfangen.
|
||||
"
|
||||
|
||||
open Set
|
||||
@@ -26,9 +26,15 @@ Statement
|
||||
""
|
||||
(A B : Set ℕ) : univ \ (A ∩ B) = (univ \ A) ∪ (univ \ B) ∪ (A \ B) := by
|
||||
rw [diff_inter]
|
||||
Hint (hidden := true) "mit `union_assoc` und `union_diff_distrib` kannst du
|
||||
auf der rechten Seite weiterkommen."
|
||||
rw [union_assoc]
|
||||
rw [←union_diff_distrib]
|
||||
rw [univ_union]
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
DisabledTactic tauto
|
||||
NewLemma Set.diff_inter Set.union_assoc Set.union_diff_distrib Set.univ_union
|
||||
LemmaTab "Set"
|
||||
|
||||
Conclusion "Wie du vielleicht bemerkt hast, könnte `tauto` sowas automatisch lösen."
|
||||
|
||||
@@ -16,18 +16,25 @@ sind `not_mem_compl_iff` und `compl_eq_univ_diff`.
|
||||
|
||||
open Set
|
||||
|
||||
#check not_mem_compl_iff
|
||||
#check compl_eq_univ_diff
|
||||
|
||||
Statement
|
||||
""
|
||||
(A : Set ℕ) (h : Aᶜ ⊆ A) : A = univ := by
|
||||
Hint "Start doch mit `apply Subset.antisymm`."
|
||||
apply Subset.antisymm
|
||||
simp only [subset_univ]
|
||||
Hint "Da `⊆` als `∀x, x ∈ A → x ∈ B ` definiert ist, fängst du
|
||||
am besten mit `intro` an."
|
||||
intros x hx
|
||||
Hint "Eine Möglichkeit ist, eine Fallunterscheidung zu machen: `by_cases g: {x} ∈ {A}ᶜ`."
|
||||
by_cases h4 : x ∈ Aᶜ
|
||||
exact mem_of_subset_of_mem h h4
|
||||
rw [←not_mem_compl_iff]
|
||||
exact h4
|
||||
Hint "Hier könnte `mem_of_subset_of_mem` hilfreich werden."
|
||||
apply mem_of_subset_of_mem h
|
||||
assumption
|
||||
Hint "Diese Richtung geben wir als Lemma: `not_mem_compl_iff`."
|
||||
rw [not_mem_compl_iff] at h4
|
||||
assumption
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
NewLemma Set.not_mem_compl_iff Set.mem_of_subset_of_mem Set.compl_eq_univ_diff
|
||||
DisabledTactic tauto
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -43,6 +43,9 @@ open Set
|
||||
|
||||
Statement
|
||||
(A B C : Set ℕ) : (A \ B)ᶜ ∩ (C \ B)ᶜ = ((univ \ A) \ C) ∪ (univ \ Bᶜ) := by
|
||||
Hint "Oft kann es auch nützlich sein, mit `rw [← …]` rückwärts umzuschreiben.
|
||||
Der ganze Level ist mit `rw`/`simp_rw` und den Lemmas in deiner Bibliothek
|
||||
lösbar."
|
||||
rw [←compl_union]
|
||||
rw [←union_diff_distrib]
|
||||
rw [diff_diff]
|
||||
@@ -51,7 +54,8 @@ Statement
|
||||
rw [diff_eq_compl_inter]
|
||||
rw [inter_comm]
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
|
||||
-- TODOs
|
||||
-- Lemmas compl_union compl_inter mem_compl_iff
|
||||
OnlyTactic rw simp_rw tauto trivial assumption rfl «have» «suffices»
|
||||
NewTactic simp_rw
|
||||
LemmaTab "Set"
|
||||
NewLemma Set.mem_compl_iff Set.compl_union Set.diff_diff Set.compl_inter
|
||||
Set.diff_eq_compl_inter Set.inter_comm
|
||||
|
||||
@@ -19,18 +19,20 @@ Zudem kann man mit `rw [ssubset_def]` explizit die Definition einsetzen.
|
||||
Note: `rw [subset_def]` macht das gleiche für `⊆`.
|
||||
"
|
||||
|
||||
--open Set
|
||||
open Set
|
||||
|
||||
Statement
|
||||
""
|
||||
(A B : Set ℕ) (h : A ⊂ B) : ∃ x, x ∈ B \ A := by
|
||||
cases' h with h₁ h₂
|
||||
rw [Set.subset_def] at h₂
|
||||
rw [subset_def] at h₂
|
||||
rw [not_forall] at h₂
|
||||
cases' h₂ with x hx
|
||||
use x
|
||||
rw [not_imp] at hx
|
||||
rw [Set.mem_diff]
|
||||
rw [mem_diff]
|
||||
exact hx
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
NewLemma Set.subset_def Set.ssubset_def not_imp Set.mem_diff
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -12,7 +12,7 @@ Introduction
|
||||
"
|
||||
Nun schauen wir uns konkrete Mengen an. Man schreibt diese mit
|
||||
geschweiften Klammern: `{0, 4, 117, 3}`. Meistens muss man
|
||||
den Typ explizit angeben, weil lein nicht weiss, ob man mit `Set` (Mengen)
|
||||
den Typ explizit angeben, weil Lean nicht weiss, ob man mit `Set` (Mengen)
|
||||
oder `Finset` (endliche Mengen) arbeiten möchte: `({4, 9} : Set ℕ)`.
|
||||
|
||||
`Finset` schauen wir uns später an.
|
||||
@@ -28,8 +28,9 @@ Die folgende Aufgabe ist entsprechend mit `rfl` lösbar.
|
||||
open Set
|
||||
|
||||
Statement
|
||||
"Die Menge $\\{4, 9\\}}$ ist per Definition \\{4}\\cup\\{9\\}." :
|
||||
"Die Menge $\\{4, 9\\}$ ist per Definition $\\{4}\\cup\\{9\\}$." :
|
||||
({4, 9} : Set ℕ) = Set.insert 4 {9} := by
|
||||
rfl
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
OnlyTactic rfl
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -18,7 +18,7 @@ einfaches Rezept:
|
||||
simp_rw [mem_insert_iff, mem_singleton_iff] at *
|
||||
```
|
||||
|
||||
vereinfacht Aussagen der Form `6 ∈ { 0, 6, 1}` zu `(6 = 0) ∨ (6 = 6) ∨ (6 = 1)`,
|
||||
vereinfacht Aussagen der Form `6 ∈ {0, 6, 1}` zu `(6 = 0) ∨ (6 = 6) ∨ (6 = 1)`,
|
||||
und dann kann `tauto` diese Aussage beweisen.
|
||||
|
||||
Bei `⊆` kann man wie schon vorher zuerst mit `intro x hx` die Definition
|
||||
@@ -28,12 +28,12 @@ auseinandernehmen und dann gleich vorgehen.
|
||||
|
||||
open Set
|
||||
|
||||
Statement
|
||||
"" :
|
||||
Statement :
|
||||
({2, 3, 5} : Set ℕ) ⊆ {4, 2, 5, 7, 3} := by
|
||||
Hint "Fang wieder mit `rw [subset_def]` oder direkt mit `intro` an."
|
||||
intro x hx
|
||||
simp_rw [mem_insert_iff, mem_singleton_iff] at *
|
||||
tauto
|
||||
|
||||
NewTactic simp_rw intro tauto rw
|
||||
--Lemmas Subset.antisymm_iff empty_subset
|
||||
NewLemma Set.mem_insert_iff Set.mem_singleton_iff
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -25,11 +25,14 @@ dieses Element erfüllt ist.
|
||||
|
||||
open Set
|
||||
|
||||
Statement
|
||||
"" :
|
||||
3 ∈ {n : ℕ | Odd n} := by
|
||||
Statement : 3 ∈ {n : ℕ | Odd n} := by
|
||||
rw [mem_setOf]
|
||||
Hint (hidden := true) "**Robo**: Zur Erinnerung, wenn du nicht mehr weisst, wie `Odd` definiert
|
||||
ist, benutze `rw [Odd]`."
|
||||
Branch
|
||||
rw [Odd]
|
||||
use 1
|
||||
ring
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
NewLemma Set.mem_setOf
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -27,14 +27,24 @@ open Set
|
||||
Statement
|
||||
"" (X Y : Set ℕ):
|
||||
𝒫 X ∪ 𝒫 Y ⊆ 𝒫 (X ∪ Y) := by
|
||||
Hint "**Robo**: Fang mal mit `intro` an, wie das bei `⊆` fast immer der Fall ist."
|
||||
intro A hA
|
||||
Hint "**Robo**: Als nächstes must du noch die Annahme `{A} ∈ 𝒫 X ∪ 𝒫 Y` zu
|
||||
`{A} ∈ (𝒫 X) ∨ {A} ∈ (𝒫 Y)` wechseln. Dafür kennst du schon ein Lemma."
|
||||
rw [mem_union] at hA
|
||||
Hint "**Robo**: Jetzt wär der Zeitpunkt um `mem_powerset_iff` mal überall anzuwenden."
|
||||
simp_rw [mem_powerset_iff] at *
|
||||
rcases hA with hA | hA
|
||||
apply subset_union_of_subset_left
|
||||
assumption
|
||||
apply subset_union_of_subset_right
|
||||
assumption
|
||||
Hint "**Robo**: Jetzt kann `tauto` den rest übernehmen, vielleicht solltest du diese
|
||||
Hilfe annehmen.
|
||||
Wenn nicht, brauchst du vermutlich die Lemmas `Set.subset_union_of_subset_left`
|
||||
und `Set.subset_union_of_subset_right`"
|
||||
Branch
|
||||
rcases hA with hA | hA
|
||||
apply subset_union_of_subset_left
|
||||
assumption
|
||||
apply subset_union_of_subset_right
|
||||
assumption
|
||||
tauto
|
||||
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
NewLemma Set.mem_powerset_iff Set.subset_union_of_subset_left Set.subset_union_of_subset_right
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -25,15 +25,23 @@ das gleiche.
|
||||
|
||||
open Set
|
||||
|
||||
Statement
|
||||
"" :
|
||||
Statement :
|
||||
¬Disjoint ({n : ℤ | ∃ k, n = 2 * k} : Set ℤ) ({3, 5, 6, 9, 11} : Set ℤ) := by
|
||||
unfold Disjoint
|
||||
rw [not_forall] -- why not `push_neg`?
|
||||
Hint "**Robo**: Öffne als erstes mal `Disjoint`."
|
||||
rw [Disjoint]
|
||||
Branch
|
||||
rw [not_forall] -- why not `push_neg`?
|
||||
push_neg
|
||||
Hint "**Robo**: Das sieht jetzt ein bisschen gefürchig aus, aber das ist einfach ein `∃`.
|
||||
Was du jetzt angeben musst, ist eine Menge, die Teilmenge beider Mengen
|
||||
`\{n : ℤ | ∃ k, n = 2 * k}` und `\{3, 5, 6, 9, 11}` ist.
|
||||
"
|
||||
Hint (hidden := true) "**Robo**: Versuch einmal `use \{6}`."
|
||||
use {6}
|
||||
Hint "**Robo**: Schau mal wie weit `simp` kommt."
|
||||
simp
|
||||
use 3
|
||||
ring
|
||||
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
NewDefinition Disjoint
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -33,5 +33,5 @@ Statement
|
||||
rw [hx]
|
||||
ring
|
||||
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
NewLemma Set.setOf_or Set.setOf_and Set.mem_inter_iff
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -26,6 +26,6 @@ open Set
|
||||
Statement
|
||||
"" (S : Set ℤ) :
|
||||
{ x ∈ (S : Set ℤ) | 0 ≤ x} ⊆ S := by
|
||||
library_search
|
||||
simp
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -24,3 +24,4 @@ Statement
|
||||
ring
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -23,3 +23,4 @@ Statement
|
||||
"" : True := sorry
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
LemmaTab "Set"
|
||||
|
||||
@@ -24,3 +24,4 @@ Statement
|
||||
ring
|
||||
|
||||
NewTactic constructor intro rw assumption rcases simp tauto trivial
|
||||
LemmaTab "Set"
|
||||
|
||||
Reference in New Issue
Block a user