l3lab/ntp-mathlib huggingface dataset:
theorem le_rpow_of_log_le (hx : 0 ≤ x) (hy : 0 < y) (h : Real.log x ≤ z * Real.log y) :
    x ≤ y ^ z := by
  obtain hx | rfl := hx.lt_or_eq
  · exact (le_rpow_iff_log_le hx hy).2 h
  

Proof state:
case inr
y z : ℝ
n : ℕ
hy : 0 < y
hx : 0 ≤ 0
h : log 0 ≤ z * log y
⊢ 0 ≤ y ^ z

Next tactic:
exact (Real.rpow_pos_of_pos hy z).le
theorem lt_rpow_iff_log_lt (hx : 0 < x) (hy : 0 < y) : x < y ^ z ↔ Real.log x < z * Real.log y := by
  

Proof state:
x y z : ℝ
n : ℕ
hx : 0 < x
hy : 0 < y
⊢ x < y ^ z ↔ log x < z * log y

Next tactic:
rw [← Real.log_lt_log_iff hx (Real.rpow_pos_of_pos hy z), Real.log_rpow hy]
theorem lt_rpow_of_log_lt (hx : 0 ≤ x) (hy : 0 < y) (h : Real.log x < z * Real.log y) :
    x < y ^ z := by
  

Proof state:
x y z : ℝ
n : ℕ
hx : 0 ≤ x
hy : 0 < y
h : log x < z * log y
⊢ x < y ^ z

Next tactic:
obtain hx | rfl := hx.lt_or_eq
theorem lt_rpow_of_log_lt (hx : 0 ≤ x) (hy : 0 < y) (h : Real.log x < z * Real.log y) :
    x < y ^ z := by
  obtain hx | rfl := hx.lt_or_eq
  · 

Proof state:
case inl
x y z : ℝ
n : ℕ
hx✝ : 0 ≤ x
hy : 0 < y
h : log x < z * log y
hx : 0 < x
⊢ x < y ^ z

Next tactic:
exact (lt_rpow_iff_log_lt hx hy).2 h
theorem lt_rpow_of_log_lt (hx : 0 ≤ x) (hy : 0 < y) (h : Real.log x < z * Real.log y) :
    x < y ^ z := by
  obtain hx | rfl := hx.lt_or_eq
  · exact (lt_rpow_iff_log_lt hx hy).2 h
  

Proof state:
case inr
y z : ℝ
n : ℕ
hy : 0 < y
hx : 0 ≤ 0
h : log 0 < z * log y
⊢ 0 < y ^ z

Next tactic:
exact Real.rpow_pos_of_pos hy z
theorem rpow_le_one_iff_of_pos (hx : 0 < x) : x ^ y ≤ 1 ↔ 1 ≤ x ∧ y ≤ 0 ∨ x ≤ 1 ∧ 0 ≤ y := by
  

Proof state:
x y z : ℝ
n : ℕ
hx : 0 < x
⊢ x ^ y ≤ 1 ↔ 1 ≤ x ∧ y ≤ 0 ∨ x ≤ 1 ∧ 0 ≤ y

Next tactic:
rw [rpow_def_of_pos hx, exp_le_one_iff, mul_nonpos_iff, log_nonneg_iff hx, log_nonpos_iff hx]
/-- Bound for `|log x * x ^ t|` in the interval `(0, 1]`, for positive real `t`. -/
theorem abs_log_mul_self_rpow_lt (x t : ℝ) (h1 : 0 < x) (h2 : x ≤ 1) (ht : 0 < t) :
    |log x * x ^ t| < 1 / t := by
  

Proof state:
x✝ y z : ℝ
n : ℕ
x t : ℝ
h1 : 0 < x
h2 : x ≤ 1
ht : 0 < t
⊢ |log x * x ^ t| < 1 / t

