l3lab/ntp-mathlib huggingface dataset:
/-- A map between two inner product spaces is a conformal map if and only if it preserves inner
products up to a scalar factor, i.e., there exists a positive `c : ℝ` such that
`⟪f u, f v⟫ = c * ⟪u, v⟫` for all `u`, `v`. -/
theorem isConformalMap_iff (f : E →L[ℝ] F) :
    IsConformalMap f ↔ ∃ c : ℝ, 0 < c ∧ ∀ u v : E, ⟪f u, f v⟫ = c * ⟪u, v⟫ := by
  constructor
  · rintro ⟨c₁, hc₁, li, rfl⟩
    refine' ⟨c₁ * c₁, mul_self_pos.2 hc₁, fun u v => _⟩
    simp only [real_inner_smul_left, real_inner_smul_right, mul_assoc, coe_smul',
      coe_toContinuousLinearMap, Pi.smul_apply, inner_map_map]
  · rintro ⟨c₁, hc₁, huv⟩
    obtain ⟨c, hc, rfl⟩ : ∃ c : ℝ, 0 < c ∧ c₁ = c * c
    exact ⟨Real.sqrt c₁, Real.sqrt_pos.2 hc₁, (Real.mul_self_sqrt hc₁.le).symm⟩
    refine' ⟨c, hc.ne', (c⁻¹ • f : E →ₗ[ℝ] F).isometryOfInner fun u v => _, _⟩
    · simp only [real_inner_smul_left, real_inner_smul_right, huv, mul_assoc, coe_smul,
        inv_mul_cancel_left₀ hc.ne', LinearMap.smul_apply, ContinuousLinearMap.coe_coe]
    · 

Proof state:
case mpr.intro.intro.intro.intro.refine'_2
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ E
inst✝ : InnerProductSpace ℝ F
f : E →L[ℝ] F
c : ℝ
hc : 0 < c
hc₁ : 0 < c * c
huv : ∀ (u v : E), inner (f u) (f v) = c * c * inner u v
⊢ f =
    c •
      toContinuousLinearMap
        (LinearMap.isometryOfInner (c⁻¹ • ↑f) (_ : ∀ (u v : E), inner (c⁻¹ • f u) (c⁻¹ • f v) = inner u v))

Next tactic:
ext1 x
/-- A map between two inner product spaces is a conformal map if and only if it preserves inner
products up to a scalar factor, i.e., there exists a positive `c : ℝ` such that
`⟪f u, f v⟫ = c * ⟪u, v⟫` for all `u`, `v`. -/
theorem isConformalMap_iff (f : E →L[ℝ] F) :
    IsConformalMap f ↔ ∃ c : ℝ, 0 < c ∧ ∀ u v : E, ⟪f u, f v⟫ = c * ⟪u, v⟫ := by
  constructor
  · rintro ⟨c₁, hc₁, li, rfl⟩
    refine' ⟨c₁ * c₁, mul_self_pos.2 hc₁, fun u v => _⟩
    simp only [real_inner_smul_left, real_inner_smul_right, mul_assoc, coe_smul',
      coe_toContinuousLinearMap, Pi.smul_apply, inner_map_map]
  · rintro ⟨c₁, hc₁, huv⟩
    obtain ⟨c, hc, rfl⟩ : ∃ c : ℝ, 0 < c ∧ c₁ = c * c
    exact ⟨Real.sqrt c₁, Real.sqrt_pos.2 hc₁, (Real.mul_self_sqrt hc₁.le).symm⟩
    refine' ⟨c, hc.ne', (c⁻¹ • f : E →ₗ[ℝ] F).isometryOfInner fun u v => _, _⟩
    · simp only [real_inner_smul_left, real_inner_smul_right, huv, mul_assoc, coe_smul,
        inv_mul_cancel_left₀ hc.ne', LinearMap.smul_apply, ContinuousLinearMap.coe_coe]
    · ext1 x
      

Proof state:
case mpr.intro.intro.intro.intro.refine'_2.h
E : Type u_1
F : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ E
inst✝ : InnerProductSpace ℝ F
f : E →L[ℝ] F
c : ℝ
hc : 0 < c
hc₁ : 0 < c * c
huv : ∀ (u v : E), inner (f u) (f v) = c * c * inner u v
x : E
⊢ f x =
    (c •
        toContinuousLinearMap
          (LinearMap.isometryOfInner (c⁻¹ • ↑f) (_ : ∀ (u v : E), inner (c⁻¹ • f u) (c⁻¹ • f v) = inner u v)))
      x

Next tactic:
exact (smul_inv_smul₀ hc.ne' (f x)).symm
@[simp]
theorem rpow_eq_zero_iff {x : ℝ≥0} {y : ℝ} : x ^ y = 0 ↔ x = 0 ∧ y ≠ 0 := by
  

Proof state:
x : ℝ≥0
y : ℝ
⊢ x ^ y = 0 ↔ x = 0 ∧ y ≠ 0

Next tactic:
rw [← NNReal.coe_eq, coe_rpow, ← NNReal.coe_eq_zero]
@[simp]
theorem rpow_eq_zero_iff {x : ℝ≥0} {y : ℝ} : x ^ y = 0 ↔ x = 0 ∧ y ≠ 0 := by
  rw [← NNReal.coe_eq, coe_rpow, ← NNReal.coe_eq_zero]
  

Proof state:
x : ℝ≥0
y : ℝ
⊢ ↑x ^ y = ↑0 ↔ ↑x = 0 ∧ y ≠ 0

Next tactic:
exact Real.rpow_eq_zero_iff_of_nonneg x.2
theorem rpow_neg_one (x : ℝ≥0) : x ^ (-1 : ℝ) = x⁻¹ := by 

Proof state:
x : ℝ≥0
⊢ x ^ (-1) = x⁻¹

Next tactic:
simp [rpow_neg]
theorem rpow_inv_rpow_self {y : ℝ} (hy : y ≠ 0) (x : ℝ≥0) : (x ^ y) ^ (1 / y) = x := by
  

Proof state:
y : ℝ
hy : y ≠ 0
x : ℝ≥0
⊢ (x ^ y) ^ (1 / y) = x

Next tactic:
field_simp [← rpow_mul]
theorem rpow_self_rpow_inv {y : ℝ} (hy : y ≠ 0) (x : ℝ≥0) : (x ^ (1 / y)) ^ y = x := by
  

Proof state:
y : ℝ
hy : y ≠ 0
x : ℝ≥0
⊢ (x ^ (1 / y)) ^ y = x

Next tactic:
field_simp [← rpow_mul]
theorem sqrt_eq_rpow (x : ℝ≥0) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  

Proof state:
x : ℝ≥0
⊢ sqrt x = x ^ (1 / 2)

Next tactic:
refine' NNReal.eq _
theorem sqrt_eq_rpow (x : ℝ≥0) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  refine' NNReal.eq _
  

Proof state:
x : ℝ≥0
⊢ ↑(sqrt x) = ↑(x ^ (1 / 2))

Next tactic:
push_cast
theorem sqrt_eq_rpow (x : ℝ≥0) : sqrt x = x ^ (1 / (2 : ℝ)) := by
  refine' NNReal.eq _
  push_cast
  

Proof state:
x : ℝ≥0
⊢ Real.sqrt ↑x = ↑x ^ (1 / 2)

Next tactic:
exact Real.sqrt_eq_rpow x.1
@[simp, norm_cast]
theorem rpow_nat_cast (x : ℝ≥0) (n : ℕ) : x ^ (n : ℝ) = x ^ n :=
  NNReal.eq <| by 

Proof state:
x : ℝ≥0
n : ℕ
⊢ ↑(x ^ ↑n) = ↑(x ^ n)

Next tactic:
simpa only [coe_rpow, coe_pow] using Real.rpow_nat_cast x n
theorem list_prod_map_rpow' {ι} (l : List ι) (f : ι → ℝ≥0) (r : ℝ) :
    (l.map (f · ^ r)).prod = (l.map f).prod ^ r := by
  

Proof state:
ι : Type u_1
l : List ι
f : ι → ℝ≥0
r : ℝ
⊢ List.prod (List.map (fun x => f x ^ r) l) = List.prod (List.map f l) ^ r

Next tactic:
rw [← list_prod_map_rpow, List.map_map]
theorem list_prod_map_rpow' {ι} (l : List ι) (f : ι → ℝ≥0) (r : ℝ) :
    (l.map (f · ^ r)).prod = (l.map f).prod ^ r := by
  rw [← list_prod_map_rpow, List.map_map]; 

Proof state:
ι : Type u_1
l : List ι
f : ι → ℝ≥0
r : ℝ
⊢ List.prod (List.map (fun x => f x ^ r) l) = List.prod (List.map ((fun x => x ^ r) ∘ f) l)

Next tactic:
rfl
/-- `rpow` version of `List.prod_map_pow` for `Real`. -/
theorem _root_.Real.list_prod_map_rpow (l : List ℝ) (hl : ∀ x ∈ l, (0 : ℝ) ≤ x) (r : ℝ) :
    (l.map (· ^ r)).prod = l.prod ^ r := by
  

Proof state:
l : List ℝ
hl : ∀ x ∈ l, 0 ≤ x
r : ℝ
⊢ List.prod (List.map (fun x => x ^ r) l) = List.prod l ^ r

Next tactic:
lift l to List ℝ≥0 using hl
/-- `rpow` version of `List.prod_map_pow` for `Real`. -/
theorem _root_.Real.list_prod_map_rpow (l : List ℝ) (hl : ∀ x ∈ l, (0 : ℝ) ≤ x) (r : ℝ) :
    (l.map (· ^ r)).prod = l.prod ^ r := by
  lift l to List ℝ≥0 using hl
  

Proof state:
case intro
r : ℝ
l : List ℝ≥0
⊢ List.prod (List.map (fun x => x ^ r) (List.map toReal l)) = List.prod (List.map toReal l) ^ r

Next tactic:
have := congr_arg ((↑) : ℝ≥0 → ℝ) (NNReal.list_prod_map_rpow l r)
/-- `rpow` version of `List.prod_map_pow` for `Real`. -/
theorem _root_.Real.list_prod_map_rpow (l : List ℝ) (hl : ∀ x ∈ l, (0 : ℝ) ≤ x) (r : ℝ) :
    (l.map (· ^ r)).prod = l.prod ^ r := by
  lift l to List ℝ≥0 using hl
  have := congr_arg ((↑) : ℝ≥0 → ℝ) (NNReal.list_prod_map_rpow l r)
  

Proof state:
case intro
r : ℝ
l : List ℝ≥0
this : ↑(List.prod (List.map (fun x => x ^ r) l)) = ↑(List.prod l ^ r)
⊢ List.prod (List.map (fun x => x ^ r) (List.map toReal l)) = List.prod (List.map toReal l) ^ r

Next tactic:
push_cast at this
/-- `rpow` version of `List.prod_map_pow` for `Real`. -/
theorem _root_.Real.list_prod_map_rpow (l : List ℝ) (hl : ∀ x ∈ l, (0 : ℝ) ≤ x) (r : ℝ) :
    (l.map (· ^ r)).prod = l.prod ^ r := by
  lift l to List ℝ≥0 using hl
  have := congr_arg ((↑) : ℝ≥0 → ℝ) (NNReal.list_prod_map_rpow l r)
  push_cast at this
  

Proof state:
case intro
r : ℝ
l : List ℝ≥0
this : List.prod (List.map toReal (List.map (fun x => x ^ r) l)) = List.prod (List.map toReal l) ^ r
⊢ List.prod (List.map (fun x => x ^ r) (List.map toReal l)) = List.prod (List.map toReal l) ^ r

Next tactic:
rw [List.map_map] at this ⊢
/-- `rpow` version of `List.prod_map_pow` for `Real`. -/
theorem _root_.Real.list_prod_map_rpow (l : List ℝ) (hl : ∀ x ∈ l, (0 : ℝ) ≤ x) (r : ℝ) :
    (l.map (· ^ r)).prod = l.prod ^ r := by
  lift l to List ℝ≥0 using hl
  have := congr_arg ((↑) : ℝ≥0 → ℝ) (NNReal.list_prod_map_rpow l r)
  push_cast at this
  rw [List.map_map] at this ⊢
  

Proof state:
case intro
r : ℝ
l : List ℝ≥0
this : List.prod (List.map (toReal ∘ fun x => x ^ r) l) = List.prod (List.map toReal l) ^ r
⊢ List.prod (List.map ((fun x => x ^ r) ∘ toReal) l) = List.prod (List.map toReal l) ^ r

Next tactic:
exact mod_cast this
theorem _root_.Real.list_prod_map_rpow' {ι} (l : List ι) (f : ι → ℝ)
    (hl : ∀ i ∈ l, (0 : ℝ) ≤ f i) (r : ℝ) :
    (l.map (f · ^ r)).prod = (l.map f).prod ^ r := by
  

Proof state:
ι : Type u_1
l : List ι
f : ι → ℝ
hl : ∀ i ∈ l, 0 ≤ f i
r : ℝ
⊢ List.prod (List.map (fun x => f x ^ r) l) = List.prod (List.map f l) ^ r

Next tactic:
rw [← Real.list_prod_map_rpow (l.map f) _ r, List.map_map]
theorem _root_.Real.list_prod_map_rpow' {ι} (l : List ι) (f : ι → ℝ)
    (hl : ∀ i ∈ l, (0 : ℝ) ≤ f i) (r : ℝ) :
    (l.map (f · ^ r)).prod = (l.map f).prod ^ r := by
  rw [← Real.list_prod_map_rpow (l.map f) _ r, List.map_map]; 

Proof state:
ι : Type u_1
l : List ι
f : ι → ℝ
hl : ∀ i ∈ l, 0 ≤ f i
r : ℝ
⊢ List.prod (List.map (fun x => f x ^ r) l) = List.prod (List.map ((fun x => x ^ r) ∘ f) l)
ι : Type u_1 l : List ι f : ι → ℝ hl : ∀ i ∈ l, 0 ≤ f i r : ℝ ⊢ ∀ x ∈ List.map f l, 0 ≤ x

Next tactic:
rfl
theorem _root_.Real.list_prod_map_rpow' {ι} (l : List ι) (f : ι → ℝ)
    (hl : ∀ i ∈ l, (0 : ℝ) ≤ f i) (r : ℝ) :
    (l.map (f · ^ r)).prod = (l.map f).prod ^ r := by
  rw [← Real.list_prod_map_rpow (l.map f) _ r, List.map_map]; rfl
  

Proof state:
ι : Type u_1
l : List ι
f : ι → ℝ
hl : ∀ i ∈ l, 0 ≤ f i
r : ℝ
⊢ ∀ x ∈ List.map f l, 0 ≤ x

Next tactic:
simpa using hl
/-- `rpow` version of `Multiset.prod_map_pow`. -/
theorem _root_.Real.multiset_prod_map_rpow {ι} (s : Multiset ι) (f : ι → ℝ)
    (hs : ∀ i ∈ s, (0 : ℝ) ≤ f i) (r : ℝ) :
    (s.map (f · ^ r)).prod = (s.map f).prod ^ r := by
  

Proof state:
ι : Type u_1
s : Multiset ι
f : ι → ℝ
hs : ∀ i ∈ s, 0 ≤ f i
r : ℝ
⊢ Multiset.prod (Multiset.map (fun x => f x ^ r) s) = Multiset.prod (Multiset.map f s) ^ r

Next tactic:
induction' s using Quotient.inductionOn with l
/-- `rpow` version of `Multiset.prod_map_pow`. -/
theorem _root_.Real.multiset_prod_map_rpow {ι} (s : Multiset ι) (f : ι → ℝ)
    (hs : ∀ i ∈ s, (0 : ℝ) ≤ f i) (r : ℝ) :
    (s.map (f · ^ r)).prod = (s.map f).prod ^ r := by
  induction' s using Quotient.inductionOn with l
  

Proof state:
case h
ι : Type u_1
f : ι → ℝ
r : ℝ
l : List ι
hs : ∀ i ∈ ⟦l⟧, 0 ≤ f i
⊢ Multiset.prod (Multiset.map (fun x => f x ^ r) ⟦l⟧) = Multiset.prod (Multiset.map f ⟦l⟧) ^ r

Next tactic:
simpa using Real.list_prod_map_rpow' l f hs r
theorem le_rpow_one_div_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x ≤ y ^ (1 / z) ↔ x ^ z ≤ y := by
  

Proof state:
x y : ℝ≥0
z : ℝ
hz : 0 < z
⊢ x ≤ y ^ (1 / z) ↔ x ^ z ≤ y

Next tactic:
rw [← rpow_le_rpow_iff hz, rpow_self_rpow_inv hz.ne']
theorem rpow_one_div_le_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x ^ (1 / z) ≤ y ↔ x ≤ y ^ z := by
  

Proof state:
x y : ℝ≥0
z : ℝ
hz : 0 < z
⊢ x ^ (1 / z) ≤ y ↔ x ≤ y ^ z

Next tactic:
rw [← rpow_le_rpow_iff hz, rpow_self_rpow_inv hz.ne']
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  

Proof state:
p : ℝ
x : ℝ≥0
hx_pos : 0 < x
⊢ 0 < x ^ p

Next tactic:
have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    intro p hp_pos
    rw [← zero_rpow hp_pos.ne']
    exact rpow_lt_rpow hx_pos hp_pos
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    

Proof state:
p : ℝ
x : ℝ≥0
hx_pos : 0 < x
⊢ ∀ {p : ℝ}, 0 < p → 0 < x ^ p

Next tactic:
intro p hp_pos
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    intro p hp_pos
    

Proof state:
p✝ : ℝ
x : ℝ≥0
hx_pos : 0 < x
p : ℝ
hp_pos : 0 < p
⊢ 0 < x ^ p

Next tactic:
rw [← zero_rpow hp_pos.ne']
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    intro p hp_pos
    rw [← zero_rpow hp_pos.ne']
    

Proof state:
p✝ : ℝ
x : ℝ≥0
hx_pos : 0 < x
p : ℝ
hp_pos : 0 < p
⊢ 0 ^ p < x ^ p

Next tactic:
exact rpow_lt_rpow hx_pos hp_pos
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    intro p hp_pos
    rw [← zero_rpow hp_pos.ne']
    exact rpow_lt_rpow hx_pos hp_pos
  

Proof state:
p : ℝ
x : ℝ≥0
hx_pos : 0 < x
rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p
⊢ 0 < x ^ p

Next tactic:
rcases lt_trichotomy (0 : ℝ) p with (hp_pos | rfl | hp_neg)
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    intro p hp_pos
    rw [← zero_rpow hp_pos.ne']
    exact rpow_lt_rpow hx_pos hp_pos
  rcases lt_trichotomy (0 : ℝ) p with (hp_pos | rfl | hp_neg)
  · 

Proof state:
case inl
p : ℝ
x : ℝ≥0
hx_pos : 0 < x
rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p
hp_pos : 0 < p
⊢ 0 < x ^ p

Next tactic:
exact rpow_pos_of_nonneg hp_pos
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    intro p hp_pos
    rw [← zero_rpow hp_pos.ne']
    exact rpow_lt_rpow hx_pos hp_pos
  rcases lt_trichotomy (0 : ℝ) p with (hp_pos | rfl | hp_neg)
  · exact rpow_pos_of_nonneg hp_pos
  · 

Proof state:
case inr.inl
x : ℝ≥0
hx_pos : 0 < x
rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p
⊢ 0 < x ^ 0

Next tactic:
simp only [zero_lt_one, rpow_zero]
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    intro p hp_pos
    rw [← zero_rpow hp_pos.ne']
    exact rpow_lt_rpow hx_pos hp_pos
  rcases lt_trichotomy (0 : ℝ) p with (hp_pos | rfl | hp_neg)
  · exact rpow_pos_of_nonneg hp_pos
  · simp only [zero_lt_one, rpow_zero]
  · 

Proof state:
case inr.inr
p : ℝ
x : ℝ≥0
hx_pos : 0 < x
rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p
hp_neg : p < 0
⊢ 0 < x ^ p

Next tactic:
rw [← neg_neg p, rpow_neg, inv_pos]
theorem rpow_pos {p : ℝ} {x : ℝ≥0} (hx_pos : 0 < x) : 0 < x ^ p := by
  have rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p := by
    intro p hp_pos
    rw [← zero_rpow hp_pos.ne']
    exact rpow_lt_rpow hx_pos hp_pos
  rcases lt_trichotomy (0 : ℝ) p with (hp_pos | rfl | hp_neg)
  · exact rpow_pos_of_nonneg hp_pos
  · simp only [zero_lt_one, rpow_zero]
  · rw [← neg_neg p, rpow_neg, inv_pos]
    

Proof state:
case inr.inr
p : ℝ
x : ℝ≥0
hx_pos : 0 < x
rpow_pos_of_nonneg : ∀ {p : ℝ}, 0 < p → 0 < x ^ p
hp_neg : p < 0
⊢ 0 < x ^ (-p)

Next tactic:
exact rpow_pos_of_nonneg (neg_pos.mpr hp_neg)
theorem rpow_le_self_of_le_one {x : ℝ≥0} {z : ℝ} (hx : x ≤ 1) (h_one_le : 1 ≤ z) : x ^ z ≤ x := by
  

Proof state:
x : ℝ≥0
z : ℝ
hx : x ≤ 1
h_one_le : 1 ≤ z
⊢ x ^ z ≤ x

Next tactic:
rcases eq_bot_or_bot_lt x with (rfl | (h : 0 < x))
theorem rpow_le_self_of_le_one {x : ℝ≥0} {z : ℝ} (hx : x ≤ 1) (h_one_le : 1 ≤ z) : x ^ z ≤ x := by
  rcases eq_bot_or_bot_lt x with (rfl | (h : 0 < x))
  · 

Proof state:
case inl
z : ℝ
h_one_le : 1 ≤ z
hx : ⊥ ≤ 1
⊢ ⊥ ^ z ≤ ⊥

Next tactic:
have : z ≠ 0 := by linarith
theorem rpow_le_self_of_le_one {x : ℝ≥0} {z : ℝ} (hx : x ≤ 1) (h_one_le : 1 ≤ z) : x ^ z ≤ x := by
  rcases eq_bot_or_bot_lt x with (rfl | (h : 0 < x))
  · have : z ≠ 0 := by 

Proof state:
z : ℝ
h_one_le : 1 ≤ z
hx : ⊥ ≤ 1
⊢ z ≠ 0

Next tactic:
linarith
theorem rpow_le_self_of_le_one {x : ℝ≥0} {z : ℝ} (hx : x ≤ 1) (h_one_le : 1 ≤ z) : x ^ z ≤ x := by
  rcases eq_bot_or_bot_lt x with (rfl | (h : 0 < x))
  · have : z ≠ 0 := by linarith
    

Proof state:
case inl
z : ℝ
h_one_le : 1 ≤ z
hx : ⊥ ≤ 1
this : z ≠ 0
⊢ ⊥ ^ z ≤ ⊥

Next tactic:
simp [this]
theorem rpow_le_self_of_le_one {x : ℝ≥0} {z : ℝ} (hx : x ≤ 1) (h_one_le : 1 ≤ z) : x ^ z ≤ x := by
  rcases eq_bot_or_bot_lt x with (rfl | (h : 0 < x))
  · have : z ≠ 0 := by linarith
    simp [this]
  

Proof state:
case inr
x : ℝ≥0
z : ℝ
hx : x ≤ 1
h_one_le : 1 ≤ z
h : 0 < x
⊢ x ^ z ≤ x

Next tactic:
nth_rw 2 [← NNReal.rpow_one x]
theorem rpow_le_self_of_le_one {x : ℝ≥0} {z : ℝ} (hx : x ≤ 1) (h_one_le : 1 ≤ z) : x ^ z ≤ x := by
  rcases eq_bot_or_bot_lt x with (rfl | (h : 0 < x))
  · have : z ≠ 0 := by linarith
    simp [this]
  nth_rw 2 [← NNReal.rpow_one x]
  

Proof state:
case inr
x : ℝ≥0
z : ℝ
hx : x ≤ 1
h_one_le : 1 ≤ z
h : 0 < x
⊢ x ^ z ≤ x ^ 1

Next tactic:
exact NNReal.rpow_le_rpow_of_exponent_ge h hx h_one_le
theorem rpow_left_injective {x : ℝ} (hx : x ≠ 0) : Function.Injective fun y : ℝ≥0 => y ^ x :=
  fun y z hyz => by 

Proof state:
x : ℝ
hx : x ≠ 0
y z : ℝ≥0
hyz : (fun y => y ^ x) y = (fun y => y ^ x) z
⊢ y = z

Next tactic:
simpa only [rpow_inv_rpow_self hx] using congr_arg (fun y => y ^ (1 / x)) hyz
theorem rpow_left_surjective {x : ℝ} (hx : x ≠ 0) : Function.Surjective fun y : ℝ≥0 => y ^ x :=
  fun y => ⟨y ^ x⁻¹, by 

Proof state:
x : ℝ
hx : x ≠ 0
y : ℝ≥0
⊢ (fun y => y ^ x) (y ^ x⁻¹) = y

Next tactic:
simp_rw [← rpow_mul, _root_.inv_mul_cancel hx, rpow_one]
theorem eq_rpow_one_div_iff {x y : ℝ≥0} {z : ℝ} (hz : z ≠ 0) : x = y ^ (1 / z) ↔ x ^ z = y := by
  

Proof state:
x y : ℝ≥0
z : ℝ
hz : z ≠ 0
⊢ x = y ^ (1 / z) ↔ x ^ z = y

Next tactic:
rw [← rpow_eq_rpow_iff hz, rpow_self_rpow_inv hz]
theorem rpow_one_div_eq_iff {x y : ℝ≥0} {z : ℝ} (hz : z ≠ 0) : x ^ (1 / z) = y ↔ x = y ^ z := by
  

Proof state:
x y : ℝ≥0
z : ℝ
hz : z ≠ 0
⊢ x ^ (1 / z) = y ↔ x = y ^ z

Next tactic:
rw [← rpow_eq_rpow_iff hz, rpow_self_rpow_inv hz]
theorem pow_rpow_inv_natCast (x : ℝ≥0) {n : ℕ} (hn : n ≠ 0) : (x ^ n) ^ (n⁻¹ : ℝ) = x := by
  

Proof state:
x : ℝ≥0
n : ℕ
hn : n ≠ 0
⊢ (x ^ n) ^ (↑n)⁻¹ = x

Next tactic:
rw [← NNReal.coe_eq, coe_rpow, NNReal.coe_pow]
theorem pow_rpow_inv_natCast (x : ℝ≥0) {n : ℕ} (hn : n ≠ 0) : (x ^ n) ^ (n⁻¹ : ℝ) = x := by
  rw [← NNReal.coe_eq, coe_rpow, NNReal.coe_pow]
  

Proof state:
x : ℝ≥0
n : ℕ
hn : n ≠ 0
⊢ (↑x ^ n) ^ (↑n)⁻¹ = ↑x

Next tactic:
exact Real.pow_rpow_inv_natCast x.2 hn
theorem rpow_inv_natCast_pow (x : ℝ≥0) {n : ℕ} (hn : n ≠ 0) : (x ^ (n⁻¹ : ℝ)) ^ n = x := by
  

Proof state:
x : ℝ≥0
n : ℕ
hn : n ≠ 0
⊢ (x ^ (↑n)⁻¹) ^ n = x

Next tactic:
rw [← NNReal.coe_eq, NNReal.coe_pow, coe_rpow]
theorem rpow_inv_natCast_pow (x : ℝ≥0) {n : ℕ} (hn : n ≠ 0) : (x ^ (n⁻¹ : ℝ)) ^ n = x := by
  rw [← NNReal.coe_eq, NNReal.coe_pow, coe_rpow]
  

Proof state:
x : ℝ≥0
n : ℕ
hn : n ≠ 0
⊢ (↑x ^ (↑n)⁻¹) ^ n = ↑x

Next tactic:
exact Real.rpow_inv_natCast_pow x.2 hn
theorem _root_.Real.toNNReal_rpow_of_nonneg {x y : ℝ} (hx : 0 ≤ x) :
    Real.toNNReal (x ^ y) = Real.toNNReal x ^ y := by
  

Proof state:
x y : ℝ
hx : 0 ≤ x
⊢ toNNReal (x ^ y) = toNNReal x ^ y

Next tactic:
nth_rw 1 [← Real.coe_toNNReal x hx]
theorem _root_.Real.toNNReal_rpow_of_nonneg {x y : ℝ} (hx : 0 ≤ x) :
    Real.toNNReal (x ^ y) = Real.toNNReal x ^ y := by
  nth_rw 1 [← Real.coe_toNNReal x hx]
  

Proof state:
x y : ℝ
hx : 0 ≤ x
⊢ toNNReal (↑(toNNReal x) ^ y) = toNNReal x ^ y

Next tactic:
rw [← NNReal.coe_rpow, Real.toNNReal_coe]
theorem strictMono_rpow_of_pos {z : ℝ} (h : 0 < z) : StrictMono fun x : ℝ≥0 => x ^ z :=
  fun x y hxy => by 

Proof state:
z : ℝ
h : 0 < z
x y : ℝ≥0
hxy : x < y
⊢ (fun x => x ^ z) x < (fun x => x ^ z) y

Next tactic:
simp only [NNReal.rpow_lt_rpow hxy h, coe_lt_coe]
theorem monotone_rpow_of_nonneg {z : ℝ} (h : 0 ≤ z) : Monotone fun x : ℝ≥0 => x ^ z :=
  h.eq_or_lt.elim (fun h0 => h0 ▸ by 

Proof state:
z : ℝ
h : 0 ≤ z
h0 : 0 = z
⊢ Monotone fun x => x ^ 0

Next tactic:
simp only [rpow_zero, monotone_const]
/-- Bundles `fun x : ℝ≥0 => x ^ y` into an order isomorphism when `y : ℝ` is positive,
where the inverse is `fun x : ℝ≥0 => x ^ (1 / y)`. -/
@[simps! apply]
def orderIsoRpow (y : ℝ) (hy : 0 < y) : ℝ≥0 ≃o ℝ≥0 :=
  (strictMono_rpow_of_pos hy).orderIsoOfRightInverse (fun x => x ^ y) (fun x => x ^ (1 / y))
    fun x => by
      

Proof state:
y : ℝ
hy : 0 < y
x : ℝ≥0
⊢ (fun x => x ^ y) ((fun x => x ^ (1 / y)) x) = x

Next tactic:
dsimp
/-- Bundles `fun x : ℝ≥0 => x ^ y` into an order isomorphism when `y : ℝ` is positive,
where the inverse is `fun x : ℝ≥0 => x ^ (1 / y)`. -/
@[simps! apply]
def orderIsoRpow (y : ℝ) (hy : 0 < y) : ℝ≥0 ≃o ℝ≥0 :=
  (strictMono_rpow_of_pos hy).orderIsoOfRightInverse (fun x => x ^ y) (fun x => x ^ (1 / y))
    fun x => by
      dsimp
      

Proof state:
y : ℝ
hy : 0 < y
x : ℝ≥0
⊢ (x ^ (1 / y)) ^ y = x

Next tactic:
rw [← rpow_mul, one_div_mul_cancel hy.ne.symm, rpow_one]
theorem orderIsoRpow_symm_eq (y : ℝ) (hy : 0 < y) :
    (orderIsoRpow y hy).symm = orderIsoRpow (1 / y) (one_div_pos.2 hy) := by
  

Proof state:
y : ℝ
hy : 0 < y
⊢ OrderIso.symm (orderIsoRpow y hy) = orderIsoRpow (1 / y) (_ : 0 < 1 / y)

Next tactic:
simp only [orderIsoRpow, one_div_one_div]
theorem orderIsoRpow_symm_eq (y : ℝ) (hy : 0 < y) :
    (orderIsoRpow y hy).symm = orderIsoRpow (1 / y) (one_div_pos.2 hy) := by
  simp only [orderIsoRpow, one_div_one_div]; 

Proof state:
y : ℝ
hy : 0 < y
⊢ OrderIso.symm
      (StrictMono.orderIsoOfRightInverse (fun x => x ^ y) (_ : StrictMono fun x => x ^ y) (fun x => x ^ (1 / y))
        (_ : ∀ (x : ℝ≥0), (fun x => x ^ y) ((fun x => x ^ (1 / y)) x) = x)) =
    StrictMono.orderIsoOfRightInverse (fun x => x ^ (1 / y)) (_ : StrictMono fun x => x ^ (1 / y)) (fun x => x ^ y)
      (_ : Function.RightInverse (fun x => x ^ y) fun x => x ^ (1 / y))

Next tactic:
rfl
@[simp]
theorem rpow_zero {x : ℝ≥0∞} : x ^ (0 : ℝ) = 1 := by
  

Proof state:
x : ℝ≥0∞
⊢ x ^ 0 = 1

Next tactic:
cases x
@[simp]
theorem rpow_zero {x : ℝ≥0∞} : x ^ (0 : ℝ) = 1 := by
  cases x <;>
    · 

Proof state:
case none
⊢ none ^ 0 = 1

Next tactic:
dsimp only [(· ^ ·), Pow.pow, rpow]
@[simp]
theorem rpow_zero {x : ℝ≥0∞} : x ^ (0 : ℝ) = 1 := by
  cases x <;>
    · dsimp only [(· ^ ·), Pow.pow, rpow]
      

Proof state:
case none
⊢ (if 0 < 0 then ⊤ else if 0 = 0 then 1 else 0) = 1

Next tactic:
simp [lt_irrefl]
@[simp]
theorem rpow_zero {x : ℝ≥0∞} : x ^ (0 : ℝ) = 1 := by
  cases x <;>
    · 

Proof state:
case some
val✝ : ℝ≥0
⊢ some val✝ ^ 0 = 1

Next tactic:
dsimp only [(· ^ ·), Pow.pow, rpow]
@[simp]
theorem rpow_zero {x : ℝ≥0∞} : x ^ (0 : ℝ) = 1 := by
  cases x <;>
    · dsimp only [(· ^ ·), Pow.pow, rpow]
      

Proof state:
case some
val✝ : ℝ≥0
⊢ (if val✝ = 0 ∧ 0 < 0 then ⊤ else ↑(NNReal.rpow val✝ 0)) = 1

Next tactic:
simp [lt_irrefl]
@[simp]
theorem top_rpow_of_pos {y : ℝ} (h : 0 < y) : (⊤ : ℝ≥0∞) ^ y = ⊤ := by 

Proof state:
y : ℝ
h : 0 < y
⊢ ⊤ ^ y = ⊤

Next tactic:
simp [top_rpow_def, h]
@[simp]
theorem top_rpow_of_neg {y : ℝ} (h : y < 0) : (⊤ : ℝ≥0∞) ^ y = 0 := by
  

Proof state:
y : ℝ
h : y < 0
⊢ ⊤ ^ y = 0

Next tactic:
simp [top_rpow_def, asymm h, ne_of_lt h]
@[simp]
theorem zero_rpow_of_pos {y : ℝ} (h : 0 < y) : (0 : ℝ≥0∞) ^ y = 0 := by
  

Proof state:
y : ℝ
h : 0 < y
⊢ 0 ^ y = 0

Next tactic:
rw [← ENNReal.coe_zero, ← ENNReal.some_eq_coe]
@[simp]
theorem zero_rpow_of_pos {y : ℝ} (h : 0 < y) : (0 : ℝ≥0∞) ^ y = 0 := by
  rw [← ENNReal.coe_zero, ← ENNReal.some_eq_coe]
  

Proof state:
y : ℝ
h : 0 < y
⊢ some 0 ^ y = some 0

Next tactic:
dsimp only [(· ^ ·), rpow, Pow.pow]
@[simp]
theorem zero_rpow_of_pos {y : ℝ} (h : 0 < y) : (0 : ℝ≥0∞) ^ y = 0 := by
  rw [← ENNReal.coe_zero, ← ENNReal.some_eq_coe]
  dsimp only [(· ^ ·), rpow, Pow.pow]
  

Proof state:
y : ℝ
h : 0 < y
⊢ (if 0 = 0 ∧ y < 0 then ⊤ else ↑(NNReal.rpow 0 y)) = some 0

Next tactic:
simp [h, asymm h, ne_of_gt h]
@[simp]
theorem zero_rpow_of_neg {y : ℝ} (h : y < 0) : (0 : ℝ≥0∞) ^ y = ⊤ := by
  

Proof state:
y : ℝ
h : y < 0
⊢ 0 ^ y = ⊤

Next tactic:
rw [← ENNReal.coe_zero, ← ENNReal.some_eq_coe]
@[simp]
theorem zero_rpow_of_neg {y : ℝ} (h : y < 0) : (0 : ℝ≥0∞) ^ y = ⊤ := by
  rw [← ENNReal.coe_zero, ← ENNReal.some_eq_coe]
  

Proof state:
y : ℝ
h : y < 0
⊢ some 0 ^ y = ⊤

Next tactic:
dsimp only [(· ^ ·), rpow, Pow.pow]
@[simp]
theorem zero_rpow_of_neg {y : ℝ} (h : y < 0) : (0 : ℝ≥0∞) ^ y = ⊤ := by
  rw [← ENNReal.coe_zero, ← ENNReal.some_eq_coe]
  dsimp only [(· ^ ·), rpow, Pow.pow]
  

Proof state:
y : ℝ
h : y < 0
⊢ (if 0 = 0 ∧ y < 0 then ⊤ else ↑(NNReal.rpow 0 y)) = ⊤

Next tactic:
simp [h, ne_of_gt h]
theorem zero_rpow_def (y : ℝ) : (0 : ℝ≥0∞) ^ y = if 0 < y then 0 else if y = 0 then 1 else ⊤ := by
  

Proof state:
y : ℝ
⊢ 0 ^ y = if 0 < y then 0 else if y = 0 then 1 else ⊤

Next tactic:
rcases lt_trichotomy (0 : ℝ) y with (H | rfl | H)
theorem zero_rpow_def (y : ℝ) : (0 : ℝ≥0∞) ^ y = if 0 < y then 0 else if y = 0 then 1 else ⊤ := by
  rcases lt_trichotomy (0 : ℝ) y with (H | rfl | H)
  · 

Proof state:
case inl
y : ℝ
H : 0 < y
⊢ 0 ^ y = if 0 < y then 0 else if y = 0 then 1 else ⊤

Next tactic:
simp [H, ne_of_gt, zero_rpow_of_pos, lt_irrefl]