Theorem: Lean4Axiomatic.Rational.le_diff_upper (Lean4Axiomatic/Rational/Order.lean)

State before:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
⊢ q - p ≤ ε ↔ q ≤ p + ε
Tactic:
apply Iff.intro
State after:
case mp
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
⊢ q - p ≤ ε → q ≤ p + ε

case mpr
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
⊢ q ≤ p + ε → q - p ≤ ε

State before:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
⊢ q - p ≤ ε → q ≤ p + ε
Tactic:
case mp =>
  intro (_ : q - p ≤ ε)
  show q ≤ p + ε
  calc
    _ ≃ q              := eqv_refl
    _ ≃ q + 0          := eqv_symm add_identR
    _ ≃ q + ((-p) + p) := add_substR (eqv_symm add_inverseL)
    _ ≃ (q + (-p)) + p := eqv_symm add_assoc
    _ ≃ (q - p) + p    := add_substL (eqv_symm sub_add_neg)
    _ ≤ ε + p          := le_substL_add ‹q - p ≤ ε›
    _ ≃ p + ε          := add_comm
State after:
no goals

State before:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
⊢ q ≤ p + ε → q - p ≤ ε
Tactic:
case mpr =>
  intro (_ : q ≤ p + ε)
  show q - p ≤ ε
  calc
    _ ≃ q - p          := eqv_refl
    _ ≃ q + (-p)       := sub_add_neg
    _ ≤ (p + ε) + (-p) := le_substL_add ‹q ≤ p+ε›
    _ ≃ (ε + p) + (-p) := add_substL add_comm
    _ ≃ ε + (p + (-p)) := add_assoc
    _ ≃ ε + 0          := add_substR add_inverseR
    _ ≃ ε              := add_identR
State after:
no goals

State before:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
⊢ q - p ≤ ε → q ≤ p + ε
Tactic:
intro (_ : q - p ≤ ε)
State after:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
x✝ : q - p ≤ ε
⊢ q ≤ p + ε

State before:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
x✝ : q - p ≤ ε
⊢ q ≤ p + ε
Tactic:
calc
  _ ≃ q              := eqv_refl
  _ ≃ q + 0          := eqv_symm add_identR
  _ ≃ q + ((-p) + p) := add_substR (eqv_symm add_inverseL)
  _ ≃ (q + (-p)) + p := eqv_symm add_assoc
  _ ≃ (q - p) + p    := add_substL (eqv_symm sub_add_neg)
  _ ≤ ε + p          := le_substL_add ‹q - p ≤ ε›
  _ ≃ p + ε          := add_comm
State after:
no goals

State before:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
⊢ q ≤ p + ε → q - p ≤ ε
Tactic:
intro (_ : q ≤ p + ε)
State after:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
x✝ : q ≤ p + ε
⊢ q - p ≤ ε

State before:
ℕ ℤ ℚ : Type
inst✝¹⁰ : Natural ℕ
inst✝⁹ : Integer ℤ
inst✝⁸ : Core ℚ
inst✝⁷ : Addition ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Negation ℚ
inst✝⁴ : Sign ℚ
inst✝³ : Subtraction ℚ
inst✝² : Reciprocation ℚ
inst✝¹ : Division ℚ
inst✝ : Order ℚ
ε p q : ℚ
x✝ : q ≤ p + ε
⊢ q - p ≤ ε
Tactic:
calc
  _ ≃ q - p          := eqv_refl
  _ ≃ q + (-p)       := sub_add_neg
  _ ≤ (p + ε) + (-p) := le_substL_add ‹q ≤ p+ε›
  _ ≃ (ε + p) + (-p) := add_substL add_comm
  _ ≃ ε + (p + (-p)) := add_assoc
  _ ≃ ε + 0          := add_substR add_inverseR
  _ ≃ ε              := add_identR
State after:
no goals