This commit is contained in:
Jon Eugster
2023-03-29 15:37:21 +02:00
parent 4d1d97a164
commit 4ae7e0eab6
9 changed files with 179 additions and 136 deletions
@@ -29,21 +29,8 @@ Fast immer wenn man Gleichheiten von Mengen zeigen muss, will man diese in zwei
aufteilen.
"
namespace MySet
open Set Subset
-- Copied some lemmas from `Matlib.Data.Set.Basic` in order to not import the entire file.
theorem tmp {α : Type _} {s t : Set α} : s = t → s ⊆ t :=
fun h₁ _ h₂ => by rw [← h₁] ; exact h₂
theorem Subset.antisymm_iff {α : Type _} {a b : Set α} : a = b ↔ a ⊆ b ∧ b ⊆ a :=
⟨fun e => ⟨tmp e, tmp e.symm⟩, fun ⟨h₁, h₂⟩ => Set.ext fun _ => ⟨@h₁ _, @h₂ _⟩⟩
@[simp]
theorem empty_subset {α : Type _} (s : Set α) : ∅ ⊆ s :=
fun.
Statement subset_empty_iff {A : Type _} (s : Set A) :
s ⊆ ∅ ↔ s = ∅ := by
Hint "**Du**: Ja, die einzige Teilmenge der leeren Menge ist die leere Menge.
@@ -53,16 +40,16 @@ Statement subset_empty_iff {A : Type _} (s : Set A) :
Hint (hidden := true) "**Robo**: Fang doch einmal mit `constructor` an."
constructor
intro h
Hint "**Robo**: "
Hint "**Robo**: Gleichheit zwischen Mengen kann man zum Beispiel zeigen,
indem man `A ⊆ B` und `B ⊆ A` zeigt.
Dieser Schritt ist `apply Subset.antisymm`"
apply Subset.antisymm
assumption
simp only [empty_subset]
intro a
rw [Subset.antisymm_iff] at a
rcases a with ⟨h₁, h₂⟩
assumption
Hint "**Robo**: Hier ist das Lemma `empty_subset` hilfreich."
apply empty_subset
intro h
rw [h]
DisabledTactic tauto
NewLemma Subset.antisymm Subset.antisymm_iff empty_subset
end MySet
NewLemma Set.Subset.antisymm Set.Subset.antisymm_iff Set.empty_subset
@@ -12,39 +12,23 @@ Game "Adam"
World "SetTheory"
Level 5
Title "Nonempty"
Title "Empty"
Introduction
"
Das Gegenteil von `A = ∅` ist `A ≠ ∅`, aber in Lean wird der Ausdruck `A.Nonempty` bevorzugt.
Dieser ist dadurch existiert, dass in `A` ein Element existiert: `∃x, x ∈ A`.
Zeige dass die beiden Ausdrücke äquivalent sind:
Zeige folgendes Lemma, welches wir gleich brauchen werden:
"
namespace MySet
open Set
theorem subset_empty_iff {A : Type _} (s : Set A) : s ⊆ ∅ ↔ s = ∅ := by
constructor
intro h
rw [Subset.antisymm_iff]
constructor
assumption
simp only [empty_subset]
intro a
rw [Subset.antisymm_iff] at a
rcases a with ⟨h₁, h₂⟩
assumption
Statement eq_empty_iff_forall_not_mem
""
{A : Type _} (s : Set A) :
s = ∅ ↔ ∀ x, x ∉ s := by
Hint "Das Lemma `subset_empty_iff` von letzter Aufgabe könnte hilfreich sein."
rw [←subset_empty_iff]
rfl -- This is quite a miracle :)
NewTactic constructor intro rw assumption rcases simp tauto trivial
end MySet
NewLemma Set.subset_empty_iff
@@ -25,9 +25,13 @@ Statement nonempty_iff_ne_empty
""
{A : Type _} (s : Set A) :
s.Nonempty ↔ s ≠ ∅ := by
rw [Set.Nonempty]
Hint "Am besten fängst du mit `unfold Set.Nonempty` an."
unfold Set.Nonempty
Hint "Mit `ne_eq` und `eq_empty_iff_forall_not_mem` kannst du hier weiterkommen."
rw [ne_eq, eq_empty_iff_forall_not_mem]
Hint (hidden := true) "`push_neg` kann hier helfen."
push_neg
rfl
NewTactic constructor intro rw assumption rcases simp tauto trivial
NewLemma ne_eq Set.eq_empty_iff_forall_not_mem
NewDefinition Set.Nonempty
@@ -31,3 +31,4 @@ Statement
rw [univ_union]
NewTactic constructor intro rw assumption rcases simp tauto trivial
NewLemma Set.diff_inter Set.union_assoc Set.union_diff_distrib Set.univ_union