Skip to content

Commit

Permalink
adding conclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
archiebrowne committed Dec 7, 2023
1 parent e73913e commit acdfe42
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 18 deletions.
12 changes: 9 additions & 3 deletions Game/Levels/Division/Level_1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace MyNat

Introduction
"
In this section, we will prove that 1 ∣ n for all n ∈ ℕ. `a | b` is
shorthand for `there existsw a number c such that `b = c * a``, so
you should be looking to use the `use' tactic in these kinds of proof.
In this level, we will prove that 1 ∣ n for all n ∈ ℕ. `a | b` is
shorthand for `there exists a number c such that `b = c * a`, because of
`exists`, the use statment will be useful here.
"

Expand All @@ -28,3 +28,9 @@ Statement one_dvd
use n
rw [one_mul]
rfl


Conclusion
"
Congratulations! You have proven your first theorem about division.
"
13 changes: 10 additions & 3 deletions Game/Levels/Division/Level_2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ namespace MyNat

Introduction
"
In this section, we will prove that n ∣ n for any natural number n. In other words, 'divides' is
a reflexive relation on the natural numebrs.
In this level, we will prove that n ∣ n for any natural number n.
In other words, 'divides' is a reflexive relation on the natural
numebrs.
"

LemmaDoc MyNat.dvd_refl as "dvd_refl" in "∣" "
Expand All @@ -20,7 +21,13 @@ LemmaDoc MyNat.dvd_refl as "dvd_refl" in "∣" "

Statement dvd_refl
(n : ℕ) : n ∣ n := by
Hint "This is true because `n = n * 1`"
Hint "This is true because `n = n * 1`."
use 1
rw [mul_one]
rfl

Conclusion
"
Well Done, this was the first step in proving that `∣` is a partial order. We
will prove the other properties in the next few levels.
"
6 changes: 3 additions & 3 deletions Game/Levels/Division/Level_3.lean
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace MyNat

Introduction
"
In this level, we will prove that `divides` is antisymmetric. i.e the
only way that we can have `a | b` and `b | a ` is if a = b.
"

LemmaDoc MyNat.dvd_antisymm as "dvd_antisymm" in "∣" "
Expand All @@ -20,10 +21,9 @@ LemmaDoc MyNat.dvd_antisymm as "dvd_antisymm" in "∣" "

Statement dvd_antisymm
(a b : ℕ) (h1 : a ∣ b) (h2 : b ∣ a): a = b := by
Hint "You will need to expand what `h1` and `h2` actually mean. You may find `rcases` helpful"
Hint "You will need to expand what `h1` and `h2` actually mean. You may find `rcases` helpful."
rcases h1 with ⟨c, hc⟩
rcases h2 with ⟨d, hd⟩
-- need to cancel b's:
rw [hd] at hc
by_cases hb : b = 0
· rw [hb] at hd
Expand Down
16 changes: 10 additions & 6 deletions Game/Levels/Division/Level_4.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ namespace MyNat

Introduction
"
In this section, we will prove that ∣ is transitive. This will complete the proof that ∣ is a
partial order on ℕ.
In this level, we will prove that ∣ is transitive. That is, if
`a ∣ b` and `b ∣ c`, then `a ∣c ` This will complete the proof
that ∣ is a partial order on ℕ.
"

LemmaDoc MyNat.dvd_trans as "dvd_trans" in "∣" "
Expand All @@ -21,15 +22,18 @@ Statement dvd_trans
Hint "Here, like the last level, you may find `rcases` helpful."
rcases hbc with ⟨m, hm⟩
rcases hab with ⟨n, rfl⟩
-- b = na, c = mb
-- c = mna
Hint "Now, since we are looking show `a ∣ c`, which is an existience hypothesis, a `use` tactic
would be a good choice."
Hint "Now, since we are looking show `a ∣ c`, which is an existience hypothesis, the `use`
tactic would be a good choice."
use (m * n)
Hint "Now the goal is clear, its just a case of finding the correct rewrites."
rw [hm]
rw [mul_assoc]
rw [mul_comm n m]
rfl

Conclusion
"
Great work. We have succedfully proven that `∣` is a partial order on ℕ.
"

LemmaTab "∣"
2 changes: 1 addition & 1 deletion Game/Levels/Division/Level_5.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace MyNat

Introduction
"
In this section, we will prove that if d ∣ a, then d ∣ ab.
In this level, we will prove that if d ∣ a, then d ∣ ab.
"

LemmaDoc MyNat.dvd_mul_right as "dvd_mul_right" in "∣" "
Expand Down
2 changes: 1 addition & 1 deletion Game/Levels/Division/Level_6.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Statement dvd_add_right
cases d with d
· use 0
rw [zero_mul] at *
rw[zero_mul] at he
rw [zero_mul] at he
rw [zero_add] at he
exact he
· have : 1 ≤ succ d := by sorry
Expand Down
7 changes: 6 additions & 1 deletion Game/Levels/Hard/level_1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace MyNat

Introduction
"
We beign with a problem which has been proven, Fermat's Last Theorem.
We beign with a problem which has been proven, but not in Lean, Fermat's Last Theorem.
"

LemmaDoc MyNat.FLT as "FLT" in "Hard" "
Expand All @@ -22,5 +22,10 @@ Statement FLT
sorry


Conclusion
"
Well that was impressive, you shoud wtite a paper about it.
"


end MyNat
1 change: 1 addition & 0 deletions Game/Levels/Hard/level_3.lean
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ LemmaDoc MyNat.Golbach as "Golbach" in "Hard" "

Statement Golbach : ∀ (n : ℕ), n ≥ 2 → ∃ (a b : ℕ), (Prime a) ∧ (Prime b) ∧ (n = a + b) := by
sorry

5 changes: 5 additions & 0 deletions Game/Levels/Prime/Level_1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ LemmaDoc MyNat.prime_two as "prime_two" in "Prime" "

Statement prime_two :
Prime 2 := by
Hint "You may want to know what `Prime 2` actually means. For this, you can use
`unfold Prime`."
unfold Prime
Hint "Use `constructor` to split up the `∧` statment into two goals."
constructor
use 0
rw [add_zero]
rfl
Hint "You have done the easy half, now for the tough part."
intros a ha
have : a ≤ 2 := by exact dvd_two_leq_two a ha
have h : a = 0 ∨ a = 1 ∨ a = 2 := by exact le_two a this
Expand All @@ -39,4 +43,5 @@ Statement prime_two :
cases hb
· exact h


end MyNat

0 comments on commit acdfe42

Please sign in to comment.