Theorem: LO.FirstOrder.Arith.Model.eq_mul_div_add_of_pos (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 b : M
hb : 0 < b
⊢ ∃ r < b, a = b * (a / b) + r
Tactic:
let r := a - b * (a / b)
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 b : M
hb : 0 < b
r : M := a - b * (a / b)
⊢ ∃ r < b, a = b * (a / b) + r

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
⊢ ∃ r < b, a = b * (a / b) + r
Tactic:
have e : a = b * (a / b) + r := by simp [add_tsub_self_of_le (mul_div_le_pos a hb)]
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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
⊢ ∃ r < b, a = b * (a / b) + r

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
⊢ ∃ r < b, a = b * (a / b) + r
Tactic:
exact ⟨r, by
  by_contra A
  have hyv : b ≤ r := by simpa using A
  have : a < a := by calc
        a < b * (a / b + 1) := lt_mul_div_succ a hb
        _ ≤ b * (a / b) + r := by simpa [mul_add] using hyv
        _ = a               := e.symm
  simp at this, e⟩
State after:
no goals

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
⊢ a = b * (a / b) + r
Tactic:
simp [add_tsub_self_of_le (mul_div_le_pos a hb)]
State after:
no goals

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
⊢ r < b
Tactic:
by_contra A
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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
⊢ False

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
⊢ False
Tactic:
have hyv : b ≤ r := by simpa using A
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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
hyv : b ≤ r
⊢ False

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
hyv : b ≤ r
⊢ False
Tactic:
have : a < a := by calc
      a < b * (a / b + 1) := lt_mul_div_succ a hb
      _ ≤ b * (a / b) + r := by simpa [mul_add] using hyv
      _ = a               := e.symm
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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
hyv : b ≤ r
this : a < a
⊢ False

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
hyv : b ≤ r
this : a < a
⊢ False
Tactic:
simp at this
State after:
no goals

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
⊢ b ≤ r
Tactic:
simpa using A
State after:
no goals

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
hyv : b ≤ r
⊢ a < a
Tactic:
calc
a < b * (a / b + 1) := lt_mul_div_succ a hb
_ ≤ b * (a / b) + r := by simpa [mul_add] using hyv
_ = a               := e.symm
State after:
no goals

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 b : M
hb : 0 < b
r : M := a - b * (a / b)
e : a = b * (a / b) + r
A : ¬r < b
hyv : b ≤ r
⊢ b * (a / b + 1) ≤ b * (a / b) + r
Tactic:
simpa [mul_add] using hyv
State after:
no goals