Theorem: LO.FirstOrder.Arith.Model.even_or_odd (Arithmetization/Basic/IOpen.lean)

State before:
M : Type u_1
inst✝⁶ : Zero M
inst✝⁵ : One M
inst✝⁴ : Add M
inst✝³ : Mul M
inst✝² : LT M
inst✝¹ : M ⊧ₘ* 𝐏𝐀⁻
inst✝ : M ⊧ₘ* 𝐈open
a : M
⊢ a = 2 * (a / 2) ∨ a = 2 * (a / 2) + 1
Tactic:
have : 2 * (a / 2) + (a % 2) = a := div_add_mod a 2
State after:
M : Type u_1
inst✝⁶ : Zero M
inst✝⁵ : One M
inst✝⁴ : Add M
inst✝³ : Mul M
inst✝² : LT M
inst✝¹ : M ⊧ₘ* 𝐏𝐀⁻
inst✝ : M ⊧ₘ* 𝐈open
a : M
this : 2 * (a / 2) + a % 2 = a
⊢ a = 2 * (a / 2) ∨ a = 2 * (a / 2) + 1

State before:
M : Type u_1
inst✝⁶ : Zero M
inst✝⁵ : One M
inst✝⁴ : Add M
inst✝³ : Mul M
inst✝² : LT M
inst✝¹ : M ⊧ₘ* 𝐏𝐀⁻
inst✝ : M ⊧ₘ* 𝐈open
a : M
this : 2 * (a / 2) + a % 2 = a
⊢ a = 2 * (a / 2) ∨ a = 2 * (a / 2) + 1
Tactic:
rcases mod_two a with (e | e) <;> { simp[e] at this; simp [this] }
State after:
no goals

State before:
case inr
M : Type u_1
inst✝⁶ : Zero M
inst✝⁵ : One M
inst✝⁴ : Add M
inst✝³ : Mul M
inst✝² : LT M
inst✝¹ : M ⊧ₘ* 𝐏𝐀⁻
inst✝ : M ⊧ₘ* 𝐈open
a : M
this : 2 * (a / 2) + a % 2 = a
e : a % 2 = 1
⊢ a = 2 * (a / 2) ∨ a = 2 * (a / 2) + 1
Tactic:
simp[e] at this
State after:
case inr
M : Type u_1
inst✝⁶ : Zero M
inst✝⁵ : One M
inst✝⁴ : Add M
inst✝³ : Mul M
inst✝² : LT M
inst✝¹ : M ⊧ₘ* 𝐏𝐀⁻
inst✝ : M ⊧ₘ* 𝐈open
a : M
e : a % 2 = 1
this : 2 * (a / 2) + 1 = a
⊢ a = 2 * (a / 2) ∨ a = 2 * (a / 2) + 1

State before:
case inr
M : Type u_1
inst✝⁶ : Zero M
inst✝⁵ : One M
inst✝⁴ : Add M
inst✝³ : Mul M
inst✝² : LT M
inst✝¹ : M ⊧ₘ* 𝐏𝐀⁻
inst✝ : M ⊧ₘ* 𝐈open
a : M
e : a % 2 = 1
this : 2 * (a / 2) + 1 = a
⊢ a = 2 * (a / 2) ∨ a = 2 * (a / 2) + 1
Tactic:
simp [this]
State after:
no goals