Skip to content

Commit

Permalink
le_two
Browse files Browse the repository at this point in the history
  • Loading branch information
archiebrowne committed Nov 11, 2023
1 parent f04d47d commit 3c95c83
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
2 changes: 2 additions & 0 deletions Game/Levels/AdvMultiplication/all_levels.lean
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,5 @@ lemma self_eq_mul_left (a b : ℕ) (h : b = a * b) (hb : b ≠ 0) : a = 1 := by
lemma self_eq_mul_right (a b : ℕ) (h : b = b * a) (hb : b ≠ 0) : a = 1 := by
rw [mul_comm] at h
exact self_eq_mul_left _ _ h hb


45 changes: 22 additions & 23 deletions Game/Levels/Prime/Level_1.lean
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ Introduction
LemmaDoc MyNat.prime_two as "prime_two" in "Prime" "
`prime_two` is a proof that 2 is prime.
"

lemma succ_ne_zero (a : ℕ) : succ a ≠ 0 := by
have := zero_ne_succ a
by_contra h
have h' : 0 = succ a := by exact (Eq.symm h)
contradiction

example (a : ℕ) (h : a ∣ 2) : a ≤ 2 := by
lemma dvd_two_leq_two (a : ℕ) (h : a ∣ 2) : a ≤ 2 := by
match h with
|⟨k, e⟩=>
rw [e]
Expand All @@ -45,31 +46,29 @@ example (a : ℕ) (h : a ∣ 2) : a ≤ 2 := by
rw [two_eq_succ_one]
exact succ_ne_zero 1







lemma le_two (a : ℕ) (h : a ≤ 2) : a = 0 ∨ a = 1 ∨ a = 2 := by
apply Or.elim (Classical.em (a = 2))
· intro
right
right
assumption
· intro
have h' : a ≤ 1 := by {
sorry
}
have := le_one a h'
apply Or.elim this
· intro
left
assumption
· intro
right
left
assumption


sorry

#check Nat.le_of_dvd
example (a n : ℕ) (h : 0 < n) : a ∣ n → a ≤ n := by
intro
|⟨k, e⟩ =>
have hk : 1 ≤ k := by {
sorry
}
have hak : a * k ≠ 0 := by {
rw [← e]
sorry
}
rw [e]
have := le_mul_right a k hak
assumption

Statement prime_two :
Prime 2 := by
unfold Prime
Expand All @@ -78,7 +77,7 @@ Statement prime_two :
rw [add_zero]
rfl
intros a ha
have : a ≤ 2 := by sorry
have : a ≤ 2 := by exact dvd_two_leq_two a ha
have h : a = 0 ∨ a = 1 ∨ a = 2 := by sorry
rcases h with ⟨h1, h2⟩
· exfalso
Expand Down

0 comments on commit 3c95c83

Please sign in to comment.