internlm/Lean-Github huggingface dataset:
Theorem: eq_ratio_of_proportion
Proof state before:
case h.e'_3
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
⊢ ↑m * r = r / s * (s * ↑m)

case h.e'_4
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
⊢ ↑n * s = ↑n / ↑m * (s * ↑m)
Tactic:
all_goals (field_simp; ring)
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
case this
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
obtain ⟨q, hq⟩ := exists_rat_btwn rstu
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
have q_gt : (0:ℚ) < q := by
  exact_mod_cast
  calc (0:ℝ) ≤ r / s := by positivity
           r / s < q := hq.1
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
let m := q.den
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
have m_ne : m ≠ 0 := q.den_nz
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
let nn := q.num
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
have nn_gt : 0 < nn := Rat.num_pos_iff_pos.mpr q_gt
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
let n := nn.toNat
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
have n_nn : (n:ℤ) = nn := Int.toNat_of_nonneg (le_of_lt nn_gt)
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
⊢ ∃ n m, r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
use n, m
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
⊢ r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
⊢ r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
have : (n : ℝ) / m = q := by
  have : (nn : ℝ) / m = q := by exact_mod_cast (q.num_den)
  convert this using 2
  exact_mod_cast Int.toNat_of_nonneg (le_of_lt nn_gt)
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑n / ↑m = ↑q
⊢ r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑n / ↑m = ↑q
⊢ r / s < ↑n / ↑m ∧ ↑n / ↑m < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
rw [this]
Proof state after:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑n / ↑m = ↑q
⊢ r / s < ↑q ∧ ↑q < t / u ∧ n ≠ 0 ∧ m ≠ 0
Theorem: eq_ratio_of_proportion
Proof state before:
case this.intro
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑n / ↑m = ↑q
⊢ r / s < ↑q ∧ ↑q < t / u ∧ n ≠ 0 ∧ m ≠ 0
Tactic:
exact ⟨hq.1, hq.2, by linarith, m_ne⟩
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
⊢ 0 < q
Tactic:
exact_mod_cast
calc (0:ℝ) ≤ r / s := by positivity
         r / s < q := hq.1
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
⊢ 0 ≤ r / s
Tactic:
positivity
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
⊢ ↑n / ↑m = ↑q
Tactic:
have : (nn : ℝ) / m = q := by exact_mod_cast (q.num_den)
Proof state after:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑nn / ↑m = ↑q
⊢ ↑n / ↑m = ↑q
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑nn / ↑m = ↑q
⊢ ↑n / ↑m = ↑q
Tactic:
convert this using 2
Proof state after:
case h.e'_2.h.e'_5
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑nn / ↑m = ↑q
⊢ ↑n = ↑nn
Theorem: eq_ratio_of_proportion
Proof state before:
case h.e'_2.h.e'_5
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑nn / ↑m = ↑q
⊢ ↑n = ↑nn
Tactic:
exact_mod_cast Int.toNat_of_nonneg (le_of_lt nn_gt)
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
⊢ ↑nn / ↑m = ↑q
Tactic:
exact_mod_cast (q.num_den)
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
q : ℚ
hq : r / s < ↑q ∧ ↑q < t / u
q_gt : 0 < q
m : ℕ := q.den
m_ne : m ≠ 0
nn : ℤ := q.num
nn_gt : 0 < nn
n : ℕ := Int.toNat nn
n_nn : ↑n = nn
this : ↑n / ↑m = ↑q
⊢ n ≠ 0
Tactic:
linarith
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
⊢ ↑m ≠ 0
Tactic:
exact_mod_cast m_ne
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
⊢ ↑m * r < ↑n * s → ↑m * t < ↑n * u
Tactic:
exact_mod_cast (h m n).2.1
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
case pos.intro.intro.intro.intro.intro.refine'_2
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ False
Tactic:
suffices hh : (n:ℝ) * u < m * t
Proof state after:
case pos.intro.intro.intro.intro.intro.refine'_2
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh✝ : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
hh : ↑n * u < ↑m * t
⊢ False

case hh
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ ↑n * u < ↑m * t
Theorem: eq_ratio_of_proportion
Proof state before:
case pos.intro.intro.intro.intro.intro.refine'_2
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh✝ : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
hh : ↑n * u < ↑m * t
⊢ False
Tactic:
exact (lt_self_iff_false ((m : ℝ) * t)).mp (this.trans hh)
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
case hh
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ ↑n * u < ↑m * t
Tactic:
convert mul_lt_mul hnm_le_tu (by simp : u * m ≤ u * m) (by positivity) (by positivity) using 1
Proof state after:
case h.e'_3
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ ↑n * u = ↑n / ↑m * (u * ↑m)

case h.e'_4
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ ↑m * t = t / u * (u * ↑m)
Theorem: eq_ratio_of_proportion
Proof state before:
case h.e'_3
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ ↑n * u = ↑n / ↑m * (u * ↑m)

case h.e'_4
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ ↑m * t = t / u * (u * ↑m)
Tactic:
all_goals (field_simp; ring)
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ u * ↑m ≤ u * ↑m
Tactic:
simp
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ 0 < u * ↑m
Tactic:
positivity
Proof state after:
no goals
Theorem: eq_ratio_of_proportion
Proof state before:
r s t u : ℝ
s_ne : s ≠ 0
u_ne : u ≠ 0
hr : 0 ≤ r
hs : 0 ≤ s
ht : 0 ≤ t
hu : 0 ≤ u
h :
  ∀ (n m : ℕ),
    (↑n * r = ↑m * s → ↑n * t = ↑m * u) ∧ (↑n * r < ↑m * s → ↑n * t < ↑m * u) ∧ (↑m * s < ↑n * r → ↑m * u < ↑n * t)
hh : r / s ≠ t / u
rstu : r / s < t / u
n m : ℕ
hrs_le_nm : r / s < ↑n / ↑m
hnm_le_tu : ↑n / ↑m < t / u
n_ne : n ≠ 0
m_ne : m ≠ 0
m_ne_ℝ : ↑m ≠ 0
mrns : ↑m * r < ↑n * s → ↑m * t < ↑n * u
this : ↑m * t < ↑n * u
⊢ 0 ≤ t / u
Tactic:
positivity
Proof state after:
no goals