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
input
stringlengths
73
2.09M
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2021/N2/N2.lean
IMOSL.IMO2021N2.good_cond2_k_witness
[64, 1]
[89, 51]
exact Nat.add_le_add h (Nat.le_add_left 1 k)
case intro.intro.inr.refine_2 k : β„• h1 : 2 * k ^ 2 + 4 * k + 2 = 2 * (k + 1) ^ 2 h : 8 ≀ k + 1 ⊒ 8 + 1 ≀ k + 1 + (k + 1)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case intro.intro.inr.refine_2 k : β„• h1 : 2 * k ^ 2 + 4 * k + 2 = 2 * (k + 1) ^ 2 h : 8 ≀ k + 1 ⊒ 8 + 1 ≀ k + 1 + (k + 1) TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2021/N2/N2.lean
IMOSL.IMO2021N2.good_cond2_k_witness
[64, 1]
[89, 51]
rw [add_sq, Nat.mul_add, Nat.mul_add, Nat.mul_one, ← Nat.mul_assoc]
k : β„• h : 99 ≀ 2 * k ^ 2 + 4 * k h1 : k ^ 2 + 6 * k + 8 ≀ 2 * k ^ 2 + 4 * k ⊒ 2 * k ^ 2 + 4 * k + 2 = 2 * (k + 1) ^ 2
k : β„• h : 99 ≀ 2 * k ^ 2 + 4 * k h1 : k ^ 2 + 6 * k + 8 ≀ 2 * k ^ 2 + 4 * k ⊒ 2 * k ^ 2 + 4 * k + 2 = 2 * k ^ 2 + 2 * 2 * k + 2 * 1 ^ 2
Please generate a tactic in lean4 to solve the state. STATE: k : β„• h : 99 ≀ 2 * k ^ 2 + 4 * k h1 : k ^ 2 + 6 * k + 8 ≀ 2 * k ^ 2 + 4 * k ⊒ 2 * k ^ 2 + 4 * k + 2 = 2 * (k + 1) ^ 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2021/N2/N2.lean
IMOSL.IMO2021N2.good_cond2_k_witness
[64, 1]
[89, 51]
rfl
k : β„• h : 99 ≀ 2 * k ^ 2 + 4 * k h1 : k ^ 2 + 6 * k + 8 ≀ 2 * k ^ 2 + 4 * k ⊒ 2 * k ^ 2 + 4 * k + 2 = 2 * k ^ 2 + 2 * 2 * k + 2 * 1 ^ 2
no goals
Please generate a tactic in lean4 to solve the state. STATE: k : β„• h : 99 ≀ 2 * k ^ 2 + 4 * k h1 : k ^ 2 + 6 * k + 8 ≀ 2 * k ^ 2 + 4 * k ⊒ 2 * k ^ 2 + 4 * k + 2 = 2 * k ^ 2 + 2 * 2 * k + 2 * 1 ^ 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.x_mul4
[48, 1]
[50, 80]
change x (2 * 2 * k) = xor k.bodd (x k)
k : β„• ⊒ x (4 * k) = xor k.bodd (x k)
k : β„• ⊒ x (2 * 2 * k) = xor k.bodd (x k)
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ x (4 * k) = xor k.bodd (x k) TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.x_mul4
[48, 1]
[50, 80]
rw [mul_assoc, x_mul2, x_mul2, ← Nat.bit0_val, Nat.bodd_bit0, Bool.false_xor]
k : β„• ⊒ x (2 * 2 * k) = xor k.bodd (x k)
no goals
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ x (2 * 2 * k) = xor k.bodd (x k) TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.x_mul4_add1
[52, 1]
[55, 51]
change x (2 * 2 * k + 1) = !x (2 * 2 * k)
k : β„• ⊒ x (4 * k + 1) = !x (4 * k)
k : β„• ⊒ x (2 * 2 * k + 1) = !x (2 * 2 * k)
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ x (4 * k + 1) = !x (4 * k) TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.x_mul4_add1
[52, 1]
[55, 51]
rw [mul_assoc, x_mul2, x_mul2_add1, ← Nat.bit0_val, Nat.bodd_bit0, Bool.false_xor]
k : β„• ⊒ x (2 * 2 * k + 1) = !x (2 * 2 * k)
no goals
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ x (2 * 2 * k + 1) = !x (2 * 2 * k) TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.x_mul4_add2
[57, 1]
[60, 64]
change x (2 * 2 * k + 2) = x k
k : β„• ⊒ x (4 * k + 2) = x k
k : β„• ⊒ x (2 * 2 * k + 2) = x k
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ x (4 * k + 2) = x k TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.x_mul4_add2
[57, 1]
[60, 64]
rw [mul_assoc, ← mul_add_one, x_mul2, x_mul2_add1, ← Nat.bit1_val, Nat.bodd_bit1, Bool.true_xor, Bool.not_not]
k : β„• ⊒ x (2 * 2 * k + 2) = x k
no goals
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ x (2 * 2 * k + 2) = x k TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.x_mul4_add3
[62, 1]
[64, 72]
change x (2 * 2 * k + 2 + 1) = x k
k : β„• ⊒ x (4 * k + 3) = x k
k : β„• ⊒ x (2 * 2 * k + 2 + 1) = x k
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ x (4 * k + 3) = x k TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.x_mul4_add3
[62, 1]
[64, 72]
rw [mul_assoc, ← mul_add_one, x_mul2_add1, x_mul2_add1, Bool.not_not]
k : β„• ⊒ x (2 * 2 * k + 2 + 1) = x k
no goals
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ x (2 * 2 * k + 2 + 1) = x k TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_mul4_add2
[79, 1]
[81, 34]
rw [S_succ, S_succ, add_assoc, add_right_eq_self, x_mul4_add1]
k : β„• ⊒ S (4 * k + 2) = S (4 * k)
k : β„• ⊒ ((bif x (4 * k) then -1 else 1) + bif !x (4 * k) then -1 else 1) = 0
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ S (4 * k + 2) = S (4 * k) TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_mul4_add2
[79, 1]
[81, 34]
exact (x (4 * k)).recOn rfl rfl
k : β„• ⊒ ((bif x (4 * k) then -1 else 1) + bif !x (4 * k) then -1 else 1) = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ ((bif x (4 * k) then -1 else 1) + bif !x (4 * k) then -1 else 1) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_mul4
[83, 1]
[87, 52]
change S (4 * k + 4) = 2 * S k.succ
k : β„• h : S (4 * k) = 2 * S k ⊒ S (4 * k.succ) = 2 * S k.succ
k : β„• h : S (4 * k) = 2 * S k ⊒ S (4 * k + 4) = 2 * S k.succ
Please generate a tactic in lean4 to solve the state. STATE: k : β„• h : S (4 * k) = 2 * S k ⊒ S (4 * k.succ) = 2 * S k.succ TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_mul4
[83, 1]
[87, 52]
rw [S_succ, x_mul4_add3, S_succ, x_mul4_add2, S_mul4_add2, h, add_assoc, ← two_mul, ← mul_add, ← S_succ]
k : β„• h : S (4 * k) = 2 * S k ⊒ S (4 * k + 4) = 2 * S k.succ
no goals
Please generate a tactic in lean4 to solve the state. STATE: k : β„• h : S (4 * k) = 2 * S k ⊒ S (4 * k + 4) = 2 * S k.succ TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_parity
[89, 1]
[92, 28]
rw [Nat.bodd_succ, S_succ, Int.bodd_add, h, ← Bool.xor_true]
k : β„• h : (S k).bodd = k.bodd ⊒ (S k.succ).bodd = k.succ.bodd
k : β„• h : (S k).bodd = k.bodd ⊒ xor k.bodd (bif x k then -1 else 1).bodd = xor k.bodd true
Please generate a tactic in lean4 to solve the state. STATE: k : β„• h : (S k).bodd = k.bodd ⊒ (S k.succ).bodd = k.succ.bodd TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_parity
[89, 1]
[92, 28]
exact (x k).rec rfl rfl
k : β„• h : (S k).bodd = k.bodd ⊒ xor k.bodd (bif x k then -1 else 1).bodd = xor k.bodd true
no goals
Please generate a tactic in lean4 to solve the state. STATE: k : β„• h : (S k).bodd = k.bodd ⊒ xor k.bodd (bif x k then -1 else 1).bodd = xor k.bodd true TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
refine ⟨fun h0 ↦ (and_iff_right_of_imp ?_).mpr ?_, fun h0 ↦ ?_⟩
q r : β„• h : r < 4 ⊒ S (4 * q + r) = 0 ↔ S q = 0 ∧ (r = 0 ∨ r = 2)
case refine_1 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 β†’ S q = 0 case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: q r : β„• h : r < 4 ⊒ S (4 * q + r) = 0 ↔ S q = 0 ∧ (r = 0 ∨ r = 2) TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
replace h : (2 : β„€) β‰  0 := two_ne_zero
case refine_1 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 β†’ S q = 0 case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_1 q r : β„• h0 : S (4 * q + r) = 0 h : 2 β‰  0 ⊒ r = 0 ∨ r = 2 β†’ S q = 0 case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_1 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 β†’ S q = 0 case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rintro (rfl | rfl)
case refine_1 q r : β„• h0 : S (4 * q + r) = 0 h : 2 β‰  0 ⊒ r = 0 ∨ r = 2 β†’ S q = 0 case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_1.inl q : β„• h : 2 β‰  0 h0 : S (4 * q + 0) = 0 ⊒ S q = 0 case refine_1.inr q : β„• h : 2 β‰  0 h0 : S (4 * q + 2) = 0 ⊒ S q = 0 case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_1 q r : β„• h0 : S (4 * q + r) = 0 h : 2 β‰  0 ⊒ r = 0 ∨ r = 2 β†’ S q = 0 case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
apply_fun Int.bodd at h0
case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_2 q r : β„• h : r < 4 h0 : (S (4 * q + r)).bodd = Int.bodd 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h : r < 4 h0 : S (4 * q + r) = 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rw [Int.bodd_zero, S_parity, Nat.bodd_add, Nat.bodd_mul] at h0
case refine_2 q r : β„• h : r < 4 h0 : (S (4 * q + r)).bodd = Int.bodd 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_2 q r : β„• h : r < 4 h0 : xor (Nat.bodd 4 && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h : r < 4 h0 : (S (4 * q + r)).bodd = Int.bodd 0 ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
change xor (false && q.bodd) r.bodd = false at h0
case refine_2 q r : β„• h : r < 4 h0 : xor (Nat.bodd 4 && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_2 q r : β„• h : r < 4 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h : r < 4 h0 : xor (Nat.bodd 4 && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
iterate 3 rw [Nat.lt_succ_iff_lt_or_eq] at h
case refine_2 q r : β„• h : r < 4 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_2 q r : β„• h : ((r < 1 ∨ r = 1) ∨ r = 2) ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h : r < 4 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rw [Nat.lt_one_iff, or_assoc, or_or_or_comm] at h
case refine_2 q r : β„• h : ((r < 1 ∨ r = 1) ∨ r = 2) ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_2 q r : β„• h : (r = 0 ∨ r = 2) ∨ r = 1 ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h : ((r < 1 ∨ r = 1) ∨ r = 2) ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
revert h
case refine_2 q r : β„• h : (r = 0 ∨ r = 2) ∨ r = 1 ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_2 q r : β„• h0 : xor (false && q.bodd) r.bodd = false ⊒ (r = 0 ∨ r = 2) ∨ r = 1 ∨ r = 3 β†’ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h : (r = 0 ∨ r = 2) ∨ r = 1 ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
refine' (or_iff_left _).mp
case refine_2 q r : β„• h0 : xor (false && q.bodd) r.bodd = false ⊒ (r = 0 ∨ r = 2) ∨ r = 1 ∨ r = 3 β†’ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_2 q r : β„• h0 : xor (false && q.bodd) r.bodd = false ⊒ Β¬(r = 1 ∨ r = 3) case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h0 : xor (false && q.bodd) r.bodd = false ⊒ (r = 0 ∨ r = 2) ∨ r = 1 ∨ r = 3 β†’ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rintro (rfl | rfl) <;> exact Bool.true_eq_false_eq_False h0
case refine_2 q r : β„• h0 : xor (false && q.bodd) r.bodd = false ⊒ Β¬(r = 1 ∨ r = 3) case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h0 : xor (false && q.bodd) r.bodd = false ⊒ Β¬(r = 1 ∨ r = 3) case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rcases h0 with ⟨h0, rfl | rfl⟩
case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_3.intro.inl q : β„• h0 : S q = 0 h : 0 < 4 ⊒ S (4 * q + 0) = 0 case refine_3.intro.inr q : β„• h0 : S q = 0 h : 2 < 4 ⊒ S (4 * q + 2) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rwa [add_zero, S_mul4, mul_eq_zero, or_iff_right h] at h0
case refine_1.inl q : β„• h : 2 β‰  0 h0 : S (4 * q + 0) = 0 ⊒ S q = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case refine_1.inl q : β„• h : 2 β‰  0 h0 : S (4 * q + 0) = 0 ⊒ S q = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rwa [S_mul4_add2, S_mul4, mul_eq_zero, or_iff_right h] at h0
case refine_1.inr q : β„• h : 2 β‰  0 h0 : S (4 * q + 2) = 0 ⊒ S q = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case refine_1.inr q : β„• h : 2 β‰  0 h0 : S (4 * q + 2) = 0 ⊒ S q = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rw [Nat.lt_succ_iff_lt_or_eq] at h
case refine_2 q r : β„• h : (r < 2 ∨ r = 2) ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
case refine_2 q r : β„• h : ((r < 1 ∨ r = 1) ∨ r = 2) ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 q r : β„• h : (r < 2 ∨ r = 2) ∨ r = 3 h0 : xor (false && q.bodd) r.bodd = false ⊒ r = 0 ∨ r = 2 case refine_3 q r : β„• h : r < 4 h0 : S q = 0 ∧ (r = 0 ∨ r = 2) ⊒ S (4 * q + r) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rw [add_zero, S_mul4, h0]
case refine_3.intro.inl q : β„• h0 : S q = 0 h : 0 < 4 ⊒ S (4 * q + 0) = 0
case refine_3.intro.inl q : β„• h0 : S q = 0 h : 0 < 4 ⊒ 2 * 0 = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_3.intro.inl q : β„• h0 : S q = 0 h : 0 < 4 ⊒ S (4 * q + 0) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rfl
case refine_3.intro.inl q : β„• h0 : S q = 0 h : 0 < 4 ⊒ 2 * 0 = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case refine_3.intro.inl q : β„• h0 : S q = 0 h : 0 < 4 ⊒ 2 * 0 = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rw [S_mul4_add2, S_mul4, h0]
case refine_3.intro.inr q : β„• h0 : S q = 0 h : 2 < 4 ⊒ S (4 * q + 2) = 0
case refine_3.intro.inr q : β„• h0 : S q = 0 h : 2 < 4 ⊒ 2 * 0 = 0
Please generate a tactic in lean4 to solve the state. STATE: case refine_3.intro.inr q : β„• h0 : S q = 0 h : 2 < 4 ⊒ S (4 * q + 2) = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff
[94, 1]
[113, 38]
rfl
case refine_3.intro.inr q : β„• h0 : S q = 0 h : 2 < 4 ⊒ 2 * 0 = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case refine_3.intro.inr q : β„• h0 : S q = 0 h : 2 < 4 ⊒ 2 * 0 = 0 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
intro k h
⊒ βˆ€ (k : β„•), S k = 0 β†’ x k = false
k : β„• h : S k = 0 ⊒ x k = false
Please generate a tactic in lean4 to solve the state. STATE: ⊒ βˆ€ (k : β„•), S k = 0 β†’ x k = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
induction' k using Nat.strong_induction_on with k k_ih
k : β„• h : S k = 0 ⊒ x k = false
case h k : β„• k_ih : βˆ€ m < k, S m = 0 β†’ x m = false h : S k = 0 ⊒ x k = false
Please generate a tactic in lean4 to solve the state. STATE: k : β„• h : S k = 0 ⊒ x k = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
obtain ⟨q, r, h0, rfl⟩ : βˆƒ q r : β„•, r < 4 ∧ 4 * q + r = k := ⟨k / 4, k % 4, Nat.mod_lt k four_pos, Nat.div_add_mod k 4⟩
case h k : β„• k_ih : βˆ€ m < k, S m = 0 β†’ x m = false h : S k = 0 ⊒ x k = false
case h.intro.intro.intro q r : β„• h0 : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S (4 * q + r) = 0 ⊒ x (4 * q + r) = false
Please generate a tactic in lean4 to solve the state. STATE: case h k : β„• k_ih : βˆ€ m < k, S m = 0 β†’ x m = false h : S k = 0 ⊒ x k = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [S_four_mul_add_eq_zero_iff q h0, or_comm] at h
case h.intro.intro.intro q r : β„• h0 : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S (4 * q + r) = 0 ⊒ x (4 * q + r) = false
case h.intro.intro.intro q r : β„• h0 : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S q = 0 ∧ (r = 2 ∨ r = 0) ⊒ x (4 * q + r) = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro q r : β„• h0 : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S (4 * q + r) = 0 ⊒ x (4 * q + r) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
clear h0
case h.intro.intro.intro q r : β„• h0 : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S q = 0 ∧ (r = 2 ∨ r = 0) ⊒ x (4 * q + r) = false
case h.intro.intro.intro q r : β„• k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S q = 0 ∧ (r = 2 ∨ r = 0) ⊒ x (4 * q + r) = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro q r : β„• h0 : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S q = 0 ∧ (r = 2 ∨ r = 0) ⊒ x (4 * q + r) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rcases h with ⟨h, rfl | rfl⟩
case h.intro.intro.intro q r : β„• k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S q = 0 ∧ (r = 2 ∨ r = 0) ⊒ x (4 * q + r) = false
case h.intro.intro.intro.intro.inl q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 2, S m = 0 β†’ x m = false ⊒ x (4 * q + 2) = false case h.intro.intro.intro.intro.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false ⊒ x (4 * q + 0) = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro q r : β„• k_ih : βˆ€ m < 4 * q + r, S m = 0 β†’ x m = false h : S q = 0 ∧ (r = 2 ∨ r = 0) ⊒ x (4 * q + r) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rcases q.eq_zero_or_pos with (rfl | h0)
case h.intro.intro.intro.intro.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false ⊒ x (4 * q + 0) = false
case h.intro.intro.intro.intro.inr.inl h : S 0 = 0 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 β†’ x m = false ⊒ x (4 * 0 + 0) = false case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false h0 : q > 0 ⊒ x (4 * q + 0) = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false ⊒ x (4 * q + 0) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [add_zero, MulZeroClass.mul_zero, x_zero]
case h.intro.intro.intro.intro.inr.inl h : S 0 = 0 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 β†’ x m = false ⊒ x (4 * 0 + 0) = false case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false h0 : q > 0 ⊒ x (4 * q + 0) = false
case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false h0 : q > 0 ⊒ x (4 * q + 0) = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inr.inl h : S 0 = 0 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 β†’ x m = false ⊒ x (4 * 0 + 0) = false case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false h0 : q > 0 ⊒ x (4 * q + 0) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
replace k_ih := k_ih q (lt_mul_left h0 <| Nat.succ_lt_succ <| Nat.succ_pos 2) h
case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false h0 : q > 0 ⊒ x (4 * q + 0) = false
case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 h0 : q > 0 k_ih : x q = false ⊒ x (4 * q + 0) = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 0, S m = 0 β†’ x m = false h0 : q > 0 ⊒ x (4 * q + 0) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
apply_fun Int.bodd at h
case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 h0 : q > 0 k_ih : x q = false ⊒ x (4 * q + 0) = false
case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : (S q).bodd = Int.bodd 0 ⊒ x (4 * q + 0) = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inr.inr q : β„• h : S q = 0 h0 : q > 0 k_ih : x q = false ⊒ x (4 * q + 0) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [Int.bodd_zero, S_parity] at h
case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : (S q).bodd = Int.bodd 0 ⊒ x (4 * q + 0) = false
case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : q.bodd = false ⊒ x (4 * q + 0) = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : (S q).bodd = Int.bodd 0 ⊒ x (4 * q + 0) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [add_zero, x_mul4, h, k_ih]
case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : q.bodd = false ⊒ x (4 * q + 0) = false
case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : q.bodd = false ⊒ xor false false = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : q.bodd = false ⊒ x (4 * q + 0) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rfl
case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : q.bodd = false ⊒ xor false false = false
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inr.inr q : β„• h0 : q > 0 k_ih : x q = false h : q.bodd = false ⊒ xor false false = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
refine Nat.rec (Int.le_refl 0) (Ξ» k h ↦ ?_)
this : βˆ€ (k : β„•), S k = 0 β†’ x k = false ⊒ βˆ€ (k : β„•), 0 ≀ S k
this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 ≀ S k ⊒ 0 ≀ S k.succ
Please generate a tactic in lean4 to solve the state. STATE: this : βˆ€ (k : β„•), S k = 0 β†’ x k = false ⊒ βˆ€ (k : β„•), 0 ≀ S k TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [le_iff_lt_or_eq, Int.lt_iff_add_one_le, zero_add, or_comm] at h
this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 ≀ S k ⊒ 0 ≀ S k.succ
this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ∨ 1 ≀ S k ⊒ 0 ≀ S k.succ
Please generate a tactic in lean4 to solve the state. STATE: this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 ≀ S k ⊒ 0 ≀ S k.succ TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [S_succ]
this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ∨ 1 ≀ S k ⊒ 0 ≀ S k.succ
this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ∨ 1 ≀ S k ⊒ 0 ≀ S k + bif x k then -1 else 1
Please generate a tactic in lean4 to solve the state. STATE: this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ∨ 1 ≀ S k ⊒ 0 ≀ S k.succ TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rcases h with h | h
this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ∨ 1 ≀ S k ⊒ 0 ≀ S k + bif x k then -1 else 1
case inl this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ⊒ 0 ≀ S k + bif x k then -1 else 1 case inr this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 1 ≀ S k ⊒ 0 ≀ S k + bif x k then -1 else 1
Please generate a tactic in lean4 to solve the state. STATE: this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ∨ 1 ≀ S k ⊒ 0 ≀ S k + bif x k then -1 else 1 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [← h, zero_add, this k h.symm]
case inl this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ⊒ 0 ≀ S k + bif x k then -1 else 1
case inl this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ⊒ 0 ≀ bif false then -1 else 1
Please generate a tactic in lean4 to solve the state. STATE: case inl this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ⊒ 0 ≀ S k + bif x k then -1 else 1 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
exact Int.zero_lt_one.le
case inl this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ⊒ 0 ≀ bif false then -1 else 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: case inl this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 0 = S k ⊒ 0 ≀ bif false then -1 else 1 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [← add_neg_self (1 : β„€)]
case inr this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 1 ≀ S k ⊒ 0 ≀ S k + bif x k then -1 else 1
case inr this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 1 ≀ S k ⊒ 1 + -1 ≀ S k + bif x k then -1 else 1
Please generate a tactic in lean4 to solve the state. STATE: case inr this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 1 ≀ S k ⊒ 0 ≀ S k + bif x k then -1 else 1 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
exact add_le_add h ((x k).rec (neg_le_self zero_le_one) (-1).le_refl)
case inr this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 1 ≀ S k ⊒ 1 + -1 ≀ S k + bif x k then -1 else 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: case inr this : βˆ€ (k : β„•), S k = 0 β†’ x k = false k : β„• h : 1 ≀ S k ⊒ 1 + -1 ≀ S k + bif x k then -1 else 1 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
rw [x_mul4_add2]
case h.intro.intro.intro.intro.inl q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 2, S m = 0 β†’ x m = false ⊒ x (4 * q + 2) = false
case h.intro.intro.intro.intro.inl q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 2, S m = 0 β†’ x m = false ⊒ x q = false
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inl q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 2, S m = 0 β†’ x m = false ⊒ x (4 * q + 2) = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution
[122, 1]
[145, 38]
exact k_ih q (lt_add_of_le_of_pos (Nat.le_mul_of_pos_left _ four_pos) two_pos) h
case h.intro.intro.intro.intro.inl q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 2, S m = 0 β†’ x m = false ⊒ x q = false
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.intro.inl q : β„• h : S q = 0 k_ih : βˆ€ m < 4 * q + 2, S m = 0 β†’ x m = false ⊒ x q = false TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
induction' k using Nat.strong_induction_on with k k_ih
k : β„• ⊒ S k = 0 ↔ βˆ€ c ∈ Nat.digits 4 k, c = 0 ∨ c = 2
case h k : β„• k_ih : βˆ€ m < k, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S k = 0 ↔ βˆ€ c ∈ Nat.digits 4 k, c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: k : β„• ⊒ S k = 0 ↔ βˆ€ c ∈ Nat.digits 4 k, c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
obtain ⟨q, r, h, rfl⟩ : βˆƒ q r : β„•, r < 4 ∧ 4 * q + r = k := ⟨k / 4, k % 4, Nat.mod_lt k four_pos, Nat.div_add_mod k 4⟩
case h k : β„• k_ih : βˆ€ m < k, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S k = 0 ↔ βˆ€ c ∈ Nat.digits 4 k, c = 0 ∨ c = 2
case h.intro.intro.intro q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S (4 * q + r) = 0 ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h k : β„• k_ih : βˆ€ m < k, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S k = 0 ↔ βˆ€ c ∈ Nat.digits 4 k, c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rw [S_four_mul_add_eq_zero_iff q h]
case h.intro.intro.intro q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S (4 * q + r) = 0 ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S (4 * q + r) = 0 ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rcases q.eq_zero_or_pos with (rfl | h0)
case h.intro.intro.intro q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inl r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S 0 = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * 0 + r), c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rw [S_zero, eq_self_iff_true, true_and_iff, MulZeroClass.mul_zero, zero_add]
case h.intro.intro.intro.inl r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S 0 = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * 0 + r), c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inl r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inl r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ S 0 = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * 0 + r), c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rcases r.eq_zero_or_pos with (rfl | h0)
case h.intro.intro.intro.inl r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ 0 = 0 ∨ 0 = 2 ↔ βˆ€ c ∈ Nat.digits 4 0, c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inl r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rw [eq_self_iff_true, true_or_iff, true_iff_iff, Nat.digits_zero]
case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ 0 = 0 ∨ 0 = 2 ↔ βˆ€ c ∈ Nat.digits 4 0, c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ βˆ€ c ∈ [], c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ 0 = 0 ∨ 0 = 2 ↔ βˆ€ c ∈ Nat.digits 4 0, c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
intro c h0
case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ βˆ€ c ∈ [], c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 c : β„• h0 : c ∈ [] ⊒ c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 ⊒ βˆ€ c ∈ [], c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
exact absurd h0 (by exact List.not_mem_nil c)
case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 c : β„• h0 : c ∈ [] ⊒ c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inl.inl h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 c : β„• h0 : c ∈ [] ⊒ c = 0 ∨ c = 2 case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rw [Nat.digits_def' (Nat.succ_lt_succ <| Nat.succ_pos 2) h0, Nat.mod_eq_of_lt h, Nat.div_eq_of_lt h, Nat.digits_zero]
case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ [r], c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ Nat.digits 4 r, c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
simp_rw [List.mem_singleton]
case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ [r], c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ (c : β„•), c = r β†’ c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ c ∈ [r], c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rw [forall_eq]
case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ (c : β„•), c = r β†’ c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inl.inr r : β„• h : r < 4 k_ih : βˆ€ m < 4 * 0 + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : r > 0 ⊒ r = 0 ∨ r = 2 ↔ βˆ€ (c : β„•), c = r β†’ c = 0 ∨ c = 2 case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
replace k_ih := k_ih q (Nat.lt_add_right _ <| lt_mul_left h0 <| Nat.succ_lt_succ <| Nat.succ_pos 2)
case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inr q r : β„• h : r < 4 k_ih : βˆ€ m < 4 * q + r, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 h0 : q > 0 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rw [k_ih, add_comm, Nat.digits_add 4 (Nat.succ_lt_succ <| Nat.succ_pos 2) r q h <| Or.inr h0.ne.symm]
case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2
case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ (βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2) ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ r :: Nat.digits 4 q, c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ S q = 0 ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ Nat.digits 4 (4 * q + r), c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
simp_rw [List.mem_cons]
case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ (βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2) ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ r :: Nat.digits 4 q, c = 0 ∨ c = 2
case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ (βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2) ∧ (r = 0 ∨ r = 2) ↔ βˆ€ (c : β„•), c = r ∨ c ∈ Nat.digits 4 q β†’ c = 0 ∨ c = 2
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ (βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2) ∧ (r = 0 ∨ r = 2) ↔ βˆ€ c ∈ r :: Nat.digits 4 q, c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
rw [forall_eq_or_imp, and_comm]
case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ (βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2) ∧ (r = 0 ∨ r = 2) ↔ βˆ€ (c : β„•), c = r ∨ c ∈ Nat.digits 4 q β†’ c = 0 ∨ c = 2
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h.intro.intro.intro.inr q r : β„• h : r < 4 h0 : q > 0 k_ih : S q = 0 ↔ βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2 ⊒ (βˆ€ c ∈ Nat.digits 4 q, c = 0 ∨ c = 2) ∧ (r = 0 ∨ r = 2) ↔ βˆ€ (c : β„•), c = r ∨ c ∈ Nat.digits 4 q β†’ c = 0 ∨ c = 2 TACTIC:
https://github.com/mortarsanjaya/IMOSLLean4.git
be127d301e366822fbeeeda49d9fd5b998fb4eb5
IMOSLLean4/IMO2010/A4/A4.lean
IMOSL.IMO2010A4.final_solution_extra
[148, 1]
[168, 59]
exact List.not_mem_nil c
h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 c : β„• h0 : c ∈ [] ⊒ c βˆ‰ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: h : 0 < 4 k_ih : βˆ€ m < 4 * 0 + 0, S m = 0 ↔ βˆ€ c ∈ Nat.digits 4 m, c = 0 ∨ c = 2 c : β„• h0 : c ∈ [] ⊒ c βˆ‰ [] TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.one_le_succ
[21, 1]
[22, 38]
exact tsub_add_cancel_iff_le.mp rfl
x : β„• ⊒ 1 ≀ succ x
no goals
Please generate a tactic in lean4 to solve the state. STATE: x : β„• ⊒ 1 ≀ succ x TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.modCore_one
[24, 1]
[25, 53]
induction x <;> (try unfold Nat.modCore; simp [*])
x : β„• ⊒ Nat.modCore x 1 = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: x : β„• ⊒ Nat.modCore x 1 = 0 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.modCore_one
[24, 1]
[25, 53]
try unfold Nat.modCore; simp [*]
case succ n✝ : β„• n_ih✝ : Nat.modCore n✝ 1 = 0 ⊒ Nat.modCore (succ n✝) 1 = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case succ n✝ : β„• n_ih✝ : Nat.modCore n✝ 1 = 0 ⊒ Nat.modCore (succ n✝) 1 = 0 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.modCore_one
[24, 1]
[25, 53]
unfold Nat.modCore
case succ n✝ : β„• n_ih✝ : Nat.modCore n✝ 1 = 0 ⊒ Nat.modCore (succ n✝) 1 = 0
case succ n✝ : β„• n_ih✝ : Nat.modCore n✝ 1 = 0 ⊒ (if 0 < 1 ∧ 1 ≀ succ n✝ then Nat.modCore (succ n✝ - 1) 1 else succ n✝) = 0
Please generate a tactic in lean4 to solve the state. STATE: case succ n✝ : β„• n_ih✝ : Nat.modCore n✝ 1 = 0 ⊒ Nat.modCore (succ n✝) 1 = 0 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.modCore_one
[24, 1]
[25, 53]
simp [*]
case succ n✝ : β„• n_ih✝ : Nat.modCore n✝ 1 = 0 ⊒ (if 0 < 1 ∧ 1 ≀ succ n✝ then Nat.modCore (succ n✝ - 1) 1 else succ n✝) = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case succ n✝ : β„• n_ih✝ : Nat.modCore n✝ 1 = 0 ⊒ (if 0 < 1 ∧ 1 ≀ succ n✝ then Nat.modCore (succ n✝ - 1) 1 else succ n✝) = 0 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.modCore_zero
[27, 1]
[31, 19]
unfold Nat.modCore
x : β„• ⊒ Nat.modCore 0 x = 0
x : β„• ⊒ (if 0 < x ∧ x ≀ 0 then Nat.modCore (0 - x) x else 0) = 0
Please generate a tactic in lean4 to solve the state. STATE: x : β„• ⊒ Nat.modCore 0 x = 0 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.modCore_zero
[27, 1]
[31, 19]
simp only [nonpos_iff_eq_zero, ge_iff_le, _root_.zero_le, tsub_eq_zero_of_le, ite_eq_right_iff, and_imp]
x : β„• ⊒ (if 0 < x ∧ x ≀ 0 then Nat.modCore (0 - x) x else 0) = 0
x : β„• ⊒ 0 < x β†’ x = 0 β†’ Nat.modCore 0 x = 0
Please generate a tactic in lean4 to solve the state. STATE: x : β„• ⊒ (if 0 < x ∧ x ≀ 0 then Nat.modCore (0 - x) x else 0) = 0 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.modCore_zero
[27, 1]
[31, 19]
rintro _ ⟨⟩
x : β„• ⊒ 0 < x β†’ x = 0 β†’ Nat.modCore 0 x = 0
case refl a✝ : 0 < 0 ⊒ Nat.modCore 0 0 = 0
Please generate a tactic in lean4 to solve the state. STATE: x : β„• ⊒ 0 < x β†’ x = 0 β†’ Nat.modCore 0 x = 0 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.modCore_zero
[27, 1]
[31, 19]
rfl
case refl a✝ : 0 < 0 ⊒ Nat.modCore 0 0 = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case refl a✝ : 0 < 0 ⊒ Nat.modCore 0 0 = 0 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
cases x
n x : β„• ⊒ (match x, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1
case zero n : β„• ⊒ (match zero, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1 case succ n n✝ : β„• ⊒ (match succ n✝, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1
Please generate a tactic in lean4 to solve the state. STATE: n x : β„• ⊒ (match x, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
next => simp
case zero n : β„• ⊒ (match zero, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1 case succ n n✝ : β„• ⊒ (match succ n✝, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1
case succ n n✝ : β„• ⊒ (match succ n✝, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1
Please generate a tactic in lean4 to solve the state. STATE: case zero n : β„• ⊒ (match zero, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1 case succ n n✝ : β„• ⊒ (match succ n✝, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
simp
n : β„• ⊒ (match zero, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : β„• ⊒ (match zero, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
simp
n x : β„• ⊒ (match succ x, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1
n x : β„• ⊒ Nat.modCore (succ x) (n + 1) < n + 1
Please generate a tactic in lean4 to solve the state. STATE: n x : β„• ⊒ (match succ x, n + 1 with | 0, x => 0 | x@h:(succ n), y => Nat.modCore x y) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
induction x using Nat.strongInductionOn
n x : β„• ⊒ Nat.modCore (succ x) (n + 1) < n + 1
case ind n n✝ : β„• a✝ : βˆ€ m < n✝, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ Nat.modCore (succ n✝) (n + 1) < n + 1
Please generate a tactic in lean4 to solve the state. STATE: n x : β„• ⊒ Nat.modCore (succ x) (n + 1) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
unfold Nat.modCore
n x : β„• ih : βˆ€ m < x, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ Nat.modCore (succ x) (n + 1) < n + 1
n x : β„• ih : βˆ€ m < x, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if 0 < n + 1 ∧ n + 1 ≀ succ x then Nat.modCore (succ x - (n + 1)) (n + 1) else succ x) < n + 1
Please generate a tactic in lean4 to solve the state. STATE: n x : β„• ih : βˆ€ m < x, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ Nat.modCore (succ x) (n + 1) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
cases x <;> simp [Nat.succ_le_succ_iff]
n x : β„• ih : βˆ€ m < x, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if 0 < n + 1 ∧ n + 1 ≀ succ x then Nat.modCore (succ x - (n + 1)) (n + 1) else succ x) < n + 1
case zero n : β„• ih : βˆ€ m < zero, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n = 0 then 0 else succ 0) < n + 1 case succ n n✝ : β„• ih : βˆ€ m < succ n✝, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n ≀ n✝ + 1 then Nat.modCore (n✝ + 1 - n) (n + 1) else succ (succ n✝)) < n + 1
Please generate a tactic in lean4 to solve the state. STATE: n x : β„• ih : βˆ€ m < x, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if 0 < n + 1 ∧ n + 1 ≀ succ x then Nat.modCore (succ x - (n + 1)) (n + 1) else succ x) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
next => cases n <;> simp
case zero n : β„• ih : βˆ€ m < zero, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n = 0 then 0 else succ 0) < n + 1 case succ n n✝ : β„• ih : βˆ€ m < succ n✝, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n ≀ n✝ + 1 then Nat.modCore (n✝ + 1 - n) (n + 1) else succ (succ n✝)) < n + 1
case succ n n✝ : β„• ih : βˆ€ m < succ n✝, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n ≀ n✝ + 1 then Nat.modCore (n✝ + 1 - n) (n + 1) else succ (succ n✝)) < n + 1
Please generate a tactic in lean4 to solve the state. STATE: case zero n : β„• ih : βˆ€ m < zero, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n = 0 then 0 else succ 0) < n + 1 case succ n n✝ : β„• ih : βˆ€ m < succ n✝, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n ≀ n✝ + 1 then Nat.modCore (n✝ + 1 - n) (n + 1) else succ (succ n✝)) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
cases n <;> simp
n : β„• ih : βˆ€ m < zero, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n = 0 then 0 else succ 0) < n + 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : β„• ih : βˆ€ m < zero, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n = 0 then 0 else succ 0) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
cases' n with n <;> simp
n x : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n ≀ x + 1 then Nat.modCore (x + 1 - n) (n + 1) else succ (succ x)) < n + 1
case succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 ⊒ (if succ n ≀ x + 1 then Nat.modCore (x - n) (succ n + 1) else succ (succ x)) < succ n + 1
Please generate a tactic in lean4 to solve the state. STATE: n x : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (n + 1) < n + 1 ⊒ (if n ≀ x + 1 then Nat.modCore (x + 1 - n) (n + 1) else succ (succ x)) < n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
split_ifs with h
case succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 ⊒ (if succ n ≀ x + 1 then Nat.modCore (x - n) (succ n + 1) else succ (succ x)) < succ n + 1
case pos x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 ⊒ Nat.modCore (x - n) (succ n + 1) < succ n + 1 case neg x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : Β¬succ n ≀ x + 1 ⊒ succ (succ x) < succ n + 1
Please generate a tactic in lean4 to solve the state. STATE: case succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 ⊒ (if succ n ≀ x + 1 then Nat.modCore (x - n) (succ n + 1) else succ (succ x)) < succ n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
cases hm : x - n
case pos x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 ⊒ Nat.modCore (x - n) (succ n + 1) < succ n + 1
case pos.zero x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 hm : x - n = zero ⊒ Nat.modCore zero (succ n + 1) < succ n + 1 case pos.succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 n✝ : β„• hm : x - n = succ n✝ ⊒ Nat.modCore (succ n✝) (succ n + 1) < succ n + 1
Please generate a tactic in lean4 to solve the state. STATE: case pos x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 ⊒ Nat.modCore (x - n) (succ n + 1) < succ n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
next => simp
case pos.zero x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 hm : x - n = zero ⊒ Nat.modCore zero (succ n + 1) < succ n + 1 case pos.succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 n✝ : β„• hm : x - n = succ n✝ ⊒ Nat.modCore (succ n✝) (succ n + 1) < succ n + 1
case pos.succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 n✝ : β„• hm : x - n = succ n✝ ⊒ Nat.modCore (succ n✝) (succ n + 1) < succ n + 1
Please generate a tactic in lean4 to solve the state. STATE: case pos.zero x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 hm : x - n = zero ⊒ Nat.modCore zero (succ n + 1) < succ n + 1 case pos.succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 n✝ : β„• hm : x - n = succ n✝ ⊒ Nat.modCore (succ n✝) (succ n + 1) < succ n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
next => apply ih apply Nat.lt_of_succ_le apply Nat.le_succ_of_le rw [←hm] apply sub_le
case pos.succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 n✝ : β„• hm : x - n = succ n✝ ⊒ Nat.modCore (succ n✝) (succ n + 1) < succ n + 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: case pos.succ x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 n✝ : β„• hm : x - n = succ n✝ ⊒ Nat.modCore (succ n✝) (succ n + 1) < succ n + 1 TACTIC:
https://github.com/alexkeizer/LeanMeetup.git
98bea524b3beaa38c37d61d1fa7592c24fa36c52
LeanMeetup/Exercise02Solutions.lean
Nat.ge_mod
[34, 1]
[58, 28]
simp
x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 hm : x - n = zero ⊒ Nat.modCore zero (succ n + 1) < succ n + 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: x n : β„• ih : βˆ€ m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1 h : succ n ≀ x + 1 hm : x - n = zero ⊒ Nat.modCore zero (succ n + 1) < succ n + 1 TACTIC: