internlm/Lean-Github huggingface dataset:
Theorem: Lean4Axiomatic.Rational.order_iff_min_max
Proof 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 r : ℚ
x✝ : p ≤ q
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
have : p ≃ min p q := eqv_symm (min_le.mpr ‹p ≤ q›)
Proof 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 r : ℚ
x✝ : p ≤ q
this : p ≃ Ordered.min p q
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Theorem: Lean4Axiomatic.Rational.order_iff_min_max
Proof 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 r : ℚ
x✝ : p ≤ q
this : p ≃ Ordered.min p q
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
have : q ≃ max p q := eqv_symm (max_le.mpr ‹p ≤ q›)
Proof 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 r : ℚ
x✝ : p ≤ q
this✝ : p ≃ Ordered.min p q
this : q ≃ Ordered.max p q
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Theorem: Lean4Axiomatic.Rational.order_iff_min_max
Proof 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 r : ℚ
x✝ : p ≤ q
this✝ : p ≃ Ordered.min p q
this : q ≃ Ordered.max p q
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
have p_min : p ≤ r ↔ min p q ≤ r := iff_subst_eqv le_substL_eqv ‹p ≃ min p q›
Proof 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 r : ℚ
x✝ : p ≤ q
this✝ : p ≃ Ordered.min p q
this : q ≃ Ordered.max p q
p_min : p ≤ r ↔ Ordered.min p q ≤ r
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Theorem: Lean4Axiomatic.Rational.order_iff_min_max
Proof 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 r : ℚ
x✝ : p ≤ q
this✝ : p ≃ Ordered.min p q
this : q ≃ Ordered.max p q
p_min : p ≤ r ↔ Ordered.min p q ≤ r
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
have q_max : r ≤ q ↔ r ≤ max p q := iff_subst_eqv le_substR_eqv ‹q ≃ max p q›
Proof 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 r : ℚ
x✝ : p ≤ q
this✝ : p ≃ Ordered.min p q
this : q ≃ Ordered.max p q
p_min : p ≤ r ↔ Ordered.min p q ≤ r
q_max : r ≤ q ↔ r ≤ Ordered.max p q
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Theorem: Lean4Axiomatic.Rational.order_iff_min_max
Proof 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 r : ℚ
x✝ : p ≤ q
this✝ : p ≃ Ordered.min p q
this : q ≃ Ordered.max p q
p_min : p ≤ r ↔ Ordered.min p q ≤ r
q_max : r ≤ q ↔ r ≤ Ordered.max p q
⊢ p ≤ r ∧ r ≤ q ↔ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
calc
  _ ↔ p ≤ r ∧ r ≤ q             := Iff.rfl
  _ ↔ min p q ≤ r ∧ r ≤ q       := iff_subst_covar and_mapL p_min
  _ ↔ min p q ≤ r ∧ r ≤ max p q := iff_subst_covar and_mapR q_max
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.min_max_from_order
Proof 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 r : ℚ
⊢ p ≤ r ∧ r ≤ q → Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
intro (order : p ≤ r ∧ r ≤ q)
Proof 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 r : ℚ
order : p ≤ r ∧ r ≤ q
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Theorem: Lean4Axiomatic.Rational.min_max_from_order
Proof 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 r : ℚ
order : p ≤ r ∧ r ≤ q
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
have (And.intro (_ : p ≤ r) (_ : r ≤ q)) := order
Proof 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 r : ℚ
order : p ≤ r ∧ r ≤ q
left✝ : p ≤ r
right✝ : r ≤ q
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Theorem: Lean4Axiomatic.Rational.min_max_from_order
Proof 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 r : ℚ
order : p ≤ r ∧ r ≤ q
left✝ : p ≤ r
right✝ : r ≤ q
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
have : p ≤ q := le_trans ‹p ≤ r› ‹r ≤ q›
Proof 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 r : ℚ
order : p ≤ r ∧ r ≤ q
left✝ : p ≤ r
right✝ : r ≤ q
this : p ≤ q
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Theorem: Lean4Axiomatic.Rational.min_max_from_order
Proof 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 r : ℚ
order : p ≤ r ∧ r ≤ q
left✝ : p ≤ r
right✝ : r ≤ q
this : p ≤ q
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
have : min p q ≤ r ∧ r ≤ max p q := (order_iff_min_max this).mp order
Proof 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 r : ℚ
order : p ≤ r ∧ r ≤ q
left✝ : p ≤ r
right✝ : r ≤ q
this✝ : p ≤ q
this : Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Theorem: Lean4Axiomatic.Rational.min_max_from_order
Proof 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 r : ℚ
order : p ≤ r ∧ r ≤ q
left✝ : p ≤ r
right✝ : r ≤ q
this✝ : p ≤ q
this : Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
Tactic:
exact this
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.order_from_min_max
Proof 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 r : ℚ
⊢ Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q → p ≤ q → p ≤ r ∧ r ≤ q
Tactic:
intro (_ : min p q ≤ r ∧ r ≤ max p q) (_ : p ≤ q)
Proof 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 r : ℚ
x✝¹ : Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
x✝ : p ≤ q
⊢ p ≤ r ∧ r ≤ q
Theorem: Lean4Axiomatic.Rational.order_from_min_max
Proof 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 r : ℚ
x✝¹ : Ordered.min p q ≤ r ∧ r ≤ Ordered.max p q
x✝ : p ≤ q
⊢ p ≤ r ∧ r ≤ q
Tactic:
exact (order_iff_min_max ‹p ≤ q›).mpr ‹min p q ≤ r ∧ r ≤ max p q›
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.min_max_comm
Proof 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 r : ℚ
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r → Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
Tactic:
intro (And.intro (_ : min p r ≤ q) (_ : q ≤ max p r))
Proof 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 r : ℚ
left✝ : Ordered.min p r ≤ q
right✝ : q ≤ Ordered.max p r
⊢ Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
Theorem: Lean4Axiomatic.Rational.min_max_comm
Proof 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 r : ℚ
left✝ : Ordered.min p r ≤ q
right✝ : q ≤ Ordered.max p r
⊢ Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
Tactic:
have : min r p ≤ q := le_substL_eqv min_comm ‹min p r ≤ q›
Proof 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 r : ℚ
left✝ : Ordered.min p r ≤ q
right✝ : q ≤ Ordered.max p r
this : Ordered.min r p ≤ q
⊢ Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
Theorem: Lean4Axiomatic.Rational.min_max_comm
Proof 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 r : ℚ
left✝ : Ordered.min p r ≤ q
right✝ : q ≤ Ordered.max p r
this : Ordered.min r p ≤ q
⊢ Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
Tactic:
have : q ≤ max r p := le_substR_eqv max_comm ‹q ≤ max p r›
Proof 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 r : ℚ
left✝ : Ordered.min p r ≤ q
right✝ : q ≤ Ordered.max p r
this✝ : Ordered.min r p ≤ q
this : q ≤ Ordered.max r p
⊢ Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
Theorem: Lean4Axiomatic.Rational.min_max_comm
Proof 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 r : ℚ
left✝ : Ordered.min p r ≤ q
right✝ : q ≤ Ordered.max p r
this✝ : Ordered.min r p ≤ q
this : q ≤ Ordered.max r p
⊢ Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
Tactic:
exact And.intro ‹min r p ≤ q› ‹q ≤ max r p›
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
⊢ p⊣ q ⊢r ↔ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
apply Iff.intro
Proof 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 r : ℚ
⊢ p⊣ q ⊢r → Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r

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 r : ℚ
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r → p⊣ q ⊢r
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
⊢ p⊣ q ⊢r → Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
case mp =>
  intro (_ : p⊣ q ⊢r)
  show min p r ≤ q ∧ q ≤ max p r
  have : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p := between_order.mp ‹p⊣ q ⊢r›
  match this with
  | Or.inl (_ : p ≤ q ∧ q ≤ r) =>
    have : min p r ≤ q ∧ q ≤ max p r := min_max_from_order ‹p ≤ q ∧ q ≤ r›
    exact this
  | Or.inr (_ : r ≤ q ∧ q ≤ p) =>
    have : min r p ≤ q ∧ q ≤ max r p := min_max_from_order ‹r ≤ q ∧ q ≤ p›
    have : min p r ≤ q ∧ q ≤ max p r := min_max_comm this
    exact this
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r → p⊣ q ⊢r
Tactic:
case mpr =>
  intro (min_max : min p r ≤ q ∧ q ≤ max p r)
  show p⊣ q ⊢r
  have : p ≤ r ∨ r ≤ p := le_dichotomy
  have : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p :=
    match ‹p ≤ r ∨ r ≤ p› with
    | Or.inl (_ : p ≤ r) =>
      have : p ≤ q ∧ q ≤ r := order_from_min_max min_max ‹p ≤ r›
      Or.inl this
    | Or.inr (_ : r ≤ p) =>
      have : min r p ≤ q ∧ q ≤ max r p := min_max_comm min_max
      have : r ≤ q ∧ q ≤ p := order_from_min_max this ‹r ≤ p›
      Or.inr this
  have : p⊣ q ⊢r := between_order.mpr ‹p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p›
  exact this
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
⊢ p⊣ q ⊢r → Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
intro (_ : p⊣ q ⊢r)
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
have : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p := between_order.mp ‹p⊣ q ⊢r›
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
match this with
| Or.inl (_ : p ≤ q ∧ q ≤ r) =>
  have : min p r ≤ q ∧ q ≤ max p r := min_max_from_order ‹p ≤ q ∧ q ≤ r›
  exact this
