l3lab/ntp-mathlib huggingface dataset:
theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F) :
    norm K (norm L x) = norm K x := by
  by_cases hKF : FiniteDimensional K F
  · let A := AlgebraicClosure K
    apply (algebraMap K A).injective
    haveI : FiniteDimensional L F := FiniteDimensional.right K L F
    haveI : FiniteDimensional K L := FiniteDimensional.left K L F
    haveI : IsSeparable K L := isSeparable_tower_bot_of_isSeparable K L F
    haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
    letI : ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        Fintype (F →ₐ[L] A) := fun _ => inferInstance
    rw [norm_eq_prod_embeddings K A (_ : F),
      Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] A => σ x)
        (fun π : Σ f : L →ₐ[K] A, _ => (π.2 : F → A) x) fun _ => rfl]
    suffices ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        ∏ π : F →ₐ[L] A, π x = σ (norm L x)
      by simp_rw [← Finset.univ_sigma_univ, Finset.prod_sigma, this, norm_eq_prod_embeddings]
    · intro σ
      letI : Algebra L A := σ.toRingHom.toAlgebra
      rw [← norm_eq_prod_embeddings L A (_ : F)]
      rfl
  · rw [norm_eq_one_of_not_module_finite hKF]
    by_cases hKL : FiniteDimensional K L
    · have hLF : ¬FiniteDimensional L F := by
        

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : Algebra L F
inst✝¹ : IsScalarTower K L F
inst✝ : IsSeparable K F
x : F
hKF : ¬FiniteDimensional K F
hKL : FiniteDimensional K L
⊢ ¬FiniteDimensional L F

Next tactic:
refine' (mt _) hKF
theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F) :
    norm K (norm L x) = norm K x := by
  by_cases hKF : FiniteDimensional K F
  · let A := AlgebraicClosure K
    apply (algebraMap K A).injective
    haveI : FiniteDimensional L F := FiniteDimensional.right K L F
    haveI : FiniteDimensional K L := FiniteDimensional.left K L F
    haveI : IsSeparable K L := isSeparable_tower_bot_of_isSeparable K L F
    haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
    letI : ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        Fintype (F →ₐ[L] A) := fun _ => inferInstance
    rw [norm_eq_prod_embeddings K A (_ : F),
      Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] A => σ x)
        (fun π : Σ f : L →ₐ[K] A, _ => (π.2 : F → A) x) fun _ => rfl]
    suffices ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        ∏ π : F →ₐ[L] A, π x = σ (norm L x)
      by simp_rw [← Finset.univ_sigma_univ, Finset.prod_sigma, this, norm_eq_prod_embeddings]
    · intro σ
      letI : Algebra L A := σ.toRingHom.toAlgebra
      rw [← norm_eq_prod_embeddings L A (_ : F)]
      rfl
  · rw [norm_eq_one_of_not_module_finite hKF]
    by_cases hKL : FiniteDimensional K L
    · have hLF : ¬FiniteDimensional L F := by
        refine' (mt _) hKF
        

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : Algebra L F
inst✝¹ : IsScalarTower K L F
inst✝ : IsSeparable K F
x : F
hKF : ¬FiniteDimensional K F
hKL : FiniteDimensional K L
⊢ FiniteDimensional L F → FiniteDimensional K F

Next tactic:
intro hKF
theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F) :
    norm K (norm L x) = norm K x := by
  by_cases hKF : FiniteDimensional K F
  · let A := AlgebraicClosure K
    apply (algebraMap K A).injective
    haveI : FiniteDimensional L F := FiniteDimensional.right K L F
    haveI : FiniteDimensional K L := FiniteDimensional.left K L F
    haveI : IsSeparable K L := isSeparable_tower_bot_of_isSeparable K L F
    haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
    letI : ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        Fintype (F →ₐ[L] A) := fun _ => inferInstance
    rw [norm_eq_prod_embeddings K A (_ : F),
      Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] A => σ x)
        (fun π : Σ f : L →ₐ[K] A, _ => (π.2 : F → A) x) fun _ => rfl]
    suffices ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        ∏ π : F →ₐ[L] A, π x = σ (norm L x)
      by simp_rw [← Finset.univ_sigma_univ, Finset.prod_sigma, this, norm_eq_prod_embeddings]
    · intro σ
      letI : Algebra L A := σ.toRingHom.toAlgebra
      rw [← norm_eq_prod_embeddings L A (_ : F)]
      rfl
  · rw [norm_eq_one_of_not_module_finite hKF]
    by_cases hKL : FiniteDimensional K L
    · have hLF : ¬FiniteDimensional L F := by
        refine' (mt _) hKF
        intro hKF
        

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : Algebra L F
inst✝¹ : IsScalarTower K L F
inst✝ : IsSeparable K F
x : F
hKF✝ : ¬FiniteDimensional K F
hKL : FiniteDimensional K L
hKF : FiniteDimensional L F
⊢ FiniteDimensional K F