Next tactic:
rw [lt_div_iff ht]
/-- Bound for `|log x * x ^ t|` in the interval `(0, 1]`, for positive real `t`. -/
theorem abs_log_mul_self_rpow_lt (x t : ℝ) (h1 : 0 < x) (h2 : x ≤ 1) (ht : 0 < t) :
    |log x * x ^ t| < 1 / t := by
  rw [lt_div_iff ht]
  

Proof state:
x✝ y z : ℝ
n : ℕ
x t : ℝ
h1 : 0 < x
h2 : x ≤ 1
ht : 0 < t
⊢ |log x * x ^ t| * t < 1

Next tactic:
have := abs_log_mul_self_lt (x ^ t) (rpow_pos_of_pos h1 t) (rpow_le_one h1.le h2 ht.le)
/-- Bound for `|log x * x ^ t|` in the interval `(0, 1]`, for positive real `t`. -/
theorem abs_log_mul_self_rpow_lt (x t : ℝ) (h1 : 0 < x) (h2 : x ≤ 1) (ht : 0 < t) :
    |log x * x ^ t| < 1 / t := by
  rw [lt_div_iff ht]
  have := abs_log_mul_self_lt (x ^ t) (rpow_pos_of_pos h1 t) (rpow_le_one h1.le h2 ht.le)
  

Proof state:
x✝ y z : ℝ
n : ℕ
x t : ℝ
h1 : 0 < x
h2 : x ≤ 1
ht : 0 < t
this : |log (x ^ t) * x ^ t| < 1
⊢ |log x * x ^ t| * t < 1

Next tactic:
rwa [log_rpow h1, mul_assoc, abs_mul, abs_of_pos ht, mul_comm] at this
lemma strictMono_rpow_of_base_gt_one {b : ℝ} (hb : 1 < b) :
    StrictMono (rpow b) := by
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb : 1 < b
⊢ StrictMono (rpow b)

Next tactic:
show StrictMono (fun (x:ℝ) => b ^ x)
lemma strictMono_rpow_of_base_gt_one {b : ℝ} (hb : 1 < b) :
    StrictMono (rpow b) := by
  show StrictMono (fun (x:ℝ) => b ^ x)
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb : 1 < b
⊢ StrictMono fun x => b ^ x

Next tactic:
simp_rw [Real.rpow_def_of_pos (zero_lt_one.trans hb)]
lemma strictMono_rpow_of_base_gt_one {b : ℝ} (hb : 1 < b) :
    StrictMono (rpow b) := by
  show StrictMono (fun (x:ℝ) => b ^ x)
  simp_rw [Real.rpow_def_of_pos (zero_lt_one.trans hb)]
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb : 1 < b
⊢ StrictMono fun x => rexp (log b * x)

Next tactic:
exact exp_strictMono.comp <| StrictMono.const_mul strictMono_id <| Real.log_pos hb
lemma monotone_rpow_of_base_ge_one {b : ℝ} (hb : 1 ≤ b) :
    Monotone (rpow b) := by
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb : 1 ≤ b
⊢ Monotone (rpow b)

Next tactic:
rcases lt_or_eq_of_le hb with hb | rfl
lemma monotone_rpow_of_base_ge_one {b : ℝ} (hb : 1 ≤ b) :
    Monotone (rpow b) := by
  rcases lt_or_eq_of_le hb with hb | rfl
  

Proof state:
case inl
x y z : ℝ
n : ℕ
b : ℝ
hb✝ : 1 ≤ b
hb : 1 < b
⊢ Monotone (rpow b)
case inr x y z : ℝ n : ℕ hb : 1 ≤ 1 ⊢ Monotone (rpow 1)

Next tactic:
case inl => exact (strictMono_rpow_of_base_gt_one hb).monotone
lemma monotone_rpow_of_base_ge_one {b : ℝ} (hb : 1 ≤ b) :
    Monotone (rpow b) := by
  rcases lt_or_eq_of_le hb with hb | rfl
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb✝ : 1 ≤ b
hb : 1 < b
⊢ Monotone (rpow b)

