url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
have H2 : norm (x % y) * norm y ≤ norm y / 2 * norm y
x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ (x % y).norm < y.norm
case H2 x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ (x % y).norm * y.norm ≤ y.norm / 2 * y.norm x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } H2 : (x % y).norm * y.norm ≤ y.norm / 2 * y.norm ⊢ (x % y).norm < y.norm
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
rwa [norm_pos]
x y : GaussInt hy : y ≠ 0 ⊢ 0 < y.norm
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
ext <;> simp [Int.mod'_eq, mod_def, div_def, norm] <;> ring
case H1 x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm ⊢ x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm }
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
calc norm (x % y) * norm y = norm (x % y * conj y) := by simp only [norm_mul, norm_conj] _ = |Int.mod' (x.re * y.re + x.im * y.im) (norm y)| ^ 2 + |Int.mod' (-(x.re * y.im) + x.im * y.re) (norm y)| ^ 2 := by simp [H1, norm, sq_abs] _ ≤ (y.norm / 2) ^ 2 + (y.norm / 2) ^ 2 := by gcongr <;> apply Int.abs_mod'_le _ _ norm_y_pos _ = norm y / 2 * (norm y / 2 * 2) := by ring _ ≤ norm y / 2 * norm y := by gcongr; apply Int.ediv_mul_le; norm_num
case H2 x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ (x % y).norm * y.norm ≤ y.norm / 2 * y.norm
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
simp only [norm_mul, norm_conj]
x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ (x % y).norm * y.norm = (x % y * y.conj).norm
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
simp [H1, norm, sq_abs]
x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ (x % y * y.conj).norm = |(x.re * y.re + x.im * y.im).mod' y.norm| ^ 2 + |(-(x.re * y.im) + x.im * y.re).mod' y.norm| ^ 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
gcongr <;> apply Int.abs_mod'_le _ _ norm_y_pos
x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ |(x.re * y.re + x.im * y.im).mod' y.norm| ^ 2 + |(-(x.re * y.im) + x.im * y.re).mod' y.norm| ^ 2 ≤ (y.norm / 2) ^ 2 + (y.norm / 2) ^ 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
ring
x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ (y.norm / 2) ^ 2 + (y.norm / 2) ^ 2 = y.norm / 2 * (y.norm / 2 * 2)
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
gcongr
x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ y.norm / 2 * (y.norm / 2 * 2) ≤ y.norm / 2 * y.norm
case h x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ y.norm / 2 * 2 ≤ y.norm
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
apply Int.ediv_mul_le
case h x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ y.norm / 2 * 2 ≤ y.norm
case h.H x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ 2 ≠ 0
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
norm_num
case h.H x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } ⊢ 2 ≠ 0
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
apply Int.ediv_lt_of_lt_mul
x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } H2 : (x % y).norm * y.norm ≤ y.norm / 2 * y.norm ⊢ y.norm / 2 < y.norm
case H x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } H2 : (x % y).norm * y.norm ≤ y.norm / 2 * y.norm ⊢ 0 < 2 case H' x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } H2 : (x % y).norm * y.norm ≤ y.norm / 2 * y.norm ⊢ y.norm < y.norm * 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
norm_num
case H x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } H2 : (x % y).norm * y.norm ≤ y.norm / 2 * y.norm ⊢ 0 < 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.norm_mod_lt
[570, 1]
[587, 19]
linarith
case H' x y : GaussInt hy : y ≠ 0 norm_y_pos : 0 < y.norm H1 : x % y * y.conj = { re := (x * y.conj).re.mod' y.norm, im := (x * y.conj).im.mod' y.norm } H2 : (x % y).norm * y.norm ≤ y.norm / 2 * y.norm ⊢ y.norm < y.norm * 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.natAbs_norm_mod_lt
[603, 1]
[607, 25]
apply Int.ofNat_lt.1
x y : GaussInt hy : y ≠ 0 ⊢ (x % y).norm.natAbs < y.norm.natAbs
x y : GaussInt hy : y ≠ 0 ⊢ ↑(x % y).norm.natAbs < ↑y.norm.natAbs
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.natAbs_norm_mod_lt
[603, 1]
[607, 25]
simp only [Int.coe_natAbs, abs_of_nonneg, norm_nonneg]
x y : GaussInt hy : y ≠ 0 ⊢ ↑(x % y).norm.natAbs < ↑y.norm.natAbs
x y : GaussInt hy : y ≠ 0 ⊢ (x % y).norm < y.norm
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.natAbs_norm_mod_lt
[603, 1]
[607, 25]
apply norm_mod_lt x hy
x y : GaussInt hy : y ≠ 0 ⊢ (x % y).norm < y.norm
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.not_norm_mul_left_lt_norm
[615, 1]
[622, 51]
apply not_lt_of_ge
x y : GaussInt hy : y ≠ 0 ⊢ ¬(x * y).norm.natAbs < x.norm.natAbs
case h x y : GaussInt hy : y ≠ 0 ⊢ (x * y).norm.natAbs ≥ x.norm.natAbs
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.not_norm_mul_left_lt_norm
[615, 1]
[622, 51]
rw [norm_mul, Int.natAbs_mul]
case h x y : GaussInt hy : y ≠ 0 ⊢ (x * y).norm.natAbs ≥ x.norm.natAbs
case h x y : GaussInt hy : y ≠ 0 ⊢ x.norm.natAbs * y.norm.natAbs ≥ x.norm.natAbs
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.not_norm_mul_left_lt_norm
[615, 1]
[622, 51]
apply le_mul_of_one_le_right (Nat.zero_le _)
case h x y : GaussInt hy : y ≠ 0 ⊢ x.norm.natAbs * y.norm.natAbs ≥ x.norm.natAbs
case h x y : GaussInt hy : y ≠ 0 ⊢ 1 ≤ y.norm.natAbs
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.not_norm_mul_left_lt_norm
[615, 1]
[622, 51]
apply Int.ofNat_le.1
case h x y : GaussInt hy : y ≠ 0 ⊢ 1 ≤ y.norm.natAbs
case h x y : GaussInt hy : y ≠ 0 ⊢ ↑1 ≤ ↑y.norm.natAbs
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.not_norm_mul_left_lt_norm
[615, 1]
[622, 51]
rw [coe_natAbs_norm]
case h x y : GaussInt hy : y ≠ 0 ⊢ ↑1 ≤ ↑y.norm.natAbs
case h x y : GaussInt hy : y ≠ 0 ⊢ ↑1 ≤ y.norm
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C06_Structures/S03_Building_the_Gaussian_Integers.lean
GaussInt.not_norm_mul_left_lt_norm
[615, 1]
[622, 51]
exact Int.add_one_le_of_lt ((norm_pos _).mpr hy)
case h x y : GaussInt hy : y ≠ 0 ⊢ ↑1 ≤ y.norm
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
fac_pos
[118, 1]
[123, 30]
induction' n with n ih
n : ℕ ⊢ 0 < fac n
case zero ⊢ 0 < fac 0 case succ n : ℕ ih : 0 < fac n ⊢ 0 < fac (n + 1)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
fac_pos
[118, 1]
[123, 30]
rw [fac]
case succ n : ℕ ih : 0 < fac n ⊢ 0 < fac (n + 1)
case succ n : ℕ ih : 0 < fac n ⊢ 0 < (n + 1) * fac n
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
fac_pos
[118, 1]
[123, 30]
exact mul_pos n.succ_pos ih
case succ n : ℕ ih : 0 < fac n ⊢ 0 < (n + 1) * fac n
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
fac_pos
[118, 1]
[123, 30]
rw [fac]
case zero ⊢ 0 < fac 0
case zero ⊢ 0 < 1
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
fac_pos
[118, 1]
[123, 30]
exact zero_lt_one
case zero ⊢ 0 < 1
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
dvd_fac
[133, 1]
[140, 22]
induction' n with n ih
i n : ℕ ipos : 0 < i ile : i ≤ n ⊢ i ∣ fac n
case zero i : ℕ ipos : 0 < i ile : i ≤ 0 ⊢ i ∣ fac 0 case succ i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 ⊢ i ∣ fac (n + 1)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
dvd_fac
[133, 1]
[140, 22]
rw [fac]
case succ i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 ⊢ i ∣ fac (n + 1)
case succ i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 ⊢ i ∣ (n + 1) * fac n
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
dvd_fac
[133, 1]
[140, 22]
rcases Nat.of_le_succ ile with h | h
case succ i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 ⊢ i ∣ (n + 1) * fac n
case succ.inl i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 h : i ≤ n ⊢ i ∣ (n + 1) * fac n case succ.inr i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 h : i = n.succ ⊢ i ∣ (n + 1) * fac n
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
dvd_fac
[133, 1]
[140, 22]
rw [h]
case succ.inr i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 h : i = n.succ ⊢ i ∣ (n + 1) * fac n
case succ.inr i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 h : i = n.succ ⊢ n.succ ∣ (n + 1) * fac n
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
dvd_fac
[133, 1]
[140, 22]
apply dvd_mul_right
case succ.inr i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 h : i = n.succ ⊢ n.succ ∣ (n + 1) * fac n
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
dvd_fac
[133, 1]
[140, 22]
exact absurd ipos (not_lt_of_ge ile)
case zero i : ℕ ipos : 0 < i ile : i ≤ 0 ⊢ i ∣ fac 0
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
dvd_fac
[133, 1]
[140, 22]
apply dvd_mul_of_dvd_right (ih h)
case succ.inl i : ℕ ipos : 0 < i n : ℕ ih : i ≤ n → i ∣ fac n ile : i ≤ n + 1 h : i ≤ n ⊢ i ∣ (n + 1) * fac n
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
rcases n with _ | n
n : ℕ ⊢ 2 ^ (n - 1) ≤ fac n
case zero ⊢ 2 ^ (0 - 1) ≤ fac 0 case succ n : ℕ ⊢ 2 ^ (n + 1 - 1) ≤ fac (n + 1)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
induction' n with n ih
case succ n : ℕ ⊢ 2 ^ (n + 1 - 1) ≤ fac (n + 1)
case succ.zero ⊢ 2 ^ (0 + 1 - 1) ≤ fac (0 + 1) case succ.succ n : ℕ ih : 2 ^ (n + 1 - 1) ≤ fac (n + 1) ⊢ 2 ^ (n + 1 + 1 - 1) ≤ fac (n + 1 + 1)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
simp at *
case succ.succ n : ℕ ih : 2 ^ (n + 1 - 1) ≤ fac (n + 1) ⊢ 2 ^ (n + 1 + 1 - 1) ≤ fac (n + 1 + 1)
case succ.succ n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 2 ^ (n + 1) ≤ fac (n + 1 + 1)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
rw [pow_succ', fac]
case succ.succ n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 2 ^ (n + 1) ≤ fac (n + 1 + 1)
case succ.succ n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 2 * 2 ^ n ≤ (n + 1 + 1) * fac (n + 1)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
apply Nat.mul_le_mul _ ih
case succ.succ n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 2 * 2 ^ n ≤ (n + 1 + 1) * fac (n + 1)
n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 2 ≤ n + 1 + 1
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
repeat' apply Nat.succ_le_succ
n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 2 ≤ n + 1 + 1
case a.a n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 0 ≤ n
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
apply zero_le
case a.a n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 0 ≤ n
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
simp [fac]
case zero ⊢ 2 ^ (0 - 1) ≤ fac 0
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
simp [fac]
case succ.zero ⊢ 2 ^ (0 + 1 - 1) ≤ fac (0 + 1)
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
pow_two_le_fac
[153, 1]
[165, 16]
apply Nat.succ_le_succ
case a n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 1 ≤ n + 1
case a.a n : ℕ ih : 2 ^ n ≤ fac (n + 1) ⊢ 0 ≤ n
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_id
[280, 1]
[285, 7]
symm
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ ∑ i ∈ range (n + 1), i = n * (n + 1) / 2
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ n * (n + 1) / 2 = ∑ i ∈ range (n + 1), i
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_id
[280, 1]
[285, 7]
apply Nat.div_eq_of_eq_mul_right (by norm_num : 0 < 2)
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ n * (n + 1) / 2 = ∑ i ∈ range (n + 1), i
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ n * (n + 1) = 2 * ∑ i ∈ range (n + 1), i
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_id
[280, 1]
[285, 7]
induction' n with n ih
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ n * (n + 1) = 2 * ∑ i ∈ range (n + 1), i
case zero α : Type u_1 s : Finset ℕ f : ℕ → ℕ n : ℕ ⊢ 0 * (0 + 1) = 2 * ∑ i ∈ range (0 + 1), i case succ α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ih : n * (n + 1) = 2 * ∑ i ∈ range (n + 1), i ⊢ (n + 1) * (n + 1 + 1) = 2 * ∑ i ∈ range (n + 1 + 1), i
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_id
[280, 1]
[285, 7]
rw [Finset.sum_range_succ, mul_add 2, ← ih]
case succ α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ih : n * (n + 1) = 2 * ∑ i ∈ range (n + 1), i ⊢ (n + 1) * (n + 1 + 1) = 2 * ∑ i ∈ range (n + 1 + 1), i
case succ α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ih : n * (n + 1) = 2 * ∑ i ∈ range (n + 1), i ⊢ (n + 1) * (n + 1 + 1) = n * (n + 1) + 2 * (n + 1)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_id
[280, 1]
[285, 7]
ring
case succ α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ih : n * (n + 1) = 2 * ∑ i ∈ range (n + 1), i ⊢ (n + 1) * (n + 1 + 1) = n * (n + 1) + 2 * (n + 1)
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_id
[280, 1]
[285, 7]
norm_num
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ 0 < 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_id
[280, 1]
[285, 7]
simp
case zero α : Type u_1 s : Finset ℕ f : ℕ → ℕ n : ℕ ⊢ 0 * (0 + 1) = 2 * ∑ i ∈ range (0 + 1), i
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_sqr
[293, 1]
[302, 7]
symm
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ ∑ i ∈ range (n + 1), i ^ 2 = n * (n + 1) * (2 * n + 1) / 6
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ n * (n + 1) * (2 * n + 1) / 6 = ∑ i ∈ range (n + 1), i ^ 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_sqr
[293, 1]
[302, 7]
apply Nat.div_eq_of_eq_mul_right (by norm_num : 0 < 6)
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ n * (n + 1) * (2 * n + 1) / 6 = ∑ i ∈ range (n + 1), i ^ 2
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ n * (n + 1) * (2 * n + 1) = 6 * ∑ i ∈ range (n + 1), i ^ 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_sqr
[293, 1]
[302, 7]
induction' n with n ih
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ n * (n + 1) * (2 * n + 1) = 6 * ∑ i ∈ range (n + 1), i ^ 2
case zero α : Type u_1 s : Finset ℕ f : ℕ → ℕ n : ℕ ⊢ 0 * (0 + 1) * (2 * 0 + 1) = 6 * ∑ i ∈ range (0 + 1), i ^ 2 case succ α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ih : n * (n + 1) * (2 * n + 1) = 6 * ∑ i ∈ range (n + 1), i ^ 2 ⊢ (n + 1) * (n + 1 + 1) * (2 * (n + 1) + 1) = 6 * ∑ i ∈ range (n + 1 + 1), i ^ 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_sqr
[293, 1]
[302, 7]
rw [Finset.sum_range_succ, mul_add 6, ← ih]
case succ α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ih : n * (n + 1) * (2 * n + 1) = 6 * ∑ i ∈ range (n + 1), i ^ 2 ⊢ (n + 1) * (n + 1 + 1) * (2 * (n + 1) + 1) = 6 * ∑ i ∈ range (n + 1 + 1), i ^ 2
case succ α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ih : n * (n + 1) * (2 * n + 1) = 6 * ∑ i ∈ range (n + 1), i ^ 2 ⊢ (n + 1) * (n + 1 + 1) * (2 * (n + 1) + 1) = n * (n + 1) * (2 * n + 1) + 6 * (n + 1) ^ 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_sqr
[293, 1]
[302, 7]
ring
case succ α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ih : n * (n + 1) * (2 * n + 1) = 6 * ∑ i ∈ range (n + 1), i ^ 2 ⊢ (n + 1) * (n + 1 + 1) * (2 * (n + 1) + 1) = n * (n + 1) * (2 * n + 1) + 6 * (n + 1) ^ 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_sqr
[293, 1]
[302, 7]
norm_num
α : Type u_1 s : Finset ℕ f : ℕ → ℕ n✝ n : ℕ ⊢ 0 < 6
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
sum_sqr
[293, 1]
[302, 7]
simp
case zero α : Type u_1 s : Finset ℕ f : ℕ → ℕ n : ℕ ⊢ 0 * (0 + 1) * (2 * 0 + 1) = 6 * ∑ i ∈ range (0 + 1), i ^ 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.zero_add
[364, 1]
[367, 15]
induction' n with n ih
n : MyNat ⊢ zero.add n = n
case zero ⊢ zero.add zero = zero case succ n : MyNat ih : zero.add n = n ⊢ zero.add n.succ = n.succ
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.zero_add
[364, 1]
[367, 15]
rw [add, ih]
case succ n : MyNat ih : zero.add n = n ⊢ zero.add n.succ = n.succ
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.zero_add
[364, 1]
[367, 15]
rfl
case zero ⊢ zero.add zero = zero
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.succ_add
[369, 1]
[373, 6]
induction' n with n ih
m n : MyNat ⊢ m.succ.add n = (m.add n).succ
case zero m : MyNat ⊢ m.succ.add zero = (m.add zero).succ case succ m n : MyNat ih : m.succ.add n = (m.add n).succ ⊢ m.succ.add n.succ = (m.add n.succ).succ
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.succ_add
[369, 1]
[373, 6]
rw [add, ih]
case succ m n : MyNat ih : m.succ.add n = (m.add n).succ ⊢ m.succ.add n.succ = (m.add n.succ).succ
case succ m n : MyNat ih : m.succ.add n = (m.add n).succ ⊢ (m.add n).succ.succ = (m.add n.succ).succ
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.succ_add
[369, 1]
[373, 6]
rfl
case succ m n : MyNat ih : m.succ.add n = (m.add n).succ ⊢ (m.add n).succ.succ = (m.add n.succ).succ
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.succ_add
[369, 1]
[373, 6]
rfl
case zero m : MyNat ⊢ m.succ.add zero = (m.add zero).succ
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.add_comm
[375, 1]
[379, 25]
induction' n with n ih
m n : MyNat ⊢ m.add n = n.add m
case zero m : MyNat ⊢ m.add zero = zero.add m case succ m n : MyNat ih : m.add n = n.add m ⊢ m.add n.succ = n.succ.add m
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.add_comm
[375, 1]
[379, 25]
rw [add, succ_add, ih]
case succ m n : MyNat ih : m.add n = n.add m ⊢ m.add n.succ = n.succ.add m
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.add_comm
[375, 1]
[379, 25]
rw [zero_add]
case zero m : MyNat ⊢ m.add zero = zero.add m
case zero m : MyNat ⊢ m.add zero = m
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.add_comm
[375, 1]
[379, 25]
rfl
case zero m : MyNat ⊢ m.add zero = m
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.add_assoc
[381, 1]
[388, 6]
induction' k with k ih
m n k : MyNat ⊢ (m.add n).add k = m.add (n.add k)
case zero m n : MyNat ⊢ (m.add n).add zero = m.add (n.add zero) case succ m n k : MyNat ih : (m.add n).add k = m.add (n.add k) ⊢ (m.add n).add k.succ = m.add (n.add k.succ)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.add_assoc
[381, 1]
[388, 6]
rw [add, ih]
case succ m n k : MyNat ih : (m.add n).add k = m.add (n.add k) ⊢ (m.add n).add k.succ = m.add (n.add k.succ)
case succ m n k : MyNat ih : (m.add n).add k = m.add (n.add k) ⊢ (m.add (n.add k)).succ = m.add (n.add k.succ)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.add_assoc
[381, 1]
[388, 6]
rfl
case succ m n k : MyNat ih : (m.add n).add k = m.add (n.add k) ⊢ (m.add (n.add k)).succ = m.add (n.add k.succ)
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.add_assoc
[381, 1]
[388, 6]
rfl
case zero m n : MyNat ⊢ (m.add n).add zero = m.add (n.add zero)
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.mul_add
[391, 1]
[397, 36]
induction' k with k ih
m n k : MyNat ⊢ m.mul (n.add k) = (m.mul n).add (m.mul k)
case zero m n : MyNat ⊢ m.mul (n.add zero) = (m.mul n).add (m.mul zero) case succ m n k : MyNat ih : m.mul (n.add k) = (m.mul n).add (m.mul k) ⊢ m.mul (n.add k.succ) = (m.mul n).add (m.mul k.succ)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.mul_add
[391, 1]
[397, 36]
rw [add, mul, mul, ih, add_assoc]
case succ m n k : MyNat ih : m.mul (n.add k) = (m.mul n).add (m.mul k) ⊢ m.mul (n.add k.succ) = (m.mul n).add (m.mul k.succ)
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.mul_add
[391, 1]
[397, 36]
rfl
case zero m n : MyNat ⊢ m.mul (n.add zero) = (m.mul n).add (m.mul zero)
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.zero_mul
[400, 1]
[407, 6]
induction' n with n ih
n : MyNat ⊢ zero.mul n = zero
case zero ⊢ zero.mul zero = zero case succ n : MyNat ih : zero.mul n = zero ⊢ zero.mul n.succ = zero
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.zero_mul
[400, 1]
[407, 6]
rw [mul, ih]
case succ n : MyNat ih : zero.mul n = zero ⊢ zero.mul n.succ = zero
case succ n : MyNat ih : zero.mul n = zero ⊢ zero.add zero = zero
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.zero_mul
[400, 1]
[407, 6]
rfl
case succ n : MyNat ih : zero.mul n = zero ⊢ zero.add zero = zero
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.zero_mul
[400, 1]
[407, 6]
rfl
case zero ⊢ zero.mul zero = zero
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.succ_mul
[410, 1]
[417, 6]
induction' n with n ih
m n : MyNat ⊢ m.succ.mul n = (m.mul n).add n
case zero m : MyNat ⊢ m.succ.mul zero = (m.mul zero).add zero case succ m n : MyNat ih : m.succ.mul n = (m.mul n).add n ⊢ m.succ.mul n.succ = (m.mul n.succ).add n.succ
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.succ_mul
[410, 1]
[417, 6]
rw [mul, mul, ih, add_assoc, add_assoc, add_comm n, succ_add]
case succ m n : MyNat ih : m.succ.mul n = (m.mul n).add n ⊢ m.succ.mul n.succ = (m.mul n.succ).add n.succ
case succ m n : MyNat ih : m.succ.mul n = (m.mul n).add n ⊢ (m.mul n).add (m.add n).succ = (m.mul n).add (m.add n.succ)
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.succ_mul
[410, 1]
[417, 6]
rfl
case succ m n : MyNat ih : m.succ.mul n = (m.mul n).add n ⊢ (m.mul n).add (m.add n).succ = (m.mul n).add (m.add n.succ)
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.succ_mul
[410, 1]
[417, 6]
rfl
case zero m : MyNat ⊢ m.succ.mul zero = (m.mul zero).add zero
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.mul_comm
[420, 1]
[427, 25]
induction' n with n ih
m n : MyNat ⊢ m.mul n = n.mul m
case zero m : MyNat ⊢ m.mul zero = zero.mul m case succ m n : MyNat ih : m.mul n = n.mul m ⊢ m.mul n.succ = n.succ.mul m
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.mul_comm
[420, 1]
[427, 25]
rw [mul, ih, succ_mul]
case succ m n : MyNat ih : m.mul n = n.mul m ⊢ m.mul n.succ = n.succ.mul m
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.mul_comm
[420, 1]
[427, 25]
rw [zero_mul]
case zero m : MyNat ⊢ m.mul zero = zero.mul m
case zero m : MyNat ⊢ m.mul zero = zero
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C05_Elementary_Number_Theory/S02_Induction_and_Recursion.lean
MyNat.mul_comm
[420, 1]
[427, 25]
rfl
case zero m : MyNat ⊢ m.mul zero = zero
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact1
[387, 1]
[392, 11]
have h : 0 ≤ a ^ 2 - 2 * a * b + b ^ 2
a b c d e : ℝ ⊢ a * b * 2 ≤ a ^ 2 + b ^ 2
case h a b c d e : ℝ ⊢ 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 a b c d e : ℝ h : 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 ⊢ a * b * 2 ≤ a ^ 2 + b ^ 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact1
[387, 1]
[392, 11]
calc a ^ 2 - 2 * a * b + b ^ 2 = (a - b) ^ 2 := by ring _ ≥ 0 := by apply pow_two_nonneg
case h a b c d e : ℝ ⊢ 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 a b c d e : ℝ h : 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 ⊢ a * b * 2 ≤ a ^ 2 + b ^ 2
a b c d e : ℝ h : 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 ⊢ a * b * 2 ≤ a ^ 2 + b ^ 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact1
[387, 1]
[392, 11]
linarith
a b c d e : ℝ h : 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 ⊢ a * b * 2 ≤ a ^ 2 + b ^ 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact1
[387, 1]
[392, 11]
ring
a b c d e : ℝ ⊢ a ^ 2 - 2 * a * b + b ^ 2 = (a - b) ^ 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact1
[387, 1]
[392, 11]
apply pow_two_nonneg
a b c d e : ℝ ⊢ (a - b) ^ 2 ≥ 0
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact2
[394, 1]
[399, 11]
have h : 0 ≤ a ^ 2 + 2 * a * b + b ^ 2
a b c d e : ℝ ⊢ -(a * b) * 2 ≤ a ^ 2 + b ^ 2
case h a b c d e : ℝ ⊢ 0 ≤ a ^ 2 + 2 * a * b + b ^ 2 a b c d e : ℝ h : 0 ≤ a ^ 2 + 2 * a * b + b ^ 2 ⊢ -(a * b) * 2 ≤ a ^ 2 + b ^ 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact2
[394, 1]
[399, 11]
calc a ^ 2 + 2 * a * b + b ^ 2 = (a + b) ^ 2 := by ring _ ≥ 0 := by apply pow_two_nonneg
case h a b c d e : ℝ ⊢ 0 ≤ a ^ 2 + 2 * a * b + b ^ 2 a b c d e : ℝ h : 0 ≤ a ^ 2 + 2 * a * b + b ^ 2 ⊢ -(a * b) * 2 ≤ a ^ 2 + b ^ 2
a b c d e : ℝ h : 0 ≤ a ^ 2 + 2 * a * b + b ^ 2 ⊢ -(a * b) * 2 ≤ a ^ 2 + b ^ 2
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact2
[394, 1]
[399, 11]
linarith
a b c d e : ℝ h : 0 ≤ a ^ 2 + 2 * a * b + b ^ 2 ⊢ -(a * b) * 2 ≤ a ^ 2 + b ^ 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact2
[394, 1]
[399, 11]
ring
a b c d e : ℝ ⊢ a ^ 2 + 2 * a * b + b ^ 2 = (a + b) ^ 2
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C02_Basics/S03_Using_Theorems_and_Lemmas.lean
fact2
[394, 1]
[399, 11]
apply pow_two_nonneg
a b c d e : ℝ ⊢ (a + b) ^ 2 ≥ 0
no goals
https://github.com/avigad/mathematics_in_lean_source.git
3fa84e6b3135a3ae41edc6ca195abf0fb1ae3ac3
MIL/C07_Hierarchies/S02_Morphisms.lean
map_inv_of_inv
[202, 1]
[204, 61]
rw [← MonoidHomClass₂.map_mul, h, MonoidHomClass₂.map_one]
M N F : Type inst✝² : Monoid M inst✝¹ : Monoid N inst✝ : MonoidHomClass₂ F M N f : F m m' : M h : m * m' = 1 ⊢ ↑f m * ↑f m' = 1
no goals