l3lab/ntp-mathlib huggingface dataset:
instance : NoMaxOrder (Set.Ioo x y) :=
  ⟨fun ⟨a, ha₁, ha₂⟩ => by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : DenselyOrdered α
x y : α
x✝ : ↑(Set.Ioo x y)
a : α
ha₁ : x < a
ha₂ : a < y
⊢ ∃ b, { val := a, property := (_ : x < a ∧ a < y) } < b

Next tactic:
rcases exists_between ha₂ with ⟨b, hb₁, hb₂⟩
instance : NoMaxOrder (Set.Ioo x y) :=
  ⟨fun ⟨a, ha₁, ha₂⟩ => by
    rcases exists_between ha₂ with ⟨b, hb₁, hb₂⟩
    

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : DenselyOrdered α
x y : α
x✝ : ↑(Set.Ioo x y)
a : α
ha₁ : x < a
ha₂ : a < y
b : α
hb₁ : a < b
hb₂ : b < y
⊢ ∃ b, { val := a, property := (_ : x < a ∧ a < y) } < b

Next tactic:
exact ⟨⟨b, ha₁.trans hb₁, hb₂⟩, hb₁⟩
instance : NoMaxOrder (Set.Ico x y) :=
  ⟨fun ⟨a, ha₁, ha₂⟩ => by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : DenselyOrdered α
x y : α
x✝ : ↑(Set.Ico x y)
a : α
ha₁ : x ≤ a
ha₂ : a < y
⊢ ∃ b, { val := a, property := (_ : x ≤ a ∧ a < y) } < b

Next tactic:
rcases exists_between ha₂ with ⟨b, hb₁, hb₂⟩
instance : NoMaxOrder (Set.Ico x y) :=
  ⟨fun ⟨a, ha₁, ha₂⟩ => by
    rcases exists_between ha₂ with ⟨b, hb₁, hb₂⟩
    

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : DenselyOrdered α
x y : α
x✝ : ↑(Set.Ico x y)
a : α
ha₁ : x ≤ a
ha₂ : a < y
b : α
hb₁ : a < b
hb₂ : b < y
⊢ ∃ b, { val := a, property := (_ : x ≤ a ∧ a < y) } < b

Next tactic:
exact ⟨⟨b, ha₁.trans hb₁.le, hb₂⟩, hb₁⟩
instance : NoMaxOrder (Set.Iio x) :=
  ⟨fun ⟨a, ha⟩ => by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : DenselyOrdered α
x y : α
x✝ : ↑(Set.Iio x)
a : α
ha : a ∈ Set.Iio x
⊢ ∃ b, { val := a, property := ha } < b

Next tactic:
rcases exists_between ha with ⟨b, hb₁, hb₂⟩
instance : NoMaxOrder (Set.Iio x) :=
  ⟨fun ⟨a, ha⟩ => by
    rcases exists_between ha with ⟨b, hb₁, hb₂⟩
    

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : DenselyOrdered α
x y : α
x✝ : ↑(Set.Iio x)
a : α
ha : a ∈ Set.Iio x
b : α
hb₁ : a < b
hb₂ : b < x
⊢ ∃ b, { val := a, property := ha } < b

Next tactic:
exact ⟨⟨b, hb₂⟩, hb₁⟩
theorem remainder_summable {m : ℝ} (hm : 1 < m) (k : ℕ) :
    Summable fun i : ℕ => 1 / m ^ (i + (k + 1))! := by
  

Proof state:
m : ℝ
hm : 1 < m
k : ℕ
⊢ Summable fun i => 1 / m ^ (i + (k + 1))!