Next tactic:
exact FiniteDimensional.trans K L F
theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F) :
    norm K (norm L x) = norm K x := by
  by_cases hKF : FiniteDimensional K F
  · let A := AlgebraicClosure K
    apply (algebraMap K A).injective
    haveI : FiniteDimensional L F := FiniteDimensional.right K L F
    haveI : FiniteDimensional K L := FiniteDimensional.left K L F
    haveI : IsSeparable K L := isSeparable_tower_bot_of_isSeparable K L F
    haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
    letI : ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        Fintype (F →ₐ[L] A) := fun _ => inferInstance
    rw [norm_eq_prod_embeddings K A (_ : F),
      Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] A => σ x)
        (fun π : Σ f : L →ₐ[K] A, _ => (π.2 : F → A) x) fun _ => rfl]
    suffices ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        ∏ π : F →ₐ[L] A, π x = σ (norm L x)
      by simp_rw [← Finset.univ_sigma_univ, Finset.prod_sigma, this, norm_eq_prod_embeddings]
    · intro σ
      letI : Algebra L A := σ.toRingHom.toAlgebra
      rw [← norm_eq_prod_embeddings L A (_ : F)]
      rfl
  · rw [norm_eq_one_of_not_module_finite hKF]
    by_cases hKL : FiniteDimensional K L
    · have hLF : ¬FiniteDimensional L F := by
        refine' (mt _) hKF
        intro hKF
        exact FiniteDimensional.trans K L F
      

Proof state:
case pos
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : Algebra L F
inst✝¹ : IsScalarTower K L F
inst✝ : IsSeparable K F
x : F
hKF : ¬FiniteDimensional K F
hKL : FiniteDimensional K L
hLF : ¬FiniteDimensional L F
⊢ (norm K) ((norm L) x) = 1

Next tactic:
rw [norm_eq_one_of_not_module_finite hLF, _root_.map_one]
theorem norm_norm [Algebra L F] [IsScalarTower K L F] [IsSeparable K F] (x : F) :
    norm K (norm L x) = norm K x := by
  by_cases hKF : FiniteDimensional K F
  · let A := AlgebraicClosure K
    apply (algebraMap K A).injective
    haveI : FiniteDimensional L F := FiniteDimensional.right K L F
    haveI : FiniteDimensional K L := FiniteDimensional.left K L F
    haveI : IsSeparable K L := isSeparable_tower_bot_of_isSeparable K L F
    haveI : IsSeparable L F := isSeparable_tower_top_of_isSeparable K L F
    letI : ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        Fintype (F →ₐ[L] A) := fun _ => inferInstance
    rw [norm_eq_prod_embeddings K A (_ : F),
      Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] A => σ x)
        (fun π : Σ f : L →ₐ[K] A, _ => (π.2 : F → A) x) fun _ => rfl]
    suffices ∀ σ : L →ₐ[K] A,
        haveI := σ.toRingHom.toAlgebra
        ∏ π : F →ₐ[L] A, π x = σ (norm L x)
      by simp_rw [← Finset.univ_sigma_univ, Finset.prod_sigma, this, norm_eq_prod_embeddings]
    · intro σ
      letI : Algebra L A := σ.toRingHom.toAlgebra
      rw [← norm_eq_prod_embeddings L A (_ : F)]
      rfl
  · rw [norm_eq_one_of_not_module_finite hKF]
    by_cases hKL : FiniteDimensional K L
    · have hLF : ¬FiniteDimensional L F := by
        refine' (mt _) hKF
        intro hKF
        exact FiniteDimensional.trans K L F
      rw [norm_eq_one_of_not_module_finite hLF, _root_.map_one]
    · 

