Theorem: Lean4Axiomatic.Rational.abs_upper_bound (Lean4Axiomatic/Rational/Metric.lean)

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

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

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
⊢ abs p ≤ q → -q ≤ p ∧ p ≤ q
Tactic:
case mp =>
  intro (_ : abs p ≤ q)
  show -q ≤ p ∧ p ≤ q
  have : -q ≤ p := calc
    _ ≃ -q       := eqv_refl
    _ ≤ (-abs p) := le_subst_neg ‹abs p ≤ q›
    _ ≤ p        := neg_abs_le_self
  have : p ≤ q := calc
    _ ≃ p     := eqv_refl
    _ ≤ abs p := abs_ge_self
    _ ≤ q     := ‹abs p ≤ q›
  exact And.intro ‹-q ≤ p› ‹p ≤ q›
State after:
no goals

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
⊢ -q ≤ p ∧ p ≤ q → abs p ≤ q
Tactic:
case mpr =>
  intro (And.intro (_ : -q ≤ p) (_ : p ≤ q))
  show abs p ≤ q
  have : abs p ≃ p ∨ abs p ≃ -p := abs_cases
  match this with
  | Or.inl (_ : abs p ≃ p) =>
    calc
      _ ≃ abs p := eqv_refl
      _ ≃ p     := ‹abs p ≃ p›
      _ ≤ q     := ‹p ≤ q›
  | Or.inr (_ : abs p ≃ -p) =>
    calc
      _ ≃ abs p   := eqv_refl
      _ ≃ (-p)    := ‹abs p ≃ -p›
      _ ≤ (-(-q)) := le_subst_neg ‹-q ≤ p›
      _ ≃ q       := neg_involutive
State after:
no goals

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

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
x✝ : abs p ≤ q
⊢ -q ≤ p ∧ p ≤ q
Tactic:
have : -q ≤ p := calc
  _ ≃ -q       := eqv_refl
  _ ≤ (-abs p) := le_subst_neg ‹abs p ≤ q›
  _ ≤ p        := neg_abs_le_self
State after:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
x✝ : abs p ≤ q
this : -q ≤ p
⊢ -q ≤ p ∧ p ≤ q

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
x✝ : abs p ≤ q
this : -q ≤ p
⊢ -q ≤ p ∧ p ≤ q
Tactic:
have : p ≤ q := calc
  _ ≃ p     := eqv_refl
  _ ≤ abs p := abs_ge_self
  _ ≤ q     := ‹abs p ≤ q›
State after:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
x✝ : abs p ≤ q
this✝ : -q ≤ p
this : p ≤ q
⊢ -q ≤ p ∧ p ≤ q

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
x✝ : abs p ≤ q
this✝ : -q ≤ p
this : p ≤ q
⊢ -q ≤ p ∧ p ≤ q
Tactic:
exact And.intro ‹-q ≤ p› ‹p ≤ q›
State after:
no goals

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
⊢ -q ≤ p ∧ p ≤ q → abs p ≤ q
Tactic:
intro (And.intro (_ : -q ≤ p) (_ : p ≤ q))
State after:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
left✝ : -q ≤ p
right✝ : p ≤ q
⊢ abs p ≤ q

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
left✝ : -q ≤ p
right✝ : p ≤ q
⊢ abs p ≤ q
Tactic:
have : abs p ≃ p ∨ abs p ≃ -p := abs_cases
State after:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
left✝ : -q ≤ p
right✝ : p ≤ q
this : abs p ≃ p ∨ abs p ≃ -p
⊢ abs p ≤ q

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
left✝ : -q ≤ p
right✝ : p ≤ q
this : abs p ≃ p ∨ abs p ≃ -p
⊢ abs p ≤ q
Tactic:
match this with
| Or.inl (_ : abs p ≃ p) =>
  calc
    _ ≃ abs p := eqv_refl
    _ ≃ p     := ‹abs p ≃ p›
    _ ≤ q     := ‹p ≤ q›
| Or.inr (_ : abs p ≃ -p) =>
  calc
    _ ≃ abs p   := eqv_refl
    _ ≃ (-p)    := ‹abs p ≃ -p›
    _ ≤ (-(-q)) := le_subst_neg ‹-q ≤ p›
    _ ≃ q       := neg_involutive
State after:
no goals

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
left✝ : -q ≤ p
right✝ : p ≤ q
this : abs p ≃ p ∨ abs p ≃ -p
h✝ : abs p ≃ p
⊢ abs p ≤ q
Tactic:
calc
  _ ≃ abs p := eqv_refl
  _ ≃ p     := ‹abs p ≃ p›
  _ ≤ q     := ‹p ≤ q›
State after:
no goals

State before:
ℕ ℤ ℚ : Type
inst✝¹² : Natural ℕ
inst✝¹¹ : Integer ℤ
inst✝¹⁰ : Core ℚ
inst✝⁹ : Addition ℚ
inst✝⁸ : Negation ℚ
inst✝⁷ : Subtraction ℚ
inst✝⁶ : Multiplication ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Order ℚ
inst✝¹ : MinMax ℚ
inst✝ : Metric ℚ
p q : ℚ
left✝ : -q ≤ p
right✝ : p ≤ q
this : abs p ≃ p ∨ abs p ≃ -p
h✝ : abs p ≃ -p
⊢ abs p ≤ q
Tactic:
calc
  _ ≃ abs p   := eqv_refl
  _ ≃ (-p)    := ‹abs p ≃ -p›
  _ ≤ (-(-q)) := le_subst_neg ‹-q ≤ p›
  _ ≃ q       := neg_involutive
State after:
no goals