merge necessary as upstream developed while storyline slept
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Adam.Levels.Proposition
|
||||
import Adam.Levels.Implication
|
||||
import Adam.Levels.Predicate
|
||||
import Adam.Levels.Contradiction
|
||||
-- import Adam.Levels.Prime
|
||||
import Adam.Levels.Sum
|
||||
-- import Adam.Levels.Induction
|
||||
|
||||
import Adam.Levels.Numbers
|
||||
import Adam.Levels.Inequality
|
||||
|
||||
import Adam.Levels.Lean
|
||||
import Adam.Levels.SetTheory
|
||||
import Adam.Levels.Function
|
||||
import Adam.Levels.SetFunction
|
||||
import Adam.Levels.LinearAlgebra
|
||||
|
||||
|
||||
|
||||
Game "Adam"
|
||||
Title "Lean 4 game"
|
||||
Introduction
|
||||
"
|
||||
"
|
||||
|
||||
Conclusion
|
||||
"Fertig!"
|
||||
|
||||
|
||||
Path Proposition → Implication → Predicate → Predicate → Contradiction → Sum → Lean
|
||||
Path Predicate → Inequality → Sum
|
||||
-- Path Inequality → Prime
|
||||
-- Path Sum → Inequality -- → Induction
|
||||
|
||||
Path Lean → SetTheory → SetTheory2 → SetFunction → Module
|
||||
Path Lean → Function → SetFunction
|
||||
|
||||
|
||||
Path SetTheory2 → Numbers
|
||||
Path Module → Basis → Module2
|
||||
|
||||
MakeGame
|
||||
@@ -0,0 +1,514 @@
|
||||
import GameServer.Commands
|
||||
|
||||
-- Wird im Level "Implication 11" ohne Beweis angenommen.
|
||||
LemmaDoc not_not as "not_not" in "Logic"
|
||||
"
|
||||
`not_not {A : Prop} : ¬¬A ↔ A`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Ja
|
||||
* Namespace: `Classical`
|
||||
* Minimal Import: `Std.Logic`
|
||||
* Mathlib Doc: [#not_not](https://leanprover-community.github.io/mathlib4_docs/Std/Logic.html#Classical.not_not)
|
||||
"
|
||||
|
||||
-- Wird im Level "Implication 10" ohne Beweis angenommen.
|
||||
LemmaDoc not_or_of_imp as "not_or_of_imp" in "Logic"
|
||||
"
|
||||
`not_or_of_imp {A B : Prop} : (A → B) → ¬A ∨ B`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `-`
|
||||
* Minimal Import: `Mathlib.Logic.Basic`
|
||||
* Mathlib Doc: [#not_or_of_imp](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Logic/Basic.html#not_or_of_imp)
|
||||
"
|
||||
|
||||
-- Wird im Level "Implication 12" bewiesen.
|
||||
LemmaDoc imp_iff_not_or as "imp_iff_not_or" in "Logic"
|
||||
"
|
||||
`imp_iff_not_or {A B : Prop} : (A → B) ↔ (¬A ∨ B)`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `-`
|
||||
* Minimal Import: `Mathlib.Logic.Basic`
|
||||
* Mathlib Doc: [#imp_iff_not_or](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Logic/Basic.html#imp_iff_not_or)
|
||||
"
|
||||
|
||||
LemmaDoc Nat.succ_pos as "succ_pos" in "Nat"
|
||||
"
|
||||
`Nat.succ_pos (n : ℕ) : 0 < n.succ`
|
||||
|
||||
$n + 1$ ist strikt grösser als Null.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp` Lemma: Nein
|
||||
* Namespace: `Nat`
|
||||
* Minimal Import: `Mathlib.Init.Prelude`
|
||||
* Mathlib Doc: [#Nat.succ_pos](https://leanprover-community.github.io/mathlib4_docs/Init/Prelude.html#Nat.succ_pos)
|
||||
"
|
||||
|
||||
LemmaDoc Nat.pos_iff_ne_zero as "pos_iff_ne_zero" in "Nat"
|
||||
"
|
||||
`Nat.pos_iff_ne_zero {n : ℕ} : 0 < n ↔ n ≠ 0`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Nat`
|
||||
* Minimal Import: `Std.Data.Nat.Lemmas`
|
||||
* Mathlib Doc: [#Nat.pos_iff_ne_zero](https://leanprover-community.github.io/mathlib4_docs/Std/Data/Nat/Lemmas.html#Nat.pos_iff_ne_zero)
|
||||
"
|
||||
|
||||
-- TODO: Not minimal description
|
||||
LemmaDoc zero_add as "zero_add" in "Addition"
|
||||
"
|
||||
`zero_add (a : ℕ) : 0 + a = a`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Ja
|
||||
* Namespace: `-`
|
||||
* Import: `Mathlib.Nat.Basic`
|
||||
* Mathlib Doc: [#zero_add](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Group/Defs.html#zero_add)
|
||||
"
|
||||
|
||||
LemmaDoc add_zero as "add_zero" in "Addition"
|
||||
"
|
||||
This lemma says `∀ a : ℕ, a + 0 = a`.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc"
|
||||
|
||||
LemmaDoc add_succ as "add_succ" in "Addition"
|
||||
"This lemma says `∀ a b : ℕ, a + succ b = succ (a + b)`.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#]()"
|
||||
|
||||
LemmaDoc not_forall as "not_forall" in "Logic"
|
||||
"
|
||||
`not_forall {α : Sort _} {P : α → Prop} : ¬(∀ x, → P x) ↔ ∃ x, ¬P x`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Ja
|
||||
* Namespace: `-`
|
||||
* Minimal Import: `Mathlib.Logic.Basic`
|
||||
* Mathlib Doc: [#not_forall](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Logic/Basic.html#not_forall)
|
||||
"
|
||||
|
||||
LemmaDoc not_exists as "not_exists" in "Logic"
|
||||
"
|
||||
`not_exists {α : Sort _} {P : α → Prop} : (¬∃ x, P x) ↔ ∀ (x : α), ¬P x.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Ja
|
||||
* Namespace: `-`
|
||||
* Minimal Import: `Std.Logic`
|
||||
* Mathlib Doc: [#not_exists](https://leanprover-community.github.io/mathlib4_docs/Std/Logic.html#not_exists)"
|
||||
|
||||
LemmaDoc Nat.even_iff_not_odd as "even_iff_not_odd" in "Nat"
|
||||
"
|
||||
`even_iff_not_odd {n : ℕ} : Even n ↔ ¬Odd n`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Nat`
|
||||
* Minimal Import: `Mathlib.Data.Nat.Parity`
|
||||
* Mathlib Doc: [#Nat.even_iff_not_odd](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Nat/Parity.html#Nat.even_iff_not_odd)"
|
||||
|
||||
LemmaDoc Nat.odd_iff_not_even as "odd_iff_not_even" in "Nat"
|
||||
"
|
||||
`Nat.odd_iff_not_even {n : ℕ} : Odd n ↔ ¬Even n`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Ja
|
||||
* Namespace: `Nat`
|
||||
* Minimal Import: `Mathlib.Data.Nat.Parity`
|
||||
* Mathlib Doc: [#Nat.odd_iff_not_even](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Nat/Parity.html#Nat.odd_iff_not_even)"
|
||||
|
||||
LemmaDoc even_square as "even_square" in "Nat"
|
||||
"
|
||||
`even_square : (n : ℕ), Even n → Even (n ^ 2)`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* *Nicht in Mathlib*
|
||||
"
|
||||
|
||||
|
||||
|
||||
|
||||
LemmaDoc Set.mem_univ as "mem_univ" in "Set"
|
||||
"
|
||||
`Set.mem_univ {α : Type _} (x : α) : x ∈ @univ α`
|
||||
|
||||
Jedes Element ist in `univ`, der Menge aller Elemente eines Typs `α`.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Ja
|
||||
* Namespace: `Set`
|
||||
* Minimal Import: `Mathlib.Data.Set.Basic`
|
||||
* Mathlib Doc: [#mem_univ](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Basic.html#Set.mem_univ)
|
||||
"
|
||||
|
||||
LemmaDoc not_mem_empty as "not_mem_empty" in "Set"
|
||||
"
|
||||
`Set.not_mem_empty {α : Type _} (x : α) : x ∉ ∅`
|
||||
|
||||
Kein Element ist in der leeren Menge.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Set`
|
||||
* Minimal Import: `Mathlib.Data.Set.Basic`
|
||||
* Mathlib Doc: [#not_mem_empty](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Basic.html#Set.not_mem_empty)
|
||||
"
|
||||
|
||||
LemmaDoc empty_subset as "empty_subset" in "Set"
|
||||
"
|
||||
`Set.empty_subset {α : Type u} (s : Set α) : ∅ ⊆ s`
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Ja
|
||||
* Namespace: `Set`
|
||||
* Minimal Import: `Mathlib.Data.Set.Basic`
|
||||
* Mathlib Doc: [#empty_subset](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Basic.html#Set.empty_subset)
|
||||
"
|
||||
|
||||
LemmaDoc Subset.antisymm as "Subset.antisymm" in "Set"
|
||||
"
|
||||
`Set.Subset.antisymm {α : Type u} {a : Set α} {b : Set α} (h₁ : a ⊆ b) (h₂ : b ⊆ a) : a = b`
|
||||
|
||||
Zwei Mengen sind identisch, wenn sowohl $A \\subseteq B$ wie auch $B \\subseteq A$.
|
||||
## Details
|
||||
|
||||
`apply Subset.antisymm` ist eine Möglichkeit Gleichungen von Mengen zu zeigen.
|
||||
eine andere ist `ext i`, welches Elementweise funktiniert.
|
||||
Siehe auch
|
||||
[`#Subset.antisymm_iff`](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Basic.html#Set.Subset.antisymm_iff)
|
||||
für die Iff-Version.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Set.Subset`
|
||||
* Minimal Import: `Mathlib.Data.Set.Basic`
|
||||
* Mathlib Doc: [#Subset.antisymm](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Basic.html#Set.Subset.antisymm)
|
||||
"
|
||||
|
||||
LemmaDoc Subset.antisymm_iff as "Subset.antisymm_iff" in "Set"
|
||||
"
|
||||
`Set.Subset.antisymm_iff {α : Type u} {a : Set α} {b : Set α} : a = b ↔ a ⊆ b ∧ b ⊆ a`
|
||||
|
||||
Zwei Mengen sind identisch, wenn sowohl $A \\subseteq B$ wie auch $B \\subseteq A$.
|
||||
|
||||
## Details
|
||||
|
||||
`rw [Subset.antisymm_iff]` ist eine Möglichkeit Gleichungen von Mengen zu zeigen.
|
||||
eine andere ist `ext i`, welches Elementweise funktiniert.
|
||||
Siehe auch
|
||||
[`#Subset.antisymm`](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Basic.html#Set.Subset.antisymm)
|
||||
für eine verwandte Version.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Set.Subset`
|
||||
* Minimal Import: `Mathlib.Data.Set.Basic`
|
||||
* Mathlib Doc: [#Subset.antisymm_iff](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Basic.html#Set.Subset.antisymm_iff)
|
||||
"
|
||||
|
||||
|
||||
LemmaDoc Nat.prime_def_lt'' as "prime_def_lt''" in "Nat"
|
||||
"
|
||||
`Nat.prime_def_lt'' {p : ℕ} :
|
||||
Nat.Prime p ↔ 2 ≤ p ∧ ∀ (m : ℕ), m ∣ p → m = 1 ∨ m = p`
|
||||
|
||||
Die bekannte Definition einer Primmzahl in `ℕ`: Eine Zahl (`p ≥ 2`) mit genau zwei Teilern.
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Nat`
|
||||
* Mathlib Doc: [#Nat.prime_def_lt''](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Nat/Prime.html#Nat.prime_def_lt'')
|
||||
"
|
||||
|
||||
|
||||
LemmaDoc Finset.sum_add_distrib as "sum_add_distrib" in "Sum"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Finset`
|
||||
* Mathlib Doc: [#Finset.sum_add_distrib](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/BigOperators/Basic.html#Finset.sum_add_distrib)
|
||||
"
|
||||
|
||||
LemmaDoc Fin.sum_univ_castSucc as "sum_univ_castSucc" in "Sum"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Fin`
|
||||
* Mathlib Doc: [#sum_univ_castSucc](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/BigOperators/Fin.html#Fin.sum_univ_castSucc)
|
||||
"
|
||||
|
||||
LemmaDoc Nat.succ_eq_add_one as "succ_eq_add_one" in "Sum"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* `simp`-Lemma: Nein
|
||||
* Namespace: `Nat`
|
||||
* Mathlib Doc: [#succ_eq_add_one](https://leanprover-community.github.io/mathlib4_docs/Init/Data/Nat/Basic.html#Nat.succ_eq_add_one)
|
||||
"
|
||||
|
||||
LemmaDoc Nat.zero_eq as "zero_eq" in "Sum"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#zero_eq](https://leanprover-community.github.io/mathlib4_docs/Init/Data/Nat/Basic.html#Nat.zero_eq)
|
||||
"
|
||||
|
||||
LemmaDoc add_comm as "add_comm" in "Nat"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#add_comm](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Group/Defs.html#add_comm)
|
||||
"
|
||||
|
||||
LemmaDoc mul_add as "mul_add" in "Nat"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#mul_add](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Ring/Defs.html#mul_add)
|
||||
"
|
||||
|
||||
LemmaDoc add_mul as "add_mul" in "Nat"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#add_mul](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Ring/Defs.html#add_mul)
|
||||
"
|
||||
|
||||
LemmaDoc arithmetic_sum as "arithmetic_sum" in "Sum"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Not a mathlib lemma.
|
||||
"
|
||||
|
||||
LemmaDoc add_pow_two as "add_pow_two" in "Nat"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#add_pow_two](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/GroupPower/Ring.html#add_pow_two)
|
||||
"
|
||||
|
||||
LemmaDoc Finset.sum_comm as "Finset.sum_comm" in "Sum"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#sum_comm](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/BigOperators/Basic.html#Finset.sum_comm)
|
||||
"
|
||||
|
||||
LemmaDoc Function.comp_apply as "Function.comp_apply" in "Function"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#comp_apply](https://leanprover-community.github.io/mathlib4_docs/Init/Core.html#Function.comp_apply)
|
||||
"
|
||||
|
||||
LemmaDoc not_le as "not_le" in "Logic"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#not_le](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Init/Algebra/Order.html#not_le)
|
||||
"
|
||||
|
||||
LemmaDoc if_pos as "if_pos" in "Logic"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#if_pos](https://leanprover-community.github.io/mathlib4_docs/Init/Core.html#if_pos)
|
||||
"
|
||||
|
||||
LemmaDoc if_neg as "if_neg" in "Logic"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#if_neg](https://leanprover-community.github.io/mathlib4_docs/Init/Core.html#if_neg)
|
||||
"
|
||||
|
||||
LemmaDoc StrictMono.injective as "StrictMono.injective" in "Function"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#StrictMono.injective](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Order/Monotone/Basic.html#StrictMono.injective)
|
||||
"
|
||||
|
||||
LemmaDoc StrictMono.add as "StrictMono.add" in "Function"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#StrictMono.add](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Order/Monoid/Lemmas.html#StrictMono.add)
|
||||
"
|
||||
|
||||
LemmaDoc Odd.strictMono_pow as "Odd.strictMono_pow" in "Function"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#Odd.strictMono_pow](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Parity.html#Odd.strictMono_pow)
|
||||
"
|
||||
|
||||
LemmaDoc Exists.choose as "Exists.choose" in "Function"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#Exists.choose](https://leanprover-community.github.io/mathlib4_docs/Std/Logic.html#Exists.choose)
|
||||
"
|
||||
|
||||
LemmaDoc Exists.choose_spec as "Exists.choose_spec" in "Function"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#Exists.choose_spec](https://leanprover-community.github.io/mathlib4_docs/Std/Logic.html#Exists.choose_spec)
|
||||
"
|
||||
LemmaDoc congrArg as "congrArg" in "Function"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#congrArg](https://leanprover-community.github.io/mathlib4_docs/Init/Prelude.html#congrArg)
|
||||
"
|
||||
LemmaDoc congrFun as "congrFun" in "Function"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#congrFun](https://leanprover-community.github.io/mathlib4_docs/Init/Prelude.html#congrFun)
|
||||
"
|
||||
|
||||
LemmaDoc Iff.symm as "Iff.symm" in "Logic"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#Iff.symm](https://leanprover-community.github.io/mathlib4_docs/Init/Core.html#Iff.symm)
|
||||
"
|
||||
|
||||
|
||||
|
||||
/-! ## Definitions -/
|
||||
|
||||
DefinitionDoc Even as "Even"
|
||||
"
|
||||
`even n` ist definiert als `∃ r, a = 2 * r`.
|
||||
Die Definition kann man mit `unfold even at *` einsetzen.
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#Even](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Parity.html#Even)"
|
||||
|
||||
DefinitionDoc Odd as "Odd"
|
||||
"
|
||||
`odd n` ist definiert als `∃ r, a = 2 * r + 1`.
|
||||
Die Definition kann man mit `unfold odd at *` einsetzen.
|
||||
|
||||
* Mathlib Doc: [Odd](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Parity.html#Odd)"
|
||||
|
||||
DefinitionDoc Injective as "Injective"
|
||||
"
|
||||
`Injective f` ist definiert als
|
||||
|
||||
```
|
||||
∀ a b, f a = f b → a = b
|
||||
```
|
||||
definiert.
|
||||
|
||||
* Mathlib Doc: [Injective](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Init/Function.html#Function.Injective)"
|
||||
|
||||
DefinitionDoc Surjective as "Surjective"
|
||||
"
|
||||
`Surjective f` ist definiert als
|
||||
|
||||
```
|
||||
∀ a, (∃ b, f a = b)
|
||||
```
|
||||
|
||||
* Mathlib Doc: [Surjective](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Init/Function.html#Function.Surjective)"
|
||||
|
||||
DefinitionDoc Bijective as "Bijective"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#Bijective](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Init/Function.html#Function.Bijective)
|
||||
"
|
||||
|
||||
DefinitionDoc LeftInverse as "LeftInverse"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#LeftInverse](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Init/Function.html#Function.LeftInverse)
|
||||
"
|
||||
|
||||
DefinitionDoc RightInverse as "RightInverse"
|
||||
"
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#RightInverse](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Init/Logic.html#RightInverse)
|
||||
"
|
||||
|
||||
DefinitionDoc StrictMono as "StrictMono"
|
||||
"
|
||||
`StrictMono f` ist definiert als
|
||||
|
||||
```
|
||||
∀ a b, a < b → f a < f b
|
||||
```
|
||||
|
||||
## Eigenschaften
|
||||
|
||||
* Mathlib Doc: [#StrictMono](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Order/Monotone/Basic.html#StrictMono)
|
||||
|
||||
"
|
||||
|
||||
DefinitionDoc Symbol.Subset as "⊆" "
|
||||
|
||||
Auf Mengen (`Set`) ist `A ⊆ B` als `∀x, x ∈ A → x ∈ B` implementiert.
|
||||
"
|
||||
@@ -0,0 +1,16 @@
|
||||
import Adam.Levels.Contradiction.L01_Have
|
||||
import Adam.Levels.Contradiction.L02_Suffices
|
||||
import Adam.Levels.Contradiction.L03_ByContra
|
||||
import Adam.Levels.Contradiction.L04_ByContra
|
||||
import Adam.Levels.Contradiction.L05_Contrapose
|
||||
import Adam.Levels.Contradiction.L06_Summary
|
||||
|
||||
Game "Adam"
|
||||
World "Contradiction"
|
||||
Title "Widerspruch"
|
||||
|
||||
Introduction "
|
||||
Ihr begebt euch auf die Suche nach *Oddeus*. Nach etwas rumfragen, kommt ihr tatsächlich an
|
||||
eine Dornenfestung und nachdem ihr erklärt habt, wer ihr seit, werdet ihr auf eine Audienz
|
||||
gebeten.
|
||||
"
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
import TestGame.ToBePorted
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Contradiction"
|
||||
Level 1
|
||||
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
import TestGame.ToBePorted
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Contradiction"
|
||||
Level 2
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
@@ -6,9 +6,9 @@ import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
import Mathlib
|
||||
|
||||
import TestGame.ToBePorted
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Contradiction"
|
||||
Level 3
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
@@ -6,9 +6,9 @@ import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
import Mathlib
|
||||
|
||||
import TestGame.ToBePorted
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Contradiction"
|
||||
Level 4
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
import TestGame.ToBePorted
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Contradiction"
|
||||
Level 5
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
import TestGame.ToBePorted
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Contradiction"
|
||||
Level 6
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import Adam.Levels.Function.L01_Function
|
||||
import Adam.Levels.Function.L02_Let
|
||||
import Adam.Levels.Function.L03_Piecewise
|
||||
import Adam.Levels.Function.L04_Injective
|
||||
import Adam.Levels.Function.L05_Injective
|
||||
import Adam.Levels.Function.L06_Injective
|
||||
import Adam.Levels.Function.L07_Surjective
|
||||
import Adam.Levels.Function.L08_Bijective
|
||||
import Adam.Levels.Function.L09_Inverse
|
||||
import Adam.Levels.Function.L11_Inverse
|
||||
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Title "Abbildungen"
|
||||
|
||||
Introduction "
|
||||
Auf der Suche nach dem Buch der Urbilder landet ihr auf einem kleinen Mond, der bis auf
|
||||
eine Insel komplett mit Wasser bedeckt zu sein scheint.
|
||||
|
||||
Auf der Insel seht ihr verschiedene große und kleine Behausungen, manche aus Stroh und Holz,
|
||||
vereinzelte aus Lehm.
|
||||
|
||||
Planlos geht ihr zum ersten Haus bei dem jemand vorne außen sitzt.
|
||||
"
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 1
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 2
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 3
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 4
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 5
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 6
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 7
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 8
|
||||
|
||||
@@ -33,6 +33,6 @@ Hint : Bijective (fun (n : ℤ) ↦ n + 1) =>
|
||||
|
||||
Conclusion
|
||||
"Zufrieden drückt euch der Gelehrte eine neue Fackel in die Hand und
|
||||
zeigt euch den Weg nach draussen."
|
||||
zeigt euch den Weg nach draußen."
|
||||
|
||||
NewDefinition Bijective
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 9
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 10
|
||||
|
||||
+15
-15
@@ -1,18 +1,18 @@
|
||||
import TestGame.Levels.Implication.L01_Intro
|
||||
import TestGame.Levels.Implication.L02_Revert
|
||||
import TestGame.Levels.Implication.L03_Apply
|
||||
import TestGame.Levels.Implication.L04_Apply
|
||||
import TestGame.Levels.Implication.L05_Apply
|
||||
import TestGame.Levels.Implication.L06_Iff
|
||||
import TestGame.Levels.Implication.L07_Rw
|
||||
import TestGame.Levels.Implication.L08_Iff
|
||||
import TestGame.Levels.Implication.L09_Iff
|
||||
import TestGame.Levels.Implication.L10_Apply
|
||||
import TestGame.Levels.Implication.L11_ByCases
|
||||
import TestGame.Levels.Implication.L12_Rw
|
||||
import TestGame.Levels.Implication.L13_Summary
|
||||
import Adam.Levels.Implication.L01_Intro
|
||||
import Adam.Levels.Implication.L02_Revert
|
||||
import Adam.Levels.Implication.L03_Apply
|
||||
import Adam.Levels.Implication.L04_Apply
|
||||
import Adam.Levels.Implication.L05_Apply
|
||||
import Adam.Levels.Implication.L06_Iff
|
||||
import Adam.Levels.Implication.L07_Rw
|
||||
import Adam.Levels.Implication.L08_Iff
|
||||
import Adam.Levels.Implication.L09_Iff
|
||||
import Adam.Levels.Implication.L10_Apply
|
||||
import Adam.Levels.Implication.L11_ByCases
|
||||
import Adam.Levels.Implication.L12_Rw
|
||||
import Adam.Levels.Implication.L13_Summary
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Title "Aussagenlogik 2"
|
||||
|
||||
@@ -28,7 +28,7 @@ aber niemand von den Einwohnern wusste was davon...
|
||||
erzählen…
|
||||
|
||||
Und damit leitet Robo den Landeanflug ein. Implis scheint ein riesiger Tagbau zu sein auf
|
||||
dem nach allem möglichen gegraben wird. Überall seht ihr Förderbänder kreuz und queer.
|
||||
dem nach allem möglichen gegraben wird. Überall seht ihr Förderbänder kreuz und quer.
|
||||
|
||||
Das Operationsteam begrüsst euch freundlich und lädt zum Essen im Kommandoturm.
|
||||
"
|
||||
+4
-3
@@ -1,9 +1,9 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Tauto
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 1
|
||||
|
||||
@@ -18,7 +18,8 @@ Statement (A B : Prop) (hb : B) : A → (A ∧ B) := by
|
||||
Hint "**Du**: Einen Moment, das ist eine Implikation (`\\to`),
|
||||
also `A` impliziert `A und B`, soweit so gut, also eine Tautologie.
|
||||
|
||||
**Robo**: Die scheinen hier `tauto` auch nicht zu verstehen.
|
||||
**Robo**: Du hast recht, eigentlich könnte man `tauto` sagen,
|
||||
aber das scheinen die hier tauto nicht zu verstehen.
|
||||
Implikationen kannst du aber mit `intro h` angehen."
|
||||
intro hA
|
||||
Hint "**Du**: Jetzt habe ich also angenommen, dass `A` wahr ist und muss `A ∧ B` zeigen,
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 2
|
||||
|
||||
+3
-10
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 3
|
||||
|
||||
@@ -11,17 +11,10 @@ Introduction
|
||||
"
|
||||
Sein Kollege zieht eine Linie unter deinen Beweis, schreibt ein durchgestrichenes ~`revert`~
|
||||
hin und gibt dir das Blatt wieder.
|
||||
`revert` ist aber nur selten der richtige Weg.
|
||||
|
||||
Im vorigen Beispiel würde man besser die Implikation $A \\Rightarrow B$ *anwenden*, also
|
||||
sagen \"Es genügt $A$ zu zeigen, denn $A \\Rightarrow B$\" und danach $A$ beweisen.
|
||||
|
||||
Wenn man eine Implikation `(g : A → B)` in den Annahmen hat, bei welcher die Konsequenz
|
||||
(also $B$) mit dem Goal übereinstimmt, kann man `apply g` genau dies machen.
|
||||
"
|
||||
|
||||
Statement (A B : Prop) (hA : A) (h : A → B) : B := by
|
||||
Hint "**Robo**: Du hast natürlich recht, normalerweise ist es viel schöner mit
|
||||
Hint "**Robo**: Da hat er natürlich recht, normalerweise ist es viel schöner mit
|
||||
`apply {h}` die Implikation anzuwenden."
|
||||
apply h
|
||||
Hint "**Du**: Und jetzt genügt es also `A` zu zeigen."
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 4
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 5
|
||||
|
||||
@@ -8,7 +8,7 @@ Title "Implikation"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Selbstsicher folgt ihr den Anweisungen und geht nach draussen zum
|
||||
Selbstsicher folgt ihr den Anweisungen und geht nach draußen zum
|
||||
defekten Kontrollelement. Dieses zeigt ein kompliziertes Diagram:
|
||||
$$
|
||||
\\begin{CD}
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 6
|
||||
|
||||
@@ -37,7 +37,7 @@ hier bei `(h : A ↔ B)` heissen sie `h.mp` und `h.mpr`.
|
||||
**Operationsleiter**: \"Modulo Ponens\" ist ein lokaler Begriff hier,
|
||||
aber das ist doch nicht wichtig.
|
||||
|
||||
**Robo**: Und das \"r\" in `mpr` stünde für \"reverse\" weils die Rückrichtung ist.
|
||||
**Robo**: Und das \"r\" in `mpr` stünde für \"reverse\" weil's die Rückrichtung ist.
|
||||
"
|
||||
|
||||
NewTactic constructor
|
||||
+4
-2
@@ -1,9 +1,11 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Init.Data.ToString
|
||||
-- #check List UInt8
|
||||
|
||||
Game "TestGame"
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 7
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 8
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Cases
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 9
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Cases
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 10
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Cases
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 11
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Cases
|
||||
import Mathlib.Logic.Basic
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 12
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 13
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import Adam.Levels.Induction.L01_Induction
|
||||
|
||||
Game "Adam"
|
||||
World "Induction"
|
||||
Title "Übungen Induktions"
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Induction"
|
||||
Level 1
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import Adam.Levels.Inequality.L01_LE
|
||||
import Adam.Levels.Inequality.L02_Pos
|
||||
import Adam.Levels.Inequality.L03_Linarith
|
||||
import Adam.Levels.Inequality.L04_Linarith
|
||||
|
||||
Game "Adam"
|
||||
World "Inequality"
|
||||
Title "Ungleichung"
|
||||
|
||||
Introduction "
|
||||
Später erinnerst du dich gar nicht mehr wo und wann du diese Unterhaltung hattest, geschweige
|
||||
denn mit wem. Vielleicht war es ein Traum, oder eine Erscheinung. Vielleicht war es
|
||||
auch nur eines Abends über einer Runde Getränke.
|
||||
|
||||
Aber auf jedenfall hast du irgendwo gelernt, was du nun weisst.
|
||||
"
|
||||
@@ -0,0 +1,34 @@
|
||||
import Adam.Metadata
|
||||
|
||||
Game "Adam"
|
||||
World "Inequality"
|
||||
Level 1
|
||||
|
||||
Title "Kleinergleich"
|
||||
|
||||
Introduction
|
||||
"
|
||||
*(Gesrpäch)*
|
||||
|
||||
**Robo** (*lallend*, oder war's fröhlich proklamierend?):
|
||||
…und deshalb sind `≥` und `>` eigentlich nur Notationen für `≤`,
|
||||
welches man übrigens `\\le` schreibt, was für Less-Equal (also Kleinergleich) steht…
|
||||
|
||||
**Du**: Wir haben's verstanden, man benützt also Standartmässig lieber `≤` und `<`,
|
||||
aber damit weiß ich eh nichts anzufangen.
|
||||
|
||||
**dritte Person**: Komm schon, das kannst du ja sicher:
|
||||
"
|
||||
|
||||
Statement
|
||||
(n m : ℕ) : m < n ↔ m.succ ≤ n := by
|
||||
Hint "**Robo**: Du Narr! Das ist doch eine Kuriosität, dass `m < n` auf `ℕ` per Definition
|
||||
als `m + 1 ≤ n` definiert ist!
|
||||
|
||||
**dritte Person**: Du verdirbst den Witz! Ich wollte ihn doch nur testen."
|
||||
rfl
|
||||
|
||||
OnlyTactic rfl
|
||||
|
||||
Conclusion "**Du**: Ha. ha… Na aber jetzt mal ehrlich, könnt ihr mir ein bisschen mehr
|
||||
erzählen?"
|
||||
@@ -0,0 +1,53 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Tactic.LibrarySearch
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "Adam"
|
||||
World "Inequality"
|
||||
Level 2
|
||||
|
||||
Title "Kleinergleich"
|
||||
|
||||
Introduction
|
||||
"
|
||||
*weitere Person*: …ich sag dir, eine positive Zahl kann man sowohl mit `0 < n`
|
||||
als auch `n ≠ 0` darstellen.
|
||||
|
||||
*Robo*: Und da gibts leider keinen Standard dazu.
|
||||
|
||||
**weitere Person*: Ja und, da kann man ja einfach mit `Nat.pos_iff_ne_zero`
|
||||
wechseln. Wart mal, wieso galt das nochmals…
|
||||
"
|
||||
|
||||
Statement Nat.pos_iff_ne_zero (n : ℕ) : 0 < n ↔ n ≠ 0 := by
|
||||
Hint "**Robo** (*flüsternd*): Wenn du ein bisschen schwere Maschinerie auffahren willst,
|
||||
um in zu beeindrucken, hab ich was. Mach doch eine Fallunterscheidung ob `n` Null ist
|
||||
oder nicht!
|
||||
|
||||
**Du** (*flüsternd*): Und wie geht das?
|
||||
|
||||
**Robo** (*laut und selbstsicher*): Wir fangen mit `rcases n` an!"
|
||||
rcases n
|
||||
Hint "**Du**: Hmm, das muss man doch vereinfachen können.
|
||||
|
||||
**Robo** (*flüsternd*): Zweiter pompöser Auftritt: sag einfach `simp` und lass das alles
|
||||
automatisch geschehen."
|
||||
simp
|
||||
Hint "**Du**: Und hier fang ich wohl am besten an wie ich das schon kenne."
|
||||
constructor
|
||||
intro
|
||||
simp
|
||||
intro
|
||||
Hint "**Robo**: Warte! Den Rest geb ich dir als Lemma: `Nat.suc_pos`."
|
||||
apply Nat.succ_pos
|
||||
|
||||
NewTactic simp
|
||||
NewLemma Nat.succ_pos
|
||||
DisabledLemma Nat.pos_iff_ne_zero
|
||||
|
||||
Conclusion "**Du**: Oh `simp` ist ja echt nicht schlecht…
|
||||
|
||||
Die andere Person scheint beeindruckt, hat aber gleichzeitig auch das Bedürfnis, Dich aus
|
||||
der Reserve zu locken."
|
||||
@@ -0,0 +1,26 @@
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Linarith
|
||||
|
||||
Game "Adam"
|
||||
World "Inequality"
|
||||
Level 3
|
||||
|
||||
Title "Linarith"
|
||||
|
||||
Introduction
|
||||
"
|
||||
**dritte Person**: Nah wenn wir so spielen:
|
||||
"
|
||||
|
||||
Statement (n : ℕ) (h : 2 ≤ n) : n ≠ 0 := by
|
||||
Hint "**Du**: `simp` geht hier nicht, was mir ja auch einläuchtet.
|
||||
|
||||
**Robo**: Ist auch keine Vereinfachung, die du machen willst. Stattdessen,
|
||||
`linarith` kann lineare Gleichungen und Ungleichungen lösen. Das ist das Powertool
|
||||
in der hinsicht."
|
||||
linarith
|
||||
|
||||
NewTactic linarith
|
||||
NewLemma Nat.pos_iff_ne_zero
|
||||
|
||||
Conclusion "**Du**: Naja so beeindruckend war das jetzt auch noch nicht."
|
||||
@@ -0,0 +1,29 @@
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Linarith
|
||||
|
||||
Game "Adam"
|
||||
World "Inequality"
|
||||
Level 4
|
||||
|
||||
Title "Linarith"
|
||||
|
||||
Introduction
|
||||
"
|
||||
**Robo**: Die Taktik kann aber noch viel mehr.
|
||||
|
||||
**weitere Person**: Hier, probier mal!
|
||||
|
||||
$$
|
||||
\\begin{aligned}
|
||||
5 * y &\\le 35 - 2 * x \\\\
|
||||
2 * y &\\le x + 3
|
||||
\\end{aligned}
|
||||
$$
|
||||
"
|
||||
|
||||
Statement (x y : ℤ) (h₂ : 5 * y ≤ 35 - 2 * x) (h₃ : 2 * y ≤ x + 3) : y ≤ 5 := by
|
||||
linarith
|
||||
|
||||
Conclusion "**Du**: Boah, das ist schon gar nicht schlecht.
|
||||
|
||||
Und damit endet auch Deine Erinnerung und wer weiss was du anschließend gemacht hast…"
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Inequality"
|
||||
Level 1
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import Adam.Levels.Lean.L01_Type
|
||||
import Adam.Levels.Lean.L02_Universe
|
||||
import Adam.Levels.Lean.L03_ImplicitArguments
|
||||
import Adam.Levels.Lean.L04_InstanceArguments
|
||||
|
||||
Game "Adam"
|
||||
World "Lean"
|
||||
Title "Lean"
|
||||
|
||||
Introduction
|
||||
"Während ihr weiter durch Täler, über Geröllhalden und zwischen monumentalen Steintürmen
|
||||
umherzieht, fragst Du eines Tages Robo.
|
||||
|
||||
**Du**: Sag mal, hast du dir je Gedanken dazu gemacht, wie du eigentlich funktionierts?
|
||||
|
||||
**Robo**: Was meinst du, wie ich funktioniere? Ich bin halt… ich…
|
||||
|
||||
**Du**: Ja schon, aber was woher weisst du denn alles was du weisst?
|
||||
|
||||
**Robo**: Das kann ich dir sagen. Früher habe ich viele Datenträger verschlungen,
|
||||
und dadurch gelernt.
|
||||
|
||||
**Du**: Ob so eine Diskette wohl lecker schmeckt? Egal, ich hab ein paar Fragen zu deinem
|
||||
Lean-Modul.
|
||||
|
||||
**Robo**: Na dann nur zu!"
|
||||
@@ -0,0 +1,41 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "Adam"
|
||||
World "Lean"
|
||||
Level 1
|
||||
|
||||
Title "Typen"
|
||||
|
||||
Introduction
|
||||
"
|
||||
**Du**: Also, wieso schreib ich denn sowohl `(n : ℕ)` für eine natürliche Zahl wie
|
||||
auch `(h : A ∧ ¬ B)` für eine Aussage?
|
||||
|
||||
**Robo**: Alles in Lean sind Objekte von einem *Typen*, man nennt das auch
|
||||
\"dependent type theory\". Rechts vom `:` steht immer der Typ der dieses Objekt hat.
|
||||
|
||||
**Du**: Verstehe, dann war `ℕ` der Typ der natürlichen Zahlen, `Prop` der Typ
|
||||
aller logischen Aussagen, und so weiter. Un wenn `R` einfach irgendein Typ ist, dann…
|
||||
|
||||
**Robot: …würdest du das als `(R : Type)` schreiben.
|
||||
|
||||
**Du**: Also sind Typen ein bisschen jene Grundlage, die in meinem Studium die
|
||||
Mengen eingenommen haben?
|
||||
|
||||
**Robo**: Genau. Ein Ring ist dann zum Beispiel als `(R : Type) [Ring R]` definiert,
|
||||
also als Typen, auf dem eine Ringstruktur besteht.
|
||||
|
||||
**Robo**: Hier ein Beispiel. Die Taktik `ring` funktioniert in jedem Typen, der
|
||||
genügend Struktur definiert hat, zum Beispiel in einem kommutativen Ring:
|
||||
"
|
||||
|
||||
Statement (R : Type) [CommRing R] (a b : R) : a + b = b + a := by
|
||||
ring
|
||||
|
||||
Conclusion "**Robo**: `[CommRing R]` nennt man übrigens eine Instanz und die
|
||||
eckigen Klammern sagen Lean, dass es automatisch suchen soll, ob es so eine Instanz
|
||||
findet, wenn man ein Lemma anwenden will."
|
||||
@@ -0,0 +1,44 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "Adam"
|
||||
World "Lean"
|
||||
Level 2
|
||||
|
||||
Title "Universen"
|
||||
|
||||
Introduction
|
||||
"**Du**: Aber wenn alles Typen sind, welcher Typ hat dann `Type`?
|
||||
|
||||
**Robo**: `Type 1` und dieser hat Typ `Type 2`, etc.
|
||||
|
||||
**Robo**: Die Zahl nennt man *Universum*. Manchmal führt man Universen explizit
|
||||
mit `universum u` ein, öfter siehst du `(R : Type _)`, was einfach ein Platzhalter
|
||||
für irgend ein Universum ist.
|
||||
|
||||
**Du**: Das klingt ein bisschen nach Mengentheoretische Probleme, die man normalerweise
|
||||
ignoriert.
|
||||
|
||||
**Robo**: Genau! Deshalb schreibt man eigentlich immer einfach `Type _` und ist glücklich.
|
||||
Spezifischer muss man erst werden wenn man sowas wie Kategorientheorie anschaut, wo
|
||||
man die Universen tatsächlich kontrollieren muss.
|
||||
|
||||
**Du**: Oke, hier rein, da raus. Aber hast du mir noch eine Aufgabe?
|
||||
"
|
||||
|
||||
universe u
|
||||
|
||||
Statement
|
||||
(R : Type u) [CommRing R] (a b : R) : a + b = b + a := by
|
||||
Hint "**Robo**: Naja, Aufgaben zu Universen sind nicht so natürlich,
|
||||
aber vorige Aufgabe würde man eigentlich besser so schreiben, da
|
||||
kannst du mindestens das Uniersum beobachten."
|
||||
ring
|
||||
|
||||
Conclusion "**Du**: Na dann. Aber gut dass ich's mal gesehen hab."
|
||||
|
||||
-- Hint (R : Type) (h : CommRing R) (a : R) (b : R) : a + b = b + a =>
|
||||
-- ""
|
||||
@@ -0,0 +1,71 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib
|
||||
import Adam.ToBePorted
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "Adam"
|
||||
World "Lean"
|
||||
Level 3
|
||||
|
||||
Title "Implizite Argumente"
|
||||
|
||||
Introduction
|
||||
"
|
||||
**Du**: Was mich aber mehr beschäftigt, ist, dass Lemmas manchmal viel mehr Argumente
|
||||
haben als ich hinschreiben muss.
|
||||
|
||||
**Robo**: Lean kann manche Argumente aus dem Kontext erschliessen. Hast du zum Beispiel
|
||||
ein Lemma von vorhin
|
||||
|
||||
```
|
||||
lemma Fin.sum_univ_castSucc {β : Type _} [AddCommMonoid β] {n : ℕ} (f : Fin (n + 1) → β) :
|
||||
∑ i : Fin (n + 1), f i = ∑ i : Fin n, f (↑Fin.castSucc.toEmbedding i) + f (Fin.last n) := by
|
||||
sorry
|
||||
```
|
||||
|
||||
dann reicht es ja Lean `f` zu geben und daraus kann es herausfinden, was die anderen
|
||||
(`β`, `n`) sein müssen.
|
||||
|
||||
**Robo**: Solche *implizite Argumente* markiert man dann mit `{_ : _}` während
|
||||
*explizite Arumente* mit `(_ : _)` markiert werden.
|
||||
|
||||
**Du**: Dann könnte ich also einfach `Fin.sum_univ_castSucc f` schreiben?
|
||||
|
||||
**Robo**: Genau!
|
||||
|
||||
**Du**: Und was war dann das `(n := m + 1)` vorhin genau?
|
||||
|
||||
**Robo**: Damit kann man im Aussnahmefall die impliziten Argumente doch angeben. Hier haben wir
|
||||
gesagt, es soll für das Argument `n` den Term `m + 1` einsetzen. Hier mach das doch noch einmal
|
||||
unter weniger Stress:
|
||||
"
|
||||
|
||||
open BigOperators
|
||||
|
||||
Statement (m : ℕ) : ∑ i : Fin (m + 1), (i : ℕ) + (m + 1) = ∑ i : Fin (Nat.succ m + 1), ↑i := by
|
||||
Branch
|
||||
rw [Fin.sum_univ_castSucc]
|
||||
Hint "**Robo**: Siehst du, ohne die Hilfe macht es das Falsche. Deshalb muss man hier
|
||||
explizit mit `Fin.sum_univ_castSucc (n := m + 1)` nachhelfen."
|
||||
rw [Fin.sum_univ_castSucc]
|
||||
Hint "**Robo**: Na klar, in dem Beispiel kannst du einfach weiter umschreiben bis es
|
||||
nicht mehr geht, aber das war nicht der Punkt…"
|
||||
rw [Fin.sum_univ_castSucc]
|
||||
Hint "**Robo**: Na klar, in dem Beispiel kannst du einfach weiter umschreiben bis es
|
||||
nicht mehr geht, aber das war nicht der Punkt…"
|
||||
rfl
|
||||
rw [Fin.sum_univ_castSucc (n := m + 1)]
|
||||
rfl
|
||||
|
||||
OnlyTactic rw rfl
|
||||
|
||||
Conclusion "**Du**: Gibt es auch noch ander Methoden implizite Argumente anzugeben.
|
||||
|
||||
**Robo** `@Fin.sum_univ_castSucc` würde *alle* Argumente explizit machen,
|
||||
aber das ist unparktischer, weil man dann irgendwie
|
||||
`@Fin.sum_univ_castSucc _ _ (m + 1)` schreiben müsste.
|
||||
|
||||
**Du**: Ah und ich sehe der `_` ist überall in Lean ein Platzhalter, der automatisch
|
||||
gefüllt wird."
|
||||
@@ -0,0 +1,57 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib
|
||||
import Adam.ToBePorted
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "Adam"
|
||||
World "Lean"
|
||||
Level 4
|
||||
|
||||
Title "Instanz-Argumente"
|
||||
|
||||
Introduction
|
||||
"**Du**: Also nochmals als Zusammenfassung, dann gibt es 3 Arten von Argumenten,
|
||||
explizite mit `()`, implizite mit `{}` und Instanzen mit `[]`?
|
||||
|
||||
**Robo**: Korrekt. Instanzen sind damit auch Implizite Argumente. Der Unterschied
|
||||
zwischen `{}` und `[]` ist also *wie* Lean diese füllt.
|
||||
|
||||
**Du**: Verstehe, bei den ersten sucht es logisch nach einer richtigen Möglichkeit,
|
||||
beim zweiten geht's durch alle Instanzen, die es kennt.
|
||||
|
||||
|
||||
**Robo**: Funktioniert hier bei mir nicht, aber wenn du ausserhalb eines Beweises
|
||||
`#synth Ring ℤ` in ein Dokument schreibt, zeigt dir Lean, ob es eine Instanz finden kann.
|
||||
|
||||
**Du**: Ich glaube das macht alles Sinn.
|
||||
|
||||
**Robo**: Hier, mach nochmals das Gleiche wie vorhin aber mit @-Syntax um das zu
|
||||
verinnerlichen:
|
||||
"
|
||||
|
||||
open BigOperators
|
||||
|
||||
Statement (m : ℕ) :
|
||||
∑ i : Fin (m + 1), (i : ℕ) + (m + 1) = ∑ i : Fin (Nat.succ m + 1), ↑i := by
|
||||
Hint "*Robo*: Schreibe `rw [@Fin.sum_univ_castSucc _ _ (m + 1)]`
|
||||
anstatt `rw [Fin.sum_univ_castSucc (n := m + 1)]`!"
|
||||
rw [@Fin.sum_univ_castSucc _ _ (m + 1)]
|
||||
rfl
|
||||
|
||||
OnlyTactic rw rfl
|
||||
|
||||
Conclusion "
|
||||
**Du**: Danke Robo!
|
||||
|
||||
Um zwei weitere Ecken und plötzlich steht ihr wieder vor dem Golem, dem ihr schon begegnet seit.
|
||||
Dieser lädt euch zum Abendmahl ein. Ihr erfährt, dass er ganz gerne liest und er zeigt euch
|
||||
sein neustes Buch, das er leider nicht lesen kann. Nich tnur ist es der zweite Band einer Serie
|
||||
(der Erste hat offensichtlich was mit \"Urbildern\" zu tun), sondern ist es auch in einem
|
||||
Dialekt geschrieben, der anscheinend nur auf einem Nachbarsmond gesprochen wird.
|
||||
|
||||
Ihr beschliesst dem herzlichen Golem zu helfen und beiden Monden einen Besuch abzustatten,
|
||||
sowohl um den Dialekt zu lernen, wie auch in der Bibliothek auf dem anderen Mond nach dem
|
||||
ersten Band zu suchen.
|
||||
"
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Implication"
|
||||
Level 9
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Nat2"
|
||||
Level 3
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Nat2"
|
||||
Level 5
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
@@ -21,7 +21,7 @@ lemma even_square (n : ℕ) : even n → even (n ^ 2) := by
|
||||
|
||||
def prime (n : ℕ) : Prop := (2 ≤ n) ∧ ∀ a b, n = a * b → a = 1 ∨ b = 1
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Nat"
|
||||
Level 4
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
-- -- INCORPORATED
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Function"
|
||||
Level 1
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import Adam.Levels.LinearAlgebra.L01_Module
|
||||
import Adam.Levels.LinearAlgebra.L02_VectorNotation
|
||||
import Adam.Levels.LinearAlgebra.L03_VectorNotation
|
||||
import Adam.Levels.LinearAlgebra.L04_Submodule
|
||||
import Adam.Levels.LinearAlgebra.L05_Submodule
|
||||
import Adam.Levels.LinearAlgebra.L06_Span
|
||||
import Adam.Levels.LinearAlgebra.L07_Span
|
||||
import Adam.Levels.LinearAlgebra.L08_GeneratingSet
|
||||
|
||||
import Adam.Levels.LinearAlgebra.M01_LinearMap
|
||||
import Adam.Levels.LinearAlgebra.M02_LinearIndep
|
||||
import Adam.Levels.LinearAlgebra.M04_Basis
|
||||
|
||||
import Adam.Levels.LinearAlgebra.N01_Span
|
||||
import Adam.Levels.LinearAlgebra.N02_Span
|
||||
import Adam.Levels.LinearAlgebra.N03_Idempotent
|
||||
import Adam.Levels.LinearAlgebra.N04_Idempotent
|
||||
import Adam.Levels.LinearAlgebra.N05_Sum
|
||||
import Adam.Levels.LinearAlgebra.N06_Sum
|
||||
import Adam.Levels.LinearAlgebra.N07_Prod
|
||||
import Adam.Levels.LinearAlgebra.N08_Prod
|
||||
import Adam.Levels.LinearAlgebra.N09_Prod
|
||||
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Title "Vektorraum"
|
||||
|
||||
Introduction "Hier lernst du die Grundlagen zur linearen Algebra.
|
||||
|
||||
Vektorräume sind in Lean etwas algemeiner definiert als dies normalerweise in
|
||||
einer Einführungsvorlesung antrifft: Man definiert ein \"Modul\" (Plural: Moduln)
|
||||
über einem Ring. Ein Modul über einem *Körper* wird dann auch \"Vektorraum\" genannt.
|
||||
"
|
||||
|
||||
Game "Adam"
|
||||
World "Basis"
|
||||
Title "Lineare Abbildungen"
|
||||
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Title "Mehr Vektorräume"
|
||||
@@ -0,0 +1,106 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
import Mathlib.Algebra.Module.Basic -- definiert `module`
|
||||
import Mathlib.Tactic.LibrarySearch
|
||||
import Adam.StructInstWithHoles
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Level 1
|
||||
|
||||
Title "Module"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Konkret heisst das:
|
||||
|
||||
Sei `R` ein Ring. Ein `R`-Modul ist eine kommutative Gruppe `(V, +)` zusammen mit
|
||||
einer Abbildung `• : R × V → V` (Skalarmultiplitation genannt), die folgende
|
||||
Eigenschaften beliebige `(r s : R)` und `(v w : V)`erfüllt:
|
||||
- `r • (v + w) = r • v + r • w`
|
||||
- `(r + s) • v = r • v + s • v`
|
||||
- `(r * s) • v = r • s • v`
|
||||
- `1 • r = r`
|
||||
- `0 • v = 0`
|
||||
- `r • 0 = 0`
|
||||
|
||||
"
|
||||
|
||||
-- Bemerkungen:
|
||||
-- 1) Über einem `[field R]` sind die letzten beiden Eigenschaften überflüssig, diese kann
|
||||
-- man beweisen, wenn man Cancellation (`a₁ + x = a₂ + x → a₁ = a₂`) hat. In einem generellen
|
||||
-- Ring, muss das aber nicht gegeben sein (siehe Nullteiler).
|
||||
-- 2) Die nötigen Annahmen um ein Modul in Lean zu erhalten sind tatsächlich noch etwas lockerer,
|
||||
-- so muss `R` nicht ganz ein Ring sein (nur `[Semiring R]`) und
|
||||
-- `V` muss nicht ganz eine kommutative Gruppe sein (nur `[add_comm_monoid V]`).
|
||||
-- Einen abstrakten Vektorraum definiert man wie folgt:
|
||||
-- `variables {R V : Type*} [field R] [add_comm_monoid V] [module R V]`
|
||||
|
||||
-- Wenn man hingegen konkret zeigen will, dass ein existierendes Objekt ein Vektorraum ist,
|
||||
-- kann man eine einsprechende Instanz wie folgt definieren:
|
||||
|
||||
-- ```
|
||||
-- instance Q_module : Module ℚ ℝ :=
|
||||
-- { smul := λa r, ↑a * r
|
||||
-- smul_zero := _
|
||||
-- zero_smul := _
|
||||
-- one_smul := _
|
||||
-- smul_add := _
|
||||
-- add_smul := _
|
||||
-- mul_smul := _ }
|
||||
-- ```
|
||||
-- Man muss also angeben, welche Skalarmultiplikation man gerne hätte
|
||||
-- (`smul`. In unserem Fall sagen wir einfach, diese soll Multiplikation in `ℝ` sein.)
|
||||
-- und dazu jegliche Beweise, dass die Skalarmultiplikation sich mit der Ringstruktur verträgt.
|
||||
-- Im nachfolgenden beweisen wir die Eigenschaften einzeln.
|
||||
|
||||
Statement
|
||||
"Zeige, dass $\\mathbb{R}$ ein $\\mathbb{Q}$-Modul ist."
|
||||
: Module ℚ ℝ := by
|
||||
Hint "**Robo**: Als erstes willst du die Stuktur `Modul` aufteilen in einzelne Beweise.
|
||||
Der Syntax dafür ist:
|
||||
|
||||
```
|
||||
refine \{ ?..! }
|
||||
```
|
||||
"
|
||||
refine { ?..! }
|
||||
· Hint "**Robo**: Hier musst du die Skalarmultiplikation angeben.
|
||||
Benutze dafür `exact fun (a : ℚ) (r : ℝ) => ↑a * r`."
|
||||
exact fun (a : ℚ) (r : ℝ) => ↑a * r
|
||||
· Hint "**Robo**: Jetzt musst du alle eigenschaften eines $\\mathbb\{Q}$-Moduls zeigen,
|
||||
das sind also 6 einzelne Goals."
|
||||
intro b
|
||||
Hint "**Robo**: Mit `change (1 : ℚ) * {b} = {b}` kannst du das Goal umschreiben, damit
|
||||
dann andere Taktiken besser damit arbeiten können."
|
||||
change (1 : ℚ) * b = b
|
||||
Hint "**Robo**: Den Teil kannst du mit `simp` beweisen."
|
||||
simp
|
||||
· intro x y b
|
||||
Hint "**Robo**: Benutze `change` um `•` durch `*` zu ersetzen."
|
||||
Hint (hidden := true) "**Robo**: Explizit `change ({x} * {y} : ℚ) * {b} = {x} * ({y} * {b})`"
|
||||
change (x * y : ℚ) * b = x * (y * b)
|
||||
Hint "**Robo**: Mit `simp` und `ring` kannst du den Rest beweisen."
|
||||
simp
|
||||
ring
|
||||
· intro a
|
||||
simp
|
||||
· intro a x y
|
||||
Hint (hidden := true) "**Robo**: Explizit `change {a} * ({x} + {y}) = {a} * {x} + {a} * {y}`"
|
||||
change a * (x + y) = a * x + a * y
|
||||
ring
|
||||
· intro r s x
|
||||
Hint (hidden := true) "**Robo**: Explizit
|
||||
`change ({r} + {s} : ℚ) * {x} = {r} * {x} + {s} * {x}`"
|
||||
change (r + s : ℚ) * x = r * x + s * x
|
||||
simp
|
||||
ring
|
||||
· intro a
|
||||
Hint (hidden := true) "**Robo**: Explizit `change (0 : ℚ) * {a} = 0`"
|
||||
change (0 : ℚ) * a = 0
|
||||
simp
|
||||
|
||||
NewTactic refine exact change
|
||||
+8
-24
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
import Mathlib.Algebra.Module.Pi -- definiert `Module ℚ (fin 2 → ℚ)`
|
||||
@@ -7,7 +7,7 @@ import Mathlib.Tactic.FinCases
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Level 2
|
||||
|
||||
@@ -15,30 +15,14 @@ Title "Konkrete Vektorräume"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Häufig in der linearen Algebra hat man ganz einfach Vektoren über `ℚ` oder `ℝ`
|
||||
und möchte diese explizit definieren.
|
||||
|
||||
Reele Vektorräume definiert man in Lean am besten als Funktion von einem Indexset.
|
||||
|
||||
So ist `Fin 2` eine Menge, die nur `0` und `1` enthält
|
||||
und `ℚ²` wird als `Fin 2 → ℚ` definiert. Hier machen wir uns eine
|
||||
lokale notation dafür:
|
||||
Den $\\mathbb{Q}$-Vektorraum $\\mathbb{Q}^3$ definiert man am besten mit
|
||||
der lokalen Notation
|
||||
|
||||
```
|
||||
notation `ℚ²` := Fin 2 → ℚ
|
||||
local notation `ℚ³` := Fin 3 → ℚ
|
||||
```
|
||||
|
||||
Das mag auf den ersten Blick etwas unintuitiv erscheinen, hat aber den Vorteil,
|
||||
dass man die ganze
|
||||
Infrastruktur für Funktionen einfach direkt für Vektoren und
|
||||
Matrizen mitgebrauchen kann.
|
||||
|
||||
Wir können uns auch noch ein paar andere standardmässige `ℚ`-Vektorräume definieren.
|
||||
|
||||
```
|
||||
notation \"ℚ³\" => Fin 3 → ℚ
|
||||
notation \"ℚ^(\" n \")\" => (Fin n) → ℚ
|
||||
```
|
||||
Dabei ist `Fin 3` die Indexmenge $\\{0, 1, 2\\}$.
|
||||
|
||||
Die schreibweise für einen Vektor ist `![ _, _ ]`. Zu beachten ist,
|
||||
dass man bei Zahlen explizit einen Typ angeben muss, sonst denkt sich
|
||||
@@ -61,8 +45,8 @@ Dann eine Vektorgleichung komponentenweise aufteilt.
|
||||
Für jede Komponente kann man dann mit `simp` und `ring` weiterkommen.
|
||||
"
|
||||
|
||||
notation "ℚ³" => Fin 3 → ℚ
|
||||
notation "ℚ^(" n ")" => (Fin n) → ℚ
|
||||
local notation "ℚ³" => Fin 3 → ℚ
|
||||
local notation "ℚ^(" n ")" => (Fin n) → ℚ
|
||||
|
||||
Statement
|
||||
""
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
import Mathlib.Algebra.Module.Pi -- definiert `Module ℚ (fin 2 → ℚ)`
|
||||
import Mathlib.Data.Fin.VecNotation
|
||||
import Mathlib.Tactic.FinCases
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Level 3
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Level 4
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Level 5
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
@@ -8,7 +8,7 @@ import Mathlib.Tactic.FinCases
|
||||
import Mathlib.Algebra.BigOperators.Finsupp -- default?
|
||||
import Mathlib.LinearAlgebra.Span
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Level 6
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
@@ -10,7 +10,7 @@ import Mathlib.LinearAlgebra.Span
|
||||
import Mathlib.Tactic.LibrarySearch
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Level 7
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
@@ -8,7 +8,7 @@ import Mathlib.Tactic.FinCases
|
||||
import Mathlib.Algebra.BigOperators.Finsupp -- default?
|
||||
import Mathlib.LinearAlgebra.Span
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module"
|
||||
Level 8
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
import Mathlib.Algebra.Module.LinearMap -- definiert `→ₗ`
|
||||
import Mathlib.Tactic.FinCases
|
||||
import Mathlib.Data.Fin.VecNotation
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Basis"
|
||||
Level 1
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
import Mathlib.Algebra.Module.LinearMap -- definiert `→ₗ`
|
||||
import Mathlib.Tactic.FinCases
|
||||
import Mathlib.Data.Fin.VecNotation
|
||||
-- import Mathlib.LinearAlgebra.Finsupp
|
||||
import Mathlib.Algebra.BigOperators.Basic -- default
|
||||
-- import Mathlib.LinearAlgebra.LinearIndependent
|
||||
import Mathlib
|
||||
|
||||
Game "Adam"
|
||||
World "Basis"
|
||||
Level 2
|
||||
|
||||
Title "Lineare Unabhängigkeit"
|
||||
|
||||
namespace Ex_LinIndep
|
||||
|
||||
scoped notation "ℝ²" => Fin 2 → ℝ
|
||||
|
||||
Introduction
|
||||
"
|
||||
"
|
||||
|
||||
Statement
|
||||
"Zeige, dass `![1, 0], ![1, 1]` linear unabhängig über `ℝ` sind."
|
||||
: LinearIndependent ℝ ![(![1, 0] : ℝ²), ![1, 1]] := by
|
||||
Hint "`rw [Fintype.linearIndependent_iff]`"
|
||||
rw [Fintype.linearIndependent_iff]
|
||||
Hint "`intros c h`"
|
||||
intros c h
|
||||
Hint "BUG: `simp at h` does not work :("
|
||||
simp at h -- doesn't work
|
||||
sorry
|
||||
|
||||
-- rw [Fintype.linearIndependent_iff]
|
||||
-- intros c h
|
||||
-- simp at h
|
||||
-- intros i
|
||||
-- fin_cases i
|
||||
-- swap
|
||||
-- { exact h.2 }
|
||||
-- { have h' := h.1
|
||||
-- rw [h.2, add_zero] at h'
|
||||
-- exact h'}
|
||||
|
||||
end Ex_LinIndep
|
||||
@@ -0,0 +1,32 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib
|
||||
|
||||
Game "Adam"
|
||||
World "Basis"
|
||||
Level 4
|
||||
|
||||
Title "Basis"
|
||||
|
||||
namespace Ex_Basis
|
||||
|
||||
scoped notation "ℝ²" => Fin 2 → ℝ
|
||||
|
||||
open Submodule
|
||||
|
||||
Introduction
|
||||
"
|
||||
|
||||
"
|
||||
|
||||
lemma exercise1 : LinearIndependent ℝ ![(![1, 0] : ℝ²), ![1, 1]] := sorry
|
||||
|
||||
lemma exercise2 : ⊤ ≤ span ℝ (Set.range ![(![1, 0] : Fin 2 → ℝ), ![1, 1]]) := sorry
|
||||
|
||||
Statement : Basis (Fin 2) ℝ ℝ² := by
|
||||
apply Basis.mk
|
||||
apply exercise1
|
||||
apply exercise2
|
||||
|
||||
end Ex_Basis
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
@@ -8,7 +8,7 @@ import Mathlib.Tactic.FinCases
|
||||
import Mathlib.Algebra.BigOperators.Finsupp -- default?
|
||||
import Mathlib.LinearAlgebra.Span
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 1
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic -- definiert `ℝ`
|
||||
@@ -11,7 +11,7 @@ import Mathlib
|
||||
|
||||
open Submodule
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 2
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic
|
||||
import Mathlib.LinearAlgebra.Basic
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 3
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic
|
||||
import Mathlib.LinearAlgebra.Basic
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 4
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.LinearAlgebra.Span
|
||||
|
||||
open Submodule
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 5
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.LinearAlgebra.Span
|
||||
|
||||
open Submodule
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 6
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic
|
||||
import Mathlib.LinearAlgebra.Span
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 7
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic
|
||||
@@ -6,7 +6,7 @@ import Mathlib.LinearAlgebra.Span
|
||||
|
||||
universe u
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 8
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Algebra.Module.Submodule.Lattice
|
||||
import Mathlib.Data.Real.Basic
|
||||
import Mathlib.LinearAlgebra.Span
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Module2"
|
||||
Level 9
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
import Adam.Levels.Numbers.L01_PNat
|
||||
import Adam.Levels.Numbers.L02_PNat
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Numbers"
|
||||
Level 1
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Numbers"
|
||||
Level 2
|
||||
|
||||
+10
-10
@@ -1,14 +1,14 @@
|
||||
import TestGame.Levels.Predicate.L01_Ring
|
||||
import TestGame.Levels.Predicate.L02_Rewrite
|
||||
import TestGame.Levels.Predicate.L03_Rewrite
|
||||
import TestGame.Levels.Predicate.L04_Ring
|
||||
import TestGame.Levels.Predicate.L05_Rfl
|
||||
import TestGame.Levels.Predicate.L06_Exists
|
||||
import TestGame.Levels.Predicate.L07_Exists
|
||||
import TestGame.Levels.Predicate.L08_Forall
|
||||
import TestGame.Levels.Predicate.L09_PushNeg
|
||||
import Adam.Levels.Predicate.L01_Ring
|
||||
import Adam.Levels.Predicate.L02_Rewrite
|
||||
import Adam.Levels.Predicate.L03_Rewrite
|
||||
import Adam.Levels.Predicate.L04_Ring
|
||||
import Adam.Levels.Predicate.L05_Rfl
|
||||
import Adam.Levels.Predicate.L06_Exists
|
||||
import Adam.Levels.Predicate.L07_Exists
|
||||
import Adam.Levels.Predicate.L08_Forall
|
||||
import Adam.Levels.Predicate.L09_PushNeg
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Title "Prädikate"
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
--set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 1
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 2
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 3
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 4
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 5
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
@@ -8,7 +8,7 @@ import Mathlib.Algebra.Parity
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 6
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
@@ -8,7 +8,7 @@ import Mathlib.Algebra.Parity
|
||||
|
||||
set_option tactic.hygienic false
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 7
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
@@ -7,7 +7,7 @@ import Mathlib.Tactic.Ring
|
||||
import Mathlib.Algebra.Parity
|
||||
import Mathlib
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 8
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.PushNeg
|
||||
import Mathlib
|
||||
|
||||
import Mathlib.Algebra.Parity
|
||||
|
||||
import TestGame.ToBePorted
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Predicate"
|
||||
Level 9
|
||||
|
||||
@@ -106,4 +106,4 @@ ist deine!
|
||||
"
|
||||
|
||||
NewTactic push_neg
|
||||
NewLemma even_iff_not_odd odd_iff_not_even not_exists not_forall
|
||||
NewLemma Nat.even_iff_not_odd Nat.odd_iff_not_even not_exists not_forall
|
||||
@@ -0,0 +1,11 @@
|
||||
import Adam.Levels.Prime.L01_Dvd
|
||||
-- import Adam.Levels.Prime.L04_Prime
|
||||
-- import Adam.Levels.Prime.L05_Prime
|
||||
-- import Adam.Levels.Prime.L06_ExistsUnique
|
||||
|
||||
Game "Adam"
|
||||
World "Prime"
|
||||
Title "Teilbarkeit"
|
||||
|
||||
Introduction "Ihr schlendert durch die Befestigung ohne direktes Ziel. Und sprecht mit
|
||||
verschiedenen Einwohnern."
|
||||
@@ -0,0 +1,49 @@
|
||||
import Adam.Metadata
|
||||
|
||||
import Mathlib.Tactic.Ring
|
||||
import Mathlib
|
||||
|
||||
Game "Adam"
|
||||
World "Prime"
|
||||
Level 1
|
||||
|
||||
Title "Teilbarkeit"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Ihr begenet einer Frau, die mit Vorschlaghammer und Schaufel anscheinend an einer Erweiterung
|
||||
ihres Hauses baut. Im gespräch erzählt sie euch wie die Dornenwände gezüchtet wurden vor ihrer
|
||||
Zeit, und über's Wetter und so.
|
||||
|
||||
**Handwerkerin**: (*langer Monolog*) …, und dann gestern habe ich zwei Herren überhört,
|
||||
wie sie an folgender Aufgabe gesessen sind, könnt ihr mir das erklären?
|
||||
"
|
||||
|
||||
-- Die Aussage \"$m$ teilt $n$.\" wird in Lean als `m | n` (`\\|`) geschrieben.
|
||||
|
||||
-- **Wichtig:** `∣` (Teilbarkeit) ist ein spezielles Unicode Symbol, das nicht dem
|
||||
-- senkrechten Strich auf der Tastatur (`|`) entspricht. Man erhält es mit `\\|`.
|
||||
|
||||
-- `m ∣ n` bedeutet `∃ c, n = m * c`, das heisst, man kann damit genau gleich umgehen
|
||||
-- wie mit einem `∃`-Quantifier.
|
||||
|
||||
Statement dvd_add (n m k : ℕ) (h : m ∣ n) (g : m ∣ k) : m ∣ n + k := by
|
||||
Hint "**Robo**: `n ∣ m` bedeutet \"$n$ teilt $m$\", der senkrechte Strich ist allerdings
|
||||
ein spezieller, den man mit `\\|` schreibt.
|
||||
Definiert ist dieses Symbol als `∃ c, n = m * c`.
|
||||
|
||||
**Du**: Dann kann ich direkt `rcases` und `use` verwenden, wie wenns ein `∃` wäre?
|
||||
|
||||
**Robo**: Genau!"
|
||||
Hint (hidden := true) "**Robo**: Fang doch damit an, mit `rcases _ with ⟨x ,hx⟩`
|
||||
alle Hyptothesen aufzuteilen."
|
||||
rcases h with ⟨x, h⟩
|
||||
rcases g with ⟨y, g⟩
|
||||
Hint (hidden := true) "**Robo**: Jetzt musst du mit `use _` eine Zahl angeben so dass
|
||||
`{n} + {k} = {m} * _` gilt."
|
||||
use x + y
|
||||
Hint (hidden := true) "**Du**: Mit ein bisschen umschreiben kann man sicer `ring` verwenden."
|
||||
rw [h, g]
|
||||
ring
|
||||
|
||||
DisabledLemma dvd_add
|
||||
@@ -0,0 +1,51 @@
|
||||
import Adam.Metadata
|
||||
import Mathlib.Data.Nat.Prime
|
||||
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
-- import Data.Nat.Prime
|
||||
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "Adam"
|
||||
World "Prime"
|
||||
Level 2
|
||||
|
||||
Title "Primzahlen"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Als nächstes Begnet ihr einem Lehrer, der nachdenkend an der Sonne sitzt.
|
||||
|
||||
**Lehrer**: Sagt mal, mich hat heute einer meiner Schüler was gefragt,
|
||||
und ich glaube einfach, der ist in so jungen Jahren bereits schlauer als ich.
|
||||
|
||||
Hier etwas Kontext:
|
||||
"
|
||||
|
||||
Statement (p : ℕ) (h : Nat.Prime p) : ∀ (x : ℕ), (x ∣ p) → x = 1 ∨ x = p := by
|
||||
Hint "**Du**: Die einzigen Teiler einer Primzahl sind `1` und `p`, ist das
|
||||
nicht eine der möglichen Definitionen über `ℕ`?
|
||||
|
||||
**Robo**: Doch, oder zumindest fast.
|
||||
Du kannst du mit `rw` und `Nat.prime_def_lt''` eine der Definitionen für `Nat.Prime` einsetzen
|
||||
|
||||
**Du** Könnte ich nicht einfach `unfold Nat.Prime` sagen um mir das anzuschauen.
|
||||
|
||||
**Robo**: Bloss nicht. Das ist so eine Definition, in die du besser nicht hineinschaust!
|
||||
`Nat.Prime p` ist als `Irreducible p` definiert, was wiederum anhand von Einheiten
|
||||
definiert ist… Da verlieren wir uns in Definition die wir im Moment gar nicht brauchen."
|
||||
rw [Nat.prime_def_lt''] at h
|
||||
rcases h with ⟨_, h₂⟩
|
||||
assumption
|
||||
|
||||
NewLemma Nat.prime_def_lt''
|
||||
|
||||
Conclusion "**Du**: Ich sehe, meine \"Definition\" hätte auch `1` als Primzahl deklariert. Gut,
|
||||
dass wir das überprüft haben.
|
||||
|
||||
**Lehrer**: Und jetzt kommen wir zu dem, was mir Kopfschmerzen bereitet."
|
||||
@@ -0,0 +1,41 @@
|
||||
import Adam.Metadata
|
||||
import Mathlib.Data.Nat.Prime
|
||||
|
||||
import Std.Tactic.RCases
|
||||
import Mathlib.Tactic.LeftRight
|
||||
import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "Adam"
|
||||
World "Prime"
|
||||
Level 3
|
||||
|
||||
Title "Primzahlen"
|
||||
|
||||
Introduction
|
||||
"
|
||||
Der Lehrer erklärt sein Problem.
|
||||
|
||||
**Lehrer**: Und dann fragte der Schüler, wie man denn folgendes herleitet.
|
||||
Und dabei ist das weit über seiner Altersstufe!
|
||||
"
|
||||
|
||||
Statement
|
||||
(p : ℕ) (h₂ : 2 ≤ p): Nat.Prime p ↔ ∀ (a b : ℕ), p ∣ a * b → p ∣ a ∨ p ∣ b := by
|
||||
Hint "**Du**: Naja, mal schauen wie weit man mit `intro` und `constructor` kommt…"
|
||||
constructor
|
||||
intro h a b
|
||||
Hint "**Robo**: Stop! Hier helfe ich dir etwas"
|
||||
apply (Nat.Prime.dvd_mul h).mp
|
||||
intro h
|
||||
rw [Nat.prime_iff]
|
||||
unfold Prime
|
||||
rw [Nat.isUnit_iff, ←and_assoc]
|
||||
constructor
|
||||
constructor
|
||||
linarith
|
||||
linarith
|
||||
assumption
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Data.Nat.Prime
|
||||
|
||||
import Std.Tactic.RCases
|
||||
@@ -7,9 +7,9 @@ import Mathlib.Tactic.Contrapose
|
||||
import Mathlib.Tactic.Use
|
||||
import Mathlib.Tactic.Ring
|
||||
|
||||
import TestGame.ToBePorted
|
||||
import Adam.ToBePorted
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Prime"
|
||||
Level 4
|
||||
|
||||
+15
-15
@@ -1,19 +1,19 @@
|
||||
import TestGame.Levels.Proposition.L00_Tauto
|
||||
import TestGame.Levels.Proposition.L01_Rfl
|
||||
import TestGame.Levels.Proposition.L02_Assumption
|
||||
import TestGame.Levels.Proposition.L03_Assumption
|
||||
import TestGame.Levels.Proposition.L04_True
|
||||
import TestGame.Levels.Proposition.L05_Not
|
||||
import TestGame.Levels.Proposition.L06_False
|
||||
import TestGame.Levels.Proposition.L07_ContraNotEq
|
||||
import TestGame.Levels.Proposition.L08_Contra
|
||||
import TestGame.Levels.Proposition.L09_And
|
||||
import TestGame.Levels.Proposition.L10_And
|
||||
import TestGame.Levels.Proposition.L11_Or
|
||||
import TestGame.Levels.Proposition.L12_Or
|
||||
import TestGame.Levels.Proposition.L13_Summary
|
||||
import Adam.Levels.Proposition.L00_Tauto
|
||||
import Adam.Levels.Proposition.L01_Rfl
|
||||
import Adam.Levels.Proposition.L02_Assumption
|
||||
import Adam.Levels.Proposition.L03_Assumption
|
||||
import Adam.Levels.Proposition.L04_True
|
||||
import Adam.Levels.Proposition.L05_Not
|
||||
import Adam.Levels.Proposition.L06_False
|
||||
import Adam.Levels.Proposition.L07_ContraNotEq
|
||||
import Adam.Levels.Proposition.L08_Contra
|
||||
import Adam.Levels.Proposition.L09_And
|
||||
import Adam.Levels.Proposition.L10_And
|
||||
import Adam.Levels.Proposition.L11_Or
|
||||
import Adam.Levels.Proposition.L12_Or
|
||||
import Adam.Levels.Proposition.L13_Summary
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Proposition"
|
||||
Title "Aussagenlogik 1"
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import TestGame.Metadata
|
||||
import Adam.Metadata
|
||||
import Mathlib.Tactic.Tauto
|
||||
|
||||
Game "TestGame"
|
||||
Game "Adam"
|
||||
World "Proposition"
|
||||
Level 1
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user