| Or.inr (_ : r ≤ q ∧ q ≤ p) =>
  have : min r p ≤ q ∧ q ≤ max r p := min_max_from_order ‹r ≤ q ∧ q ≤ p›
  have : min p r ≤ q ∧ q ≤ max p r := min_max_comm this
  exact this
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
h✝ : p ≤ q ∧ q ≤ r
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
have : min p r ≤ q ∧ q ≤ max p r := min_max_from_order ‹p ≤ q ∧ q ≤ r›
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this✝ : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
h✝ : p ≤ q ∧ q ≤ r
this : Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this✝ : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
h✝ : p ≤ q ∧ q ≤ r
this : Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
exact this
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
h✝ : r ≤ q ∧ q ≤ p
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
have : min r p ≤ q ∧ q ≤ max r p := min_max_from_order ‹r ≤ q ∧ q ≤ p›
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this✝ : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
h✝ : r ≤ q ∧ q ≤ p
this : Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this✝ : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
h✝ : r ≤ q ∧ q ≤ p
this : Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
have : min p r ≤ q ∧ q ≤ max p r := min_max_comm this
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this✝¹ : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
h✝ : r ≤ q ∧ q ≤ p
this✝ : Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
this : Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
x✝ : p⊣ q ⊢r
this✝¹ : p ≤ q ∧ q ≤ r ∨ r ≤ q ∧ q ≤ p
h✝ : r ≤ q ∧ q ≤ p
this✝ : Ordered.min r p ≤ q ∧ q ≤ Ordered.max r p
this : Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
Tactic:
exact this
Proof state after:
no goals
Theorem: Lean4Axiomatic.Rational.between_min_max
Proof 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 r : ℚ
⊢ Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r → p⊣ q ⊢r
Tactic:
intro (min_max : min p r ≤ q ∧ q ≤ max p r)
Proof 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 r : ℚ
min_max : Ordered.min p r ≤ q ∧ q ≤ Ordered.max p r
⊢ p⊣ q ⊢r