Next tactic:
case inl => exact (strictMono_rpow_of_base_gt_one hb).monotone
lemma monotone_rpow_of_base_ge_one {b : ℝ} (hb : 1 ≤ b) :
    Monotone (rpow b) := by
  rcases lt_or_eq_of_le hb with hb | rfl
  case inl => 

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb✝ : 1 ≤ b
hb : 1 < b
⊢ Monotone (rpow b)

Next tactic:
exact (strictMono_rpow_of_base_gt_one hb).monotone
lemma monotone_rpow_of_base_ge_one {b : ℝ} (hb : 1 ≤ b) :
    Monotone (rpow b) := by
  rcases lt_or_eq_of_le hb with hb | rfl
  case inl => exact (strictMono_rpow_of_base_gt_one hb).monotone
  

Proof state:
case inr
x y z : ℝ
n : ℕ
hb : 1 ≤ 1
⊢ Monotone (rpow 1)

Next tactic:
case inr => intro _ _ _; simp
lemma monotone_rpow_of_base_ge_one {b : ℝ} (hb : 1 ≤ b) :
    Monotone (rpow b) := by
  rcases lt_or_eq_of_le hb with hb | rfl
  case inl => exact (strictMono_rpow_of_base_gt_one hb).monotone
  

Proof state:
x y z : ℝ
n : ℕ
hb : 1 ≤ 1
⊢ Monotone (rpow 1)

Next tactic:
case inr => intro _ _ _; simp
lemma monotone_rpow_of_base_ge_one {b : ℝ} (hb : 1 ≤ b) :
    Monotone (rpow b) := by
  rcases lt_or_eq_of_le hb with hb | rfl
  case inl => exact (strictMono_rpow_of_base_gt_one hb).monotone
  case inr => 

Proof state:
x y z : ℝ
n : ℕ
hb : 1 ≤ 1
⊢ Monotone (rpow 1)

Next tactic:
intro _ _ _
lemma monotone_rpow_of_base_ge_one {b : ℝ} (hb : 1 ≤ b) :
    Monotone (rpow b) := by
  rcases lt_or_eq_of_le hb with hb | rfl
  case inl => exact (strictMono_rpow_of_base_gt_one hb).monotone
  case inr => intro _ _ _; 

Proof state:
x y z : ℝ
n : ℕ
hb : 1 ≤ 1
a✝¹ b✝ : ℝ
a✝ : a✝¹ ≤ b✝
⊢ rpow 1 a✝¹ ≤ rpow 1 b✝

Next tactic:
simp
lemma strictAnti_rpow_of_base_lt_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b < 1) :
    StrictAnti (rpow b) := by
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb₀ : 0 < b
hb₁ : b < 1
⊢ StrictAnti (rpow b)

Next tactic:
show StrictAnti (fun (x:ℝ) => b ^ x)
lemma strictAnti_rpow_of_base_lt_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b < 1) :
    StrictAnti (rpow b) := by
  show StrictAnti (fun (x:ℝ) => b ^ x)
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb₀ : 0 < b
hb₁ : b < 1
⊢ StrictAnti fun x => b ^ x

Next tactic:
simp_rw [Real.rpow_def_of_pos hb₀]
lemma strictAnti_rpow_of_base_lt_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b < 1) :
    StrictAnti (rpow b) := by
  show StrictAnti (fun (x:ℝ) => b ^ x)
  simp_rw [Real.rpow_def_of_pos hb₀]
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb₀ : 0 < b
hb₁ : b < 1
⊢ StrictAnti fun x => rexp (log b * x)

Next tactic:
exact exp_strictMono.comp_strictAnti <| StrictMono.const_mul_of_neg strictMono_id
      <| Real.log_neg hb₀ hb₁
lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
    Antitone (rpow b) := by
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb₀ : 0 < b
hb₁ : b ≤ 1
⊢ Antitone (rpow b)

Next tactic:
rcases lt_or_eq_of_le hb₁ with hb₁ | rfl
lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
    Antitone (rpow b) := by
  rcases lt_or_eq_of_le hb₁ with hb₁ | rfl
  

Proof state:
case inl
x y z : ℝ
n : ℕ
b : ℝ
hb₀ : 0 < b
hb₁✝ : b ≤ 1
hb₁ : b < 1
⊢ Antitone (rpow b)
case inr x y z : ℝ n : ℕ hb₀ : 0 < 1 hb₁ : 1 ≤ 1 ⊢ Antitone (rpow 1)

Next tactic:
case inl => exact (strictAnti_rpow_of_base_lt_one hb₀ hb₁).antitone
lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
    Antitone (rpow b) := by
  rcases lt_or_eq_of_le hb₁ with hb₁ | rfl
  

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb₀ : 0 < b
hb₁✝ : b ≤ 1
hb₁ : b < 1
⊢ Antitone (rpow b)

Next tactic:
case inl => exact (strictAnti_rpow_of_base_lt_one hb₀ hb₁).antitone
lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
    Antitone (rpow b) := by
  rcases lt_or_eq_of_le hb₁ with hb₁ | rfl
  case inl => 

Proof state:
x y z : ℝ
n : ℕ
b : ℝ
hb₀ : 0 < b
hb₁✝ : b ≤ 1
hb₁ : b < 1
⊢ Antitone (rpow b)

Next tactic:
exact (strictAnti_rpow_of_base_lt_one hb₀ hb₁).antitone
lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
    Antitone (rpow b) := by
  rcases lt_or_eq_of_le hb₁ with hb₁ | rfl
  case inl => exact (strictAnti_rpow_of_base_lt_one hb₀ hb₁).antitone
  

Proof state:
case inr
x y z : ℝ
n : ℕ
hb₀ : 0 < 1
hb₁ : 1 ≤ 1
⊢ Antitone (rpow 1)

Next tactic:
case inr => intro _ _ _; simp
lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
    Antitone (rpow b) := by
  rcases lt_or_eq_of_le hb₁ with hb₁ | rfl
  case inl => exact (strictAnti_rpow_of_base_lt_one hb₀ hb₁).antitone
  

Proof state:
x y z : ℝ
n : ℕ
hb₀ : 0 < 1
hb₁ : 1 ≤ 1
⊢ Antitone (rpow 1)

Next tactic:
case inr => intro _ _ _; simp
lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
    Antitone (rpow b) := by
  rcases lt_or_eq_of_le hb₁ with hb₁ | rfl
  case inl => exact (strictAnti_rpow_of_base_lt_one hb₀ hb₁).antitone
  case inr => 

Proof state:
x y z : ℝ
n : ℕ
hb₀ : 0 < 1
hb₁ : 1 ≤ 1
⊢ Antitone (rpow 1)

Next tactic:
intro _ _ _
lemma antitone_rpow_of_base_le_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b ≤ 1) :
    Antitone (rpow b) := by
  rcases lt_or_eq_of_le hb₁ with hb₁ | rfl
  case inl => exact (strictAnti_rpow_of_base_lt_one hb₀ hb₁).antitone
  case inr => intro _ _ _; 

Proof state:
x y z : ℝ
n : ℕ
hb₀ : 0 < 1
hb₁ : 1 ≤ 1
a✝¹ b✝ : ℝ
a✝ : a✝¹ ≤ b✝
⊢ rpow 1 b✝ ≤ rpow 1 a✝¹

Next tactic:
simp
theorem sqrt_eq_rpow (x : ℝ) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  

Proof state:
z x✝ y x : ℝ
⊢ sqrt x = x ^ (1 / 2)

Next tactic:
obtain h | h := le_or_lt 0 x
theorem sqrt_eq_rpow (x : ℝ) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  obtain h | h := le_or_lt 0 x
  · 

Proof state:
case inl
z x✝ y x : ℝ
h : 0 ≤ x
⊢ sqrt x = x ^ (1 / 2)

Next tactic:
rw [← mul_self_inj_of_nonneg (sqrt_nonneg _) (rpow_nonneg_of_nonneg h _), mul_self_sqrt h, ← sq,
      ← rpow_nat_cast, ← rpow_mul h]
theorem sqrt_eq_rpow (x : ℝ) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  obtain h | h := le_or_lt 0 x
  · rw [← mul_self_inj_of_nonneg (sqrt_nonneg _) (rpow_nonneg_of_nonneg h _), mul_self_sqrt h, ← sq,
      ← rpow_nat_cast, ← rpow_mul h]
    

Proof state:
case inl
z x✝ y x : ℝ
h : 0 ≤ x
⊢ x = x ^ (1 / 2 * ↑2)

Next tactic:
norm_num
theorem sqrt_eq_rpow (x : ℝ) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  obtain h | h := le_or_lt 0 x
  · rw [← mul_self_inj_of_nonneg (sqrt_nonneg _) (rpow_nonneg_of_nonneg h _), mul_self_sqrt h, ← sq,
      ← rpow_nat_cast, ← rpow_mul h]
    norm_num
  · 

Proof state:
case inr
z x✝ y x : ℝ
h : x < 0
⊢ sqrt x = x ^ (1 / 2)

Next tactic:
have : 1 / (2 : ℝ) * π = π / (2 : ℝ) := by ring
theorem sqrt_eq_rpow (x : ℝ) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  obtain h | h := le_or_lt 0 x
  · rw [← mul_self_inj_of_nonneg (sqrt_nonneg _) (rpow_nonneg_of_nonneg h _), mul_self_sqrt h, ← sq,
      ← rpow_nat_cast, ← rpow_mul h]
    norm_num
  · have : 1 / (2 : ℝ) * π = π / (2 : ℝ) := by 

Proof state:
z x✝ y x : ℝ
h : x < 0
⊢ 1 / 2 * π = π / 2

Next tactic:
ring
theorem sqrt_eq_rpow (x : ℝ) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  obtain h | h := le_or_lt 0 x
  · rw [← mul_self_inj_of_nonneg (sqrt_nonneg _) (rpow_nonneg_of_nonneg h _), mul_self_sqrt h, ← sq,
      ← rpow_nat_cast, ← rpow_mul h]
    norm_num
  · have : 1 / (2 : ℝ) * π = π / (2 : ℝ) := by ring
    

Proof state:
case inr
z x✝ y x : ℝ
h : x < 0
this : 1 / 2 * π = π / 2
⊢ sqrt x = x ^ (1 / 2)

Next tactic:
rw [sqrt_eq_zero_of_nonpos h.le, rpow_def_of_neg h, this, cos_pi_div_two, mul_zero]
theorem rpow_div_two_eq_sqrt {x : ℝ} (r : ℝ) (hx : 0 ≤ x) : x ^ (r / 2) = sqrt x ^ r := by
  

Proof state:
z x✝ y x r : ℝ
hx : 0 ≤ x
⊢ x ^ (r / 2) = sqrt x ^ r

Next tactic:
rw [sqrt_eq_rpow, ← rpow_mul hx]
theorem rpow_div_two_eq_sqrt {x : ℝ} (r : ℝ) (hx : 0 ≤ x) : x ^ (r / 2) = sqrt x ^ r := by
  rw [sqrt_eq_rpow, ← rpow_mul hx]
  

Proof state:
z x✝ y x r : ℝ
hx : 0 ≤ x
⊢ x ^ (r / 2) = x ^ (1 / 2 * r)

Next tactic:
congr
theorem rpow_div_two_eq_sqrt {x : ℝ} (r : ℝ) (hx : 0 ≤ x) : x ^ (r / 2) = sqrt x ^ r := by
  rw [sqrt_eq_rpow, ← rpow_mul hx]
  congr
  

Proof state:
case e_a
z x✝ y x r : ℝ
hx : 0 ≤ x
⊢ r / 2 = 1 / 2 * r

Next tactic:
ring
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  

Proof state:
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  

Proof state:
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
  