Proof state:
case neg
R : Type u_1
S : Type u_2
T : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Ring S
inst✝¹⁰ : Algebra R S
K : Type u_4
L : Type u_5
F : Type u_6
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : Field F
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra K F
ι : Type w
E : Type u_7
inst✝⁴ : Field E
inst✝³ : Algebra K E
inst✝² : Algebra L F
inst✝¹ : IsScalarTower K L F
inst✝ : IsSeparable K F
x : F
hKF : ¬FiniteDimensional K F
hKL : ¬FiniteDimensional K L
⊢ (norm K) ((norm L) x) = 1

Next tactic:
rw [norm_eq_one_of_not_module_finite hKL]
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, x ^ q * rexp (-x ^ p) = 1 / p * Gamma ((q + 1) / p)

Next tactic:
calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      simp_rw [smul_eq_mul, mul_assoc]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
      ring_nf
    _ = (1 / p) * Gamma ((q + 1) / p) := by
      rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
      simp_rw [show 1 / p - 1 + q / p = (q + 1) / p - 1 by field_simp; ring, ← integral_mul_left,
        ← mul_assoc]
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, x ^ q * rexp (-x ^ p) =
    ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-x))

Next tactic:
rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-(x ^ (1 / p)) ^ p)) =
    ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-x))

Next tactic:
refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ (1 / p * x✝ ^ (1 / p - 1)) • ((x✝ ^ (1 / p)) ^ q * rexp (-(x✝ ^ (1 / p)) ^ p)) =
    (1 / p * x✝ ^ (1 / p - 1)) • ((x✝ ^ (1 / p)) ^ q * rexp (-x✝))

Next tactic:
rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-x)) =
    ∫ (x : ℝ) in Ioi 0, 1 / p * rexp (-x) * x ^ (1 / p - 1 + q / p)

Next tactic:
simp_rw [smul_eq_mul, mul_assoc]
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      simp_rw [smul_eq_mul, mul_assoc]
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, 1 / p * (x ^ (1 / p - 1) * ((x ^ (1 / p)) ^ q * rexp (-x))) =
    ∫ (x : ℝ) in Ioi 0, 1 / p * (rexp (-x) * x ^ (1 / p - 1 + q / p))

Next tactic:
refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      simp_rw [smul_eq_mul, mul_assoc]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 1 / p * (x✝ ^ (1 / p - 1) * ((x✝ ^ (1 / p)) ^ q * rexp (-x✝))) = 1 / p * (rexp (-x✝) * x✝ ^ (1 / p - 1 + q / p))

Next tactic:
rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      simp_rw [smul_eq_mul, mul_assoc]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ x✝ ^ (1 / p - 1) * (x✝ ^ (1 / p * q) * rexp (-x✝)) / p = 1 / p * (rexp (-x✝) * (x✝ ^ (1 / p - 1) * x✝ ^ (q / p)))

Next tactic:
ring_nf
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      simp_rw [smul_eq_mul, mul_assoc]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
      ring_nf
    _ = (1 / p) * Gamma ((q + 1) / p) := by
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, 1 / p * rexp (-x) * x ^ (1 / p - 1 + q / p) = 1 / p * Gamma ((q + 1) / p)

Next tactic:
rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      simp_rw [smul_eq_mul, mul_assoc]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
      ring_nf
    _ = (1 / p) * Gamma ((q + 1) / p) := by
      rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
      

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, 1 / p * rexp (-x) * x ^ (1 / p - 1 + q / p) =
    1 / p * ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ ((q + 1) / p - 1)

Next tactic:
simp_rw [show 1 / p - 1 + q / p = (q + 1) / p - 1 by field_simp; ring, ← integral_mul_left,
        ← mul_assoc]
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      simp_rw [smul_eq_mul, mul_assoc]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
      ring_nf
    _ = (1 / p) * Gamma ((q + 1) / p) := by
      rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
      simp_rw [show 1 / p - 1 + q / p = (q + 1) / p - 1 by 

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ 1 / p - 1 + q / p = (q + 1) / p - 1

Next tactic:
field_simp
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
      rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
        abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
    _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
      simp_rw [smul_eq_mul, mul_assoc]
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
      ring_nf
    _ = (1 / p) * Gamma ((q + 1) / p) := by
      rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
      simp_rw [show 1 / p - 1 + q / p = (q + 1) / p - 1 by field_simp; 

Proof state:
p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ 1 - p + q = q + 1 - p

Next tactic:
ring
theorem integral_rpow_mul_exp_neg_mul_rpow {p q b : ℝ} (hp : 0 < p) (hq : - 1 < q) (hb : 0 < b) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- b * x ^ p) =
      b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p) := by
  