Next tactic:
convert (summable_nat_add_iff (k + 1)).2 (LiouvilleNumber.summable hm)
theorem remainder_pos {m : ℝ} (hm : 1 < m) (k : ℕ) : 0 < remainder m k :=
  tsum_pos (remainder_summable hm k) (fun _ => by 

Proof state:
m : ℝ
hm : 1 < m
k x✝ : ℕ
⊢ 0 ≤ 1 / m ^ (x✝ + (k + 1))!

Next tactic:
positivity
theorem remainder_pos {m : ℝ} (hm : 1 < m) (k : ℕ) : 0 < remainder m k :=
  tsum_pos (remainder_summable hm k) (fun _ => by positivity) 0 (by 

Proof state:
m : ℝ
hm : 1 < m
k : ℕ
⊢ 0 < 1 / m ^ (0 + (k + 1))!

Next tactic:
positivity
/-- An upper estimate on the remainder. This estimate works with `m ∈ ℝ` satisfying `1 < m` and is
stronger than the estimate `LiouvilleNumber.remainder_lt` below. However, the latter estimate is
more useful for the proof. -/
theorem remainder_lt' (n : ℕ) {m : ℝ} (m1 : 1 < m) :
    remainder m n < (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) :=
  -- two useful inequalities
  have m0 : 0 < m := zero_lt_one.trans m1
  have mi : 1 / m < 1 := (div_lt_one m0).mpr m1
  -- to show the strict inequality between these series, we prove that:
  calc
    (∑' i, 1 / m ^ (i + (n + 1))!) < ∑' i, 1 / m ^ (i + (n + 1)!) :=
        -- 1. the second series dominates the first
        tsum_lt_tsum (fun b => one_div_pow_le_one_div_pow_of_le m1.le
          (b.add_factorial_succ_le_factorial_add_succ n))
        -- 2. the term with index `i = 2` of the first series is strictly smaller than
        -- the corresponding term of the second series
        (one_div_pow_strictAnti m1 (n.add_factorial_succ_lt_factorial_add_succ (i := 2) le_rfl))
        -- 3. the first series is summable
        (remainder_summable m1 n)
        -- 4. the second series is summable, since its terms grow quickly
        (summable_one_div_pow_of_le m1 fun j => le_self_add)
    -- split the sum in the exponent and massage
    _ = ∑' i : ℕ, (1 / m) ^ i * (1 / m ^ (n + 1)!) :=
    by 

Proof state:
n : ℕ
m : ℝ
m1 : 1 < m
m0 : 0 < m
mi : 1 / m < 1
⊢ ∑' (i : ℕ), 1 / m ^ (i + (n + 1)!) = ∑' (i : ℕ), (1 / m) ^ i * (1 / m ^ (n + 1)!)

Next tactic:
simp only [pow_add, one_div, mul_inv, inv_pow]
/-- An upper estimate on the remainder. This estimate works with `m ∈ ℝ` satisfying `1 < m` and is
stronger than the estimate `LiouvilleNumber.remainder_lt` below. However, the latter estimate is
more useful for the proof. -/
theorem remainder_lt' (n : ℕ) {m : ℝ} (m1 : 1 < m) :
    remainder m n < (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) :=
  -- two useful inequalities
  have m0 : 0 < m := zero_lt_one.trans m1
  have mi : 1 / m < 1 := (div_lt_one m0).mpr m1
  -- to show the strict inequality between these series, we prove that:
  calc
    (∑' i, 1 / m ^ (i + (n + 1))!) < ∑' i, 1 / m ^ (i + (n + 1)!) :=
        -- 1. the second series dominates the first
        tsum_lt_tsum (fun b => one_div_pow_le_one_div_pow_of_le m1.le
          (b.add_factorial_succ_le_factorial_add_succ n))
        -- 2. the term with index `i = 2` of the first series is strictly smaller than
        -- the corresponding term of the second series
        (one_div_pow_strictAnti m1 (n.add_factorial_succ_lt_factorial_add_succ (i := 2) le_rfl))
        -- 3. the first series is summable
        (remainder_summable m1 n)
        -- 4. the second series is summable, since its terms grow quickly
        (summable_one_div_pow_of_le m1 fun j => le_self_add)
    -- split the sum in the exponent and massage
    _ = ∑' i : ℕ, (1 / m) ^ i * (1 / m ^ (n + 1)!) :=
    by simp only [pow_add, one_div, mul_inv, inv_pow]
    -- factor the constant `(1 / m ^ (n + 1)!)` out of the series
    _ = (∑' i, (1 / m) ^ i) * (1 / m ^ (n + 1)!) := tsum_mul_right
    -- the series is the geometric series
    _ = (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) := by 

Proof state:
n : ℕ
m : ℝ
m1 : 1 < m
m0 : 0 < m
mi : 1 / m < 1
⊢ (∑' (i : ℕ), (1 / m) ^ i) * (1 / m ^ (n + 1)!) = (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!)

Next tactic:
rw [tsum_geometric_of_lt_1 (by positivity) mi]
/-- An upper estimate on the remainder. This estimate works with `m ∈ ℝ` satisfying `1 < m` and is
stronger than the estimate `LiouvilleNumber.remainder_lt` below. However, the latter estimate is
more useful for the proof. -/
theorem remainder_lt' (n : ℕ) {m : ℝ} (m1 : 1 < m) :
    remainder m n < (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) :=
  -- two useful inequalities
  have m0 : 0 < m := zero_lt_one.trans m1
  have mi : 1 / m < 1 := (div_lt_one m0).mpr m1
  -- to show the strict inequality between these series, we prove that:
  calc
    (∑' i, 1 / m ^ (i + (n + 1))!) < ∑' i, 1 / m ^ (i + (n + 1)!) :=
        -- 1. the second series dominates the first
        tsum_lt_tsum (fun b => one_div_pow_le_one_div_pow_of_le m1.le
          (b.add_factorial_succ_le_factorial_add_succ n))
        -- 2. the term with index `i = 2` of the first series is strictly smaller than
        -- the corresponding term of the second series
        (one_div_pow_strictAnti m1 (n.add_factorial_succ_lt_factorial_add_succ (i := 2) le_rfl))
        -- 3. the first series is summable
        (remainder_summable m1 n)
        -- 4. the second series is summable, since its terms grow quickly
        (summable_one_div_pow_of_le m1 fun j => le_self_add)
    -- split the sum in the exponent and massage
    _ = ∑' i : ℕ, (1 / m) ^ i * (1 / m ^ (n + 1)!) :=
    by simp only [pow_add, one_div, mul_inv, inv_pow]
    -- factor the constant `(1 / m ^ (n + 1)!)` out of the series
    _ = (∑' i, (1 / m) ^ i) * (1 / m ^ (n + 1)!) := tsum_mul_right
    -- the series is the geometric series
    _ = (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) := by rw [tsum_geometric_of_lt_1 (by 

Proof state:
n : ℕ
m : ℝ
m1 : 1 < m
m0 : 0 < m
mi : 1 / m < 1
⊢ 0 ≤ 1 / m

Next tactic:
positivity
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by 

Proof state:
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 0 ≤ 1 / m ^ (n + 1)!

Next tactic:
positivity
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      

Proof state:
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 2 / m ^ (n ! * (n + 1)) ≤ 1 / m ^ (n ! * n)

Next tactic:
apply (div_le_div_iff _ _).mpr
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      

Proof state:
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 2 * m ^ (n ! * n) ≤ 1 * m ^ (n ! * (n + 1))
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 0 < m ^ (n ! * (n + 1))
n : ℕ m : ℝ hm : 2 ≤ m ⊢ 0 < m ^ (n ! * n)

Next tactic:
conv_rhs => rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      conv_rhs => 

Proof state:
n : ℕ
m : ℝ
hm : 2 ≤ m
| 1 * m ^ (n ! * (n + 1))

Next tactic:
rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      conv_rhs => rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
      -- the second factors coincide, so we prove the inequality of the first factors*
      

Proof state:
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 2 * m ^ (n ! * n) ≤ m ^ n ! * m ^ (n ! * n)
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 0 < m ^ (n ! * (n + 1))
n : ℕ m : ℝ hm : 2 ≤ m ⊢ 0 < m ^ (n ! * n)

Next tactic:
refine' (mul_le_mul_right _).mpr _
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      conv_rhs => rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
      -- the second factors coincide, so we prove the inequality of the first factors*
      refine' (mul_le_mul_right _).mpr _
      -- solve all the inequalities `0 < m ^ ??`
      

Proof state:
case refine'_1
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 0 < m ^ (n ! * n)
case refine'_2
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 2 ≤ m ^ n !
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 0 < m ^ (n ! * (n + 1))
n : ℕ m : ℝ hm : 2 ≤ m ⊢ 0 < m ^ (n ! * n)

Next tactic:
any_goals exact pow_pos (zero_lt_two.trans_le hm) _
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      conv_rhs => rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
      -- the second factors coincide, so we prove the inequality of the first factors*
      refine' (mul_le_mul_right _).mpr _
      -- solve all the inequalities `0 < m ^ ??`
      any_goals 

Proof state:
case refine'_1
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 0 < m ^ (n ! * n)

Next tactic:
exact pow_pos (zero_lt_two.trans_le hm) _
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      conv_rhs => rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
      -- the second factors coincide, so we prove the inequality of the first factors*
      refine' (mul_le_mul_right _).mpr _
      -- solve all the inequalities `0 < m ^ ??`
      any_goals 

Proof state:
case refine'_2
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 2 ≤ m ^ n !

Next tactic:
exact pow_pos (zero_lt_two.trans_le hm) _
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      conv_rhs => rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
      -- the second factors coincide, so we prove the inequality of the first factors*
      refine' (mul_le_mul_right _).mpr _
      -- solve all the inequalities `0 < m ^ ??`
      any_goals 

Proof state:
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 0 < m ^ (n ! * (n + 1))

Next tactic:
exact pow_pos (zero_lt_two.trans_le hm) _
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      conv_rhs => rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
      -- the second factors coincide, so we prove the inequality of the first factors*
      refine' (mul_le_mul_right _).mpr _
      -- solve all the inequalities `0 < m ^ ??`
      any_goals 

Proof state:
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 0 < m ^ (n ! * n)

Next tactic:
exact pow_pos (zero_lt_two.trans_le hm) _
theorem aux_calc (n : ℕ) {m : ℝ} (hm : 2 ≤ m) :
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 1 / (m ^ n !) ^ n :=
  calc
    (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!) ≤ 2 * (1 / m ^ (n + 1)!) :=
      -- the second factors coincide (and are non-negative),
      -- the first factors satisfy the inequality `sub_one_div_inv_le_two`
      mul_le_mul_of_nonneg_right (sub_one_div_inv_le_two hm) (by positivity)
    _ = 2 / m ^ (n + 1)! := (mul_one_div 2 _)
    _ = 2 / m ^ (n ! * (n + 1)) := (congr_arg (2 / ·) (congr_arg (Pow.pow m) (mul_comm _ _)))
    _ ≤ 1 / m ^ (n ! * n) := by
      -- [NB: in this block, I do not follow the brace convention for subgoals -- I wait until
      -- I solve all extraneous goals at once with `exact pow_pos (zero_lt_two.trans_le hm) _`.]
      -- Clear denominators and massage*
      apply (div_le_div_iff _ _).mpr
      conv_rhs => rw [one_mul, mul_add, pow_add, mul_one, pow_mul, mul_comm, ← pow_mul]
      -- the second factors coincide, so we prove the inequality of the first factors*
      refine' (mul_le_mul_right _).mpr _
      -- solve all the inequalities `0 < m ^ ??`
      any_goals exact pow_pos (zero_lt_two.trans_le hm) _
      -- `2 ≤ m ^ n!` is a consequence of monotonicity of exponentiation at `2 ≤ m`.
      

Proof state:
case refine'_2
n : ℕ
m : ℝ
hm : 2 ≤ m
⊢ 2 ≤ m ^ n !

Next tactic:
exact _root_.trans (_root_.trans hm (pow_one _).symm.le)
        (pow_right_mono (one_le_two.trans hm) n.factorial_pos)
/-- The sum of the `k` initial terms of the Liouville number to base `m` is a ratio of natural
numbers where the denominator is `m ^ k!`. -/
theorem partialSum_eq_rat {m : ℕ} (hm : 0 < m) (k : ℕ) :
    ∃ p : ℕ, partialSum m k = p / ((m ^ k ! :) : ℝ) := by
  

Proof state:
m : ℕ
hm : 0 < m
k : ℕ
⊢ ∃ p, partialSum (↑m) k = ↑p / ↑(m ^ k !)

Next tactic:
induction' k with k h
/-- The sum of the `k` initial terms of the Liouville number to base `m` is a ratio of natural
numbers where the denominator is `m ^ k!`. -/
theorem partialSum_eq_rat {m : ℕ} (hm : 0 < m) (k : ℕ) :
    ∃ p : ℕ, partialSum m k = p / ((m ^ k ! :) : ℝ) := by
  induction' k with k h
  · 

Proof state:
case zero
m : ℕ
hm : 0 < m
⊢ ∃ p, partialSum (↑m) Nat.zero = ↑p / ↑(m ^ Nat.zero !)

Next tactic:
exact ⟨1, by rw [partialSum, range_one, sum_singleton, Nat.cast_one, Nat.factorial,
      pow_one, pow_one]⟩
/-- The sum of the `k` initial terms of the Liouville number to base `m` is a ratio of natural
numbers where the denominator is `m ^ k!`. -/
theorem partialSum_eq_rat {m : ℕ} (hm : 0 < m) (k : ℕ) :
    ∃ p : ℕ, partialSum m k = p / ((m ^ k ! :) : ℝ) := by
  induction' k with k h
  · exact ⟨1, by 

Proof state:
m : ℕ
hm : 0 < m
⊢ partialSum (↑m) Nat.zero = ↑1 / ↑(m ^ Nat.zero !)

Next tactic:
rw [partialSum, range_one, sum_singleton, Nat.cast_one, Nat.factorial,
      pow_one, pow_one]
/-- The sum of the `k` initial terms of the Liouville number to base `m` is a ratio of natural
numbers where the denominator is `m ^ k!`. -/
theorem partialSum_eq_rat {m : ℕ} (hm : 0 < m) (k : ℕ) :
    ∃ p : ℕ, partialSum m k = p / ((m ^ k ! :) : ℝ) := by
  induction' k with k h
  · exact ⟨1, by rw [partialSum, range_one, sum_singleton, Nat.cast_one, Nat.factorial,
      pow_one, pow_one]⟩
  · 

Proof state:
case succ
m : ℕ
hm : 0 < m
k : ℕ
h : ∃ p, partialSum (↑m) k = ↑p / ↑(m ^ k !)
⊢ ∃ p, partialSum (↑m) (Nat.succ k) = ↑p / ↑(m ^ (Nat.succ k)!)

Next tactic:
rcases h with ⟨p_k, h_k⟩
/-- The sum of the `k` initial terms of the Liouville number to base `m` is a ratio of natural
numbers where the denominator is `m ^ k!`. -/
theorem partialSum_eq_rat {m : ℕ} (hm : 0 < m) (k : ℕ) :
    ∃ p : ℕ, partialSum m k = p / ((m ^ k ! :) : ℝ) := by
  induction' k with k h
  · exact ⟨1, by rw [partialSum, range_one, sum_singleton, Nat.cast_one, Nat.factorial,
      pow_one, pow_one]⟩
  · rcases h with ⟨p_k, h_k⟩
    

Proof state:
case succ.intro
m : ℕ
hm : 0 < m
k p_k : ℕ
h_k : partialSum (↑m) k = ↑p_k / ↑(m ^ k !)
⊢ ∃ p, partialSum (↑m) (Nat.succ k) = ↑p / ↑(m ^ (Nat.succ k)!)

Next tactic:
use p_k * m ^ ((k + 1)! - k !) + 1
/-- The sum of the `k` initial terms of the Liouville number to base `m` is a ratio of natural
numbers where the denominator is `m ^ k!`. -/
theorem partialSum_eq_rat {m : ℕ} (hm : 0 < m) (k : ℕ) :
    ∃ p : ℕ, partialSum m k = p / ((m ^ k ! :) : ℝ) := by
  induction' k with k h
  · exact ⟨1, by rw [partialSum, range_one, sum_singleton, Nat.cast_one, Nat.factorial,
      pow_one, pow_one]⟩
  · rcases h with ⟨p_k, h_k⟩
    use p_k * m ^ ((k + 1)! - k !) + 1
    

Proof state:
case h
m : ℕ
hm : 0 < m
k p_k : ℕ
h_k : partialSum (↑m) k = ↑p_k / ↑(m ^ k !)
⊢ partialSum (↑m) (Nat.succ k) = ↑(p_k * m ^ ((k + 1)! - k !) + 1) / ↑(m ^ (Nat.succ k)!)

Next tactic:
rw [partialSum_succ, h_k, div_add_div, div_eq_div_iff, add_mul]