Theorem: LO.FirstOrder.Arith.Model.sub_existsUnique (Arithmetization/Basic/PeanoMinus.lean)

State before:
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a✝ b✝ c a b : M
⊢ ∃! c, (a ≥ b → a = b + c) ∧ (a < b → c = 0)
Tactic:
have : b ≤ a ∨ a < b := le_or_lt b a
State after:
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a✝ b✝ c a b : M
this : b ≤ a ∨ a < b
⊢ ∃! c, (a ≥ b → a = b + c) ∧ (a < b → c = 0)

State before:
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a✝ b✝ c a b : M
this : b ≤ a ∨ a < b
⊢ ∃! c, (a ≥ b → a = b + c) ∧ (a < b → c = 0)
Tactic:
rcases this with (hxy | hxy) <;> simp [hxy]
State after:
case inl
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a✝ b✝ c a b : M
hxy : b ≤ a
⊢ ∃! c, a = b + c

State before:
case inl
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a✝ b✝ c a b : M
hxy : b ≤ a
⊢ ∃! c, a = b + c
Tactic:
have : ∃ c, a = b + c := exists_add_of_le hxy
State after:
case inl
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a✝ b✝ c a b : M
hxy : b ≤ a
this : ∃ c, a = b + c
⊢ ∃! c, a = b + c

State before:
case inl
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a✝ b✝ c a b : M
hxy : b ≤ a
this : ∃ c, a = b + c
⊢ ∃! c, a = b + c
Tactic:
rcases this with ⟨c, rfl⟩
State after:
case inl.intro
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a b✝ c✝ b c : M
hxy : b ≤ b + c
⊢ ∃! c_1, b + c = b + c_1

State before:
case inl.intro
M : Type u_1
inst✝⁵ : Zero M
inst✝⁴ : One M
inst✝³ : Add M
inst✝² : Mul M
inst✝¹ : LT M
inst✝ : M ⊧ₘ* 𝐏𝐀⁻
a b✝ c✝ b c : M
hxy : b ≤ b + c
⊢ ∃! c_1, b + c = b + c_1
Tactic:
exact ExistsUnique.intro c rfl (fun a h => (add_left_cancel h).symm)
State after:
no goals