Proof state:
p q b : ℝ
hp : 0 < p
hq : -1 < q
hb : 0 < b
⊢ ∫ (x : ℝ) in Ioi 0, x ^ q * rexp (-b * x ^ p) = b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p)

Next tactic:
calc
    _ = ∫ x in Ioi (0:ℝ), b ^ (-p⁻¹ * q) * ((b ^ p⁻¹ * x) ^ q * rexp (-(b ^ p⁻¹ * x) ^ p)) := by
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      rw [mul_rpow _ (le_of_lt hx), mul_rpow _ (le_of_lt hx), ← rpow_mul, ← rpow_mul,
        inv_mul_cancel, rpow_one, mul_assoc, ← mul_assoc, ← rpow_add, neg_mul p⁻¹, add_left_neg,
        rpow_zero, one_mul, neg_mul]
      all_goals positivity
    _ = (b ^ p⁻¹)⁻¹ * ∫ x in Ioi (0:ℝ), b ^ (-p⁻¹ * q) * (x ^ q * rexp (-x ^ p)) := by
      rw [integral_comp_mul_left_Ioi (fun x => b ^ (-p⁻¹ * q) * (x ^ q * exp (- x ^ p))) 0,
        mul_zero, abs_eq_self.mpr ?_, smul_eq_mul]
      all_goals positivity
    _ = b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p) := by
      rw [integral_mul_left, integral_rpow_mul_exp_neg_rpow _ hq, mul_assoc, ← mul_assoc,
        ← rpow_neg_one, ← rpow_mul, ← rpow_add]
      congr; ring
      all_goals positivity
theorem integral_rpow_mul_exp_neg_mul_rpow {p q b : ℝ} (hp : 0 < p) (hq : - 1 < q) (hb : 0 < b) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- b * x ^ p) =
      b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ x in Ioi (0:ℝ), b ^ (-p⁻¹ * q) * ((b ^ p⁻¹ * x) ^ q * rexp (-(b ^ p⁻¹ * x) ^ p)) := by
      

Proof state:
p q b : ℝ
hp : 0 < p
hq : -1 < q
hb : 0 < b
⊢ ∫ (x : ℝ) in Ioi 0, x ^ q * rexp (-b * x ^ p) =
    ∫ (x : ℝ) in Ioi 0, b ^ (-p⁻¹ * q) * ((b ^ p⁻¹ * x) ^ q * rexp (-(b ^ p⁻¹ * x) ^ p))

Next tactic:
refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
theorem integral_rpow_mul_exp_neg_mul_rpow {p q b : ℝ} (hp : 0 < p) (hq : - 1 < q) (hb : 0 < b) :
    ∫ x in Ioi (0:ℝ), x ^ q * exp (- b * x ^ p) =
      b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p) := by
  calc
    _ = ∫ x in Ioi (0:ℝ), b ^ (-p⁻¹ * q) * ((b ^ p⁻¹ * x) ^ q * rexp (-(b ^ p⁻¹ * x) ^ p)) := by
      refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
      

Proof state:
p q b : ℝ
hp : 0 < p
hq : -1 < q
hb : 0 < b
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ x✝ ^ q * rexp (-b * x✝ ^ p) = b ^ (-p⁻¹ * q) * ((b ^ p⁻¹ * x✝) ^ q * rexp (-(b ^ p⁻¹ * x✝) ^ p))

Next tactic:
rw [mul_rpow _ (le_of_lt hx), mul_rpow _ (le_of_lt hx), ← rpow_mul, ← rpow_mul,
        inv_mul_cancel, rpow_one, mul_assoc, ← mul_assoc, ← rpow_add, neg_mul p⁻¹, add_left_neg,
        rpow_zero, one_mul, neg_mul]