Proof state:
case intro.intro
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
q : ℚ
hxq : max 0 x ^ (↑n)⁻¹ < ↑q
hqy : ↑q < y ^ (↑n)⁻¹
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
  have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
  

Proof state:
case intro.intro
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
q : ℚ
hxq : max 0 x ^ (↑n)⁻¹ < ↑q
hqy : ↑q < y ^ (↑n)⁻¹
this : 0 ≤ max 0 x ^ (↑n)⁻¹
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
have hq := this.trans_lt hxq
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
  have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
  have hq := this.trans_lt hxq
  

Proof state:
case intro.intro
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
q : ℚ
hxq : max 0 x ^ (↑n)⁻¹ < ↑q
hqy : ↑q < y ^ (↑n)⁻¹
this : 0 ≤ max 0 x ^ (↑n)⁻¹
hq : 0 < ↑q
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
replace hxq := rpow_lt_rpow this hxq hn'
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
  have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
  have hq := this.trans_lt hxq
  replace hxq := rpow_lt_rpow this hxq hn'
  

Proof state:
case intro.intro
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
q : ℚ
hqy : ↑q < y ^ (↑n)⁻¹
this : 0 ≤ max 0 x ^ (↑n)⁻¹
hq : 0 < ↑q
hxq : (max 0 x ^ (↑n)⁻¹) ^ ↑n < ↑q ^ ↑n
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
replace hqy := rpow_lt_rpow hq.le hqy hn'
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
  have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
  have hq := this.trans_lt hxq
  replace hxq := rpow_lt_rpow this hxq hn'
  replace hqy := rpow_lt_rpow hq.le hqy hn'
  

Proof state:
case intro.intro
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
q : ℚ
this : 0 ≤ max 0 x ^ (↑n)⁻¹
hq : 0 < ↑q
hxq : (max 0 x ^ (↑n)⁻¹) ^ ↑n < ↑q ^ ↑n
hqy : ↑q ^ ↑n < (y ^ (↑n)⁻¹) ^ ↑n
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
rw [rpow_nat_cast, rpow_nat_cast, rpow_inv_natCast_pow _ hn] at hxq hqy
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
  have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
  have hq := this.trans_lt hxq
  replace hxq := rpow_lt_rpow this hxq hn'
  replace hqy := rpow_lt_rpow hq.le hqy hn'
  rw [rpow_nat_cast, rpow_nat_cast, rpow_inv_natCast_pow _ hn] at hxq hqy
  · 

Proof state:
case intro.intro
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
q : ℚ
this : 0 ≤ max 0 x ^ (↑n)⁻¹
hq : 0 < ↑q
hxq : max 0 x < ↑q ^ n
hqy : ↑q ^ n < y
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
exact ⟨q, mod_cast hq, (le_max_right _ _).trans_lt hxq, hqy⟩
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
  have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
  have hq := this.trans_lt hxq
  replace hxq := rpow_lt_rpow this hxq hn'
  replace hqy := rpow_lt_rpow hq.le hqy hn'
  rw [rpow_nat_cast, rpow_nat_cast, rpow_inv_natCast_pow _ hn] at hxq hqy
  · exact ⟨q, mod_cast hq, (le_max_right _ _).trans_lt hxq, hqy⟩
  · 

Proof state:
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
q : ℚ
this : 0 ≤ max 0 x ^ (↑n)⁻¹
hq : 0 < ↑q
hxq : max 0 x < ↑q ^ n
hqy : ↑q ^ n < (y ^ (↑n)⁻¹) ^ n
⊢ 0 ≤ y

Next tactic:
exact hy.le
theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y := by
  have hn' : 0 < (n : ℝ) := mod_cast hn.bot_lt
  obtain ⟨q, hxq, hqy⟩ :=
    exists_rat_btwn (rpow_lt_rpow (le_max_left 0 x) (max_lt hy h) <| inv_pos.mpr hn')
  have := rpow_nonneg_of_nonneg (le_max_left 0 x) n⁻¹
  have hq := this.trans_lt hxq
  replace hxq := rpow_lt_rpow this hxq hn'
  replace hqy := rpow_lt_rpow hq.le hqy hn'
  rw [rpow_nat_cast, rpow_nat_cast, rpow_inv_natCast_pow _ hn] at hxq hqy
  · exact ⟨q, mod_cast hq, (le_max_right _ _).trans_lt hxq, hqy⟩
  · exact hy.le
  · 

Proof state:
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℝ
h : x < y
hy : 0 < y
hn' : 0 < ↑n
q : ℚ
this : 0 ≤ max 0 x ^ (↑n)⁻¹
hq : 0 < ↑q
hxq : (max 0 x ^ (↑n)⁻¹) ^ n < ↑q ^ n
hqy : ↑q ^ n < (y ^ (↑n)⁻¹) ^ n
⊢ 0 ≤ max 0 x

Next tactic:
exact le_max_left _ _
theorem exists_rat_pow_btwn_rat (hn : n ≠ 0) {x y : ℚ} (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < q ^ n ∧ q ^ n < y := by
  

Proof state:
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℚ
h : x < y
hy : 0 < y
⊢ ∃ q, 0 < q ∧ x < q ^ n ∧ q ^ n < y

Next tactic:
apply_mod_cast exists_rat_pow_btwn_rat_aux hn x y
theorem exists_rat_pow_btwn_rat (hn : n ≠ 0) {x y : ℚ} (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < q ^ n ∧ q ^ n < y := by
  apply_mod_cast exists_rat_pow_btwn_rat_aux hn x y <;> 

Proof state:
case a
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℚ
h : x < y
hy : 0 < y
⊢ x < y

Next tactic:
assumption
theorem exists_rat_pow_btwn_rat (hn : n ≠ 0) {x y : ℚ} (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < q ^ n ∧ q ^ n < y := by
  apply_mod_cast exists_rat_pow_btwn_rat_aux hn x y <;> 

Proof state:
case a
z x✝ y✝ : ℝ
n : ℕ
hn : n ≠ 0
x y : ℚ
h : x < y
hy : 0 < y
⊢ 0 < y

Next tactic:
assumption
/-- There is a rational power between any two positive elements of an archimedean ordered field. -/
theorem exists_rat_pow_btwn {α : Type*} [LinearOrderedField α] [Archimedean α] (hn : n ≠ 0)
    {x y : α} (h : x < y) (hy : 0 < y) : ∃ q : ℚ, 0 < q ∧ x < (q : α) ^ n ∧ (q : α) ^ n < y := by
  

Proof state:
z x✝ y✝ : ℝ
n : ℕ
α : Type u_1
inst✝¹ : LinearOrderedField α
inst✝ : Archimedean α
hn : n ≠ 0
x y : α
h : x < y
hy : 0 < y
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
obtain ⟨q₂, hx₂, hy₂⟩ := exists_rat_btwn (max_lt h hy)
/-- There is a rational power between any two positive elements of an archimedean ordered field. -/
theorem exists_rat_pow_btwn {α : Type*} [LinearOrderedField α] [Archimedean α] (hn : n ≠ 0)
    {x y : α} (h : x < y) (hy : 0 < y) : ∃ q : ℚ, 0 < q ∧ x < (q : α) ^ n ∧ (q : α) ^ n < y := by
  obtain ⟨q₂, hx₂, hy₂⟩ := exists_rat_btwn (max_lt h hy)
  

Proof state:
case intro.intro
z x✝ y✝ : ℝ
n : ℕ
α : Type u_1
inst✝¹ : LinearOrderedField α
inst✝ : Archimedean α
hn : n ≠ 0
x y : α
h : x < y
hy : 0 < y
q₂ : ℚ
hx₂ : max x 0 < ↑q₂
hy₂ : ↑q₂ < y
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
obtain ⟨q₁, hx₁, hq₁₂⟩ := exists_rat_btwn hx₂
/-- There is a rational power between any two positive elements of an archimedean ordered field. -/
theorem exists_rat_pow_btwn {α : Type*} [LinearOrderedField α] [Archimedean α] (hn : n ≠ 0)
    {x y : α} (h : x < y) (hy : 0 < y) : ∃ q : ℚ, 0 < q ∧ x < (q : α) ^ n ∧ (q : α) ^ n < y := by
  obtain ⟨q₂, hx₂, hy₂⟩ := exists_rat_btwn (max_lt h hy)
  obtain ⟨q₁, hx₁, hq₁₂⟩ := exists_rat_btwn hx₂
  

Proof state:
case intro.intro.intro.intro
z x✝ y✝ : ℝ
n : ℕ
α : Type u_1
inst✝¹ : LinearOrderedField α
inst✝ : Archimedean α
hn : n ≠ 0
x y : α
h : x < y
hy : 0 < y
q₂ : ℚ
hx₂ : max x 0 < ↑q₂
hy₂ : ↑q₂ < y
q₁ : ℚ
hx₁ : max x 0 < ↑q₁
hq₁₂ : ↑q₁ < ↑q₂
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
have : (0 : α) < q₂ := (le_max_right _ _).trans_lt hx₂
/-- There is a rational power between any two positive elements of an archimedean ordered field. -/
theorem exists_rat_pow_btwn {α : Type*} [LinearOrderedField α] [Archimedean α] (hn : n ≠ 0)
    {x y : α} (h : x < y) (hy : 0 < y) : ∃ q : ℚ, 0 < q ∧ x < (q : α) ^ n ∧ (q : α) ^ n < y := by
  obtain ⟨q₂, hx₂, hy₂⟩ := exists_rat_btwn (max_lt h hy)
  obtain ⟨q₁, hx₁, hq₁₂⟩ := exists_rat_btwn hx₂
  have : (0 : α) < q₂ := (le_max_right _ _).trans_lt hx₂
  

Proof state:
case intro.intro.intro.intro
z x✝ y✝ : ℝ
n : ℕ
α : Type u_1
inst✝¹ : LinearOrderedField α
inst✝ : Archimedean α
hn : n ≠ 0
x y : α
h : x < y
hy : 0 < y
q₂ : ℚ
hx₂ : max x 0 < ↑q₂
hy₂ : ↑q₂ < y
q₁ : ℚ
hx₁ : max x 0 < ↑q₁
hq₁₂ : ↑q₁ < ↑q₂
this : 0 < ↑q₂
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
norm_cast at hq₁₂ this
/-- There is a rational power between any two positive elements of an archimedean ordered field. -/
theorem exists_rat_pow_btwn {α : Type*} [LinearOrderedField α] [Archimedean α] (hn : n ≠ 0)
    {x y : α} (h : x < y) (hy : 0 < y) : ∃ q : ℚ, 0 < q ∧ x < (q : α) ^ n ∧ (q : α) ^ n < y := by
  obtain ⟨q₂, hx₂, hy₂⟩ := exists_rat_btwn (max_lt h hy)
  obtain ⟨q₁, hx₁, hq₁₂⟩ := exists_rat_btwn hx₂
  have : (0 : α) < q₂ := (le_max_right _ _).trans_lt hx₂
  norm_cast at hq₁₂ this
  

Proof state:
case intro.intro.intro.intro
z x✝ y✝ : ℝ
n : ℕ
α : Type u_1
inst✝¹ : LinearOrderedField α
inst✝ : Archimedean α
hn : n ≠ 0
x y : α
h : x < y
hy : 0 < y
q₂ : ℚ
hx₂ : max x 0 < ↑q₂
hy₂ : ↑q₂ < y
q₁ : ℚ
hx₁ : max x 0 < ↑q₁
hq₁₂ : q₁ < q₂
this : 0 < q₂
⊢ ∃ q, 0 < q ∧ x < ↑q ^ n ∧ ↑q ^ n < y

Next tactic:
obtain ⟨q, hq, hq₁, hq₂⟩ := exists_rat_pow_btwn_rat hn hq₁₂ this