l3lab/ntp-mathlib huggingface dataset:
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  

Proof state:
b : ℂ
hb : 0 < b.re
⊢ ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) = (↑π / b) ^ (1 / 2) / 2

Next tactic:
have full_integral := integral_gaussian_complex hb
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  

Proof state:
b : ℂ
hb : 0 < b.re
full_integral : ∫ (x : ℝ), cexp (-b * ↑x ^ 2) = (↑π / b) ^ (1 / 2)
⊢ ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) = (↑π / b) ^ (1 / 2) / 2

Next tactic:
have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  

Proof state:
b : ℂ
hb : 0 < b.re
full_integral : ∫ (x : ℝ), cexp (-b * ↑x ^ 2) = (↑π / b) ^ (1 / 2)
this : MeasurableSet (Ioi 0)
⊢ ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) = (↑π / b) ^ (1 / 2) / 2

Next tactic:
rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this : MeasurableSet (Ioi 0)
⊢ ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) = (↑π / b) ^ (1 / 2) / 2

Next tactic:
suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2)
⊢ ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) = (↑π / b) ^ (1 / 2) / 2

Next tactic:
rw [this, ← mul_two] at full_integral
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    

Proof state:
b : ℂ
hb : 0 < b.re
full_integral : (∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume) * 2 = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2)
⊢ ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) = (↑π / b) ^ (1 / 2) / 2

Next tactic:
rwa [eq_div_iff]
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; 

Proof state:
b : ℂ
hb : 0 < b.re
full_integral : (∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume) * 2 = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2)
⊢ 2 ≠ 0

Next tactic:
exact two_ne_zero
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this : MeasurableSet (Ioi 0)
⊢ ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2)

Next tactic:
have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
    simpa [zero_sub, neg_sq, neg_zero] using this
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this : MeasurableSet (Ioi 0)
⊢ ∀ (c : ℝ), ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)

Next tactic:
intro c
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this : MeasurableSet (Ioi 0)
c : ℝ
⊢ ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)

Next tactic:
have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
    

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
c : ℝ
this : ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑(0 - x) ^ 2) = ∫ (x : ℝ) in 0 - c..0 - 0, cexp (-b * ↑x ^ 2)
⊢ ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)

Next tactic:
simpa [zero_sub, neg_sq, neg_zero] using this
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
    simpa [zero_sub, neg_sq, neg_zero] using this
  

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∀ (c : ℝ), ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)
⊢ ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2)

Next tactic:
have t1 :=
    intervalIntegral_tendsto_integral_Ioi 0 (integrable_cexp_neg_mul_sq hb).integrableOn tendsto_id
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
    simpa [zero_sub, neg_sq, neg_zero] using this
  have t1 :=
    intervalIntegral_tendsto_integral_Ioi 0 (integrable_cexp_neg_mul_sq hb).integrableOn tendsto_id
  

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∀ (c : ℝ), ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)
t1 :
  Tendsto (fun i => ∫ (x : ℝ) in 0 ..id i, cexp (-b * ↑x ^ 2)) atTop
    (𝓝 (∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume))
⊢ ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2)

Next tactic:
have t2 :
    Tendsto (fun c : ℝ => ∫ x : ℝ in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2)) atTop
      (𝓝 (∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2))) := by
    simp_rw [this]
    refine' intervalIntegral_tendsto_integral_Iic _ _ tendsto_neg_atTop_atBot
    apply (integrable_cexp_neg_mul_sq hb).integrableOn
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
    simpa [zero_sub, neg_sq, neg_zero] using this
  have t1 :=
    intervalIntegral_tendsto_integral_Ioi 0 (integrable_cexp_neg_mul_sq hb).integrableOn tendsto_id
  have t2 :
    Tendsto (fun c : ℝ => ∫ x : ℝ in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2)) atTop
      (𝓝 (∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2))) := by
    

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∀ (c : ℝ), ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)
t1 :
  Tendsto (fun i => ∫ (x : ℝ) in 0 ..id i, cexp (-b * ↑x ^ 2)) atTop
    (𝓝 (∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume))
⊢ Tendsto (fun c => ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2)) atTop (𝓝 (∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2)))

Next tactic:
simp_rw [this]
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
    simpa [zero_sub, neg_sq, neg_zero] using this
  have t1 :=
    intervalIntegral_tendsto_integral_Ioi 0 (integrable_cexp_neg_mul_sq hb).integrableOn tendsto_id
  have t2 :
    Tendsto (fun c : ℝ => ∫ x : ℝ in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2)) atTop
      (𝓝 (∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2))) := by
    simp_rw [this]
    

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∀ (c : ℝ), ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)
t1 :
  Tendsto (fun i => ∫ (x : ℝ) in 0 ..id i, cexp (-b * ↑x ^ 2)) atTop
    (𝓝 (∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume))
⊢ Tendsto (fun c => ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)) atTop (𝓝 (∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2)))

Next tactic:
refine' intervalIntegral_tendsto_integral_Iic _ _ tendsto_neg_atTop_atBot
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
    simpa [zero_sub, neg_sq, neg_zero] using this
  have t1 :=
    intervalIntegral_tendsto_integral_Ioi 0 (integrable_cexp_neg_mul_sq hb).integrableOn tendsto_id
  have t2 :
    Tendsto (fun c : ℝ => ∫ x : ℝ in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2)) atTop
      (𝓝 (∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2))) := by
    simp_rw [this]
    refine' intervalIntegral_tendsto_integral_Iic _ _ tendsto_neg_atTop_atBot
    

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∀ (c : ℝ), ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)
t1 :
  Tendsto (fun i => ∫ (x : ℝ) in 0 ..id i, cexp (-b * ↑x ^ 2)) atTop
    (𝓝 (∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume))
⊢ IntegrableOn (fun x => cexp (-b * ↑x ^ 2)) (Iic 0)

Next tactic:
apply (integrable_cexp_neg_mul_sq hb).integrableOn
theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by
  have full_integral := integral_gaussian_complex hb
  have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
  suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by
    rw [this, ← mul_two] at full_integral
    rwa [eq_div_iff]; exact two_ne_zero
  have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
      ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
    intro c
    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
    simpa [zero_sub, neg_sq, neg_zero] using this
  have t1 :=
    intervalIntegral_tendsto_integral_Ioi 0 (integrable_cexp_neg_mul_sq hb).integrableOn tendsto_id
  have t2 :
    Tendsto (fun c : ℝ => ∫ x : ℝ in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2)) atTop
      (𝓝 (∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2))) := by
    simp_rw [this]
    refine' intervalIntegral_tendsto_integral_Iic _ _ tendsto_neg_atTop_atBot
    apply (integrable_cexp_neg_mul_sq hb).integrableOn
  

Proof state:
b : ℂ
hb : 0 < b.re
full_integral :
  ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume + ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) ∂volume = (↑π / b) ^ (1 / 2)
this✝ : MeasurableSet (Ioi 0)
this : ∀ (c : ℝ), ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in -c..0, cexp (-b * ↑x ^ 2)
t1 :
  Tendsto (fun i => ∫ (x : ℝ) in 0 ..id i, cexp (-b * ↑x ^ 2)) atTop
    (𝓝 (∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2) ∂volume))
t2 : Tendsto (fun c => ∫ (x : ℝ) in 0 ..c, cexp (-b * ↑x ^ 2)) atTop (𝓝 (∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2)))
⊢ ∫ (x : ℝ) in Iic 0, cexp (-b * ↑x ^ 2) = ∫ (x : ℝ) in Ioi 0, cexp (-b * ↑x ^ 2)

Next tactic:
exact tendsto_nhds_unique t2 t1
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  

Proof state:
b : ℝ
⊢ ∫ (x : ℝ) in Ioi 0, rexp (-b * x ^ 2) = sqrt (π / b) / 2

Next tactic:
rcases le_or_lt b 0 with (hb | hb)
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · 

Proof state:
case inl
b : ℝ
hb : b ≤ 0
⊢ ∫ (x : ℝ) in Ioi 0, rexp (-b * x ^ 2) = sqrt (π / b) / 2

Next tactic:
rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
    

Proof state:
case inl
b : ℝ
hb : b ≤ 0
⊢ π / b ≤ 0
case inl b : ℝ hb : b ≤ 0 ⊢ ¬Integrable fun x => rexp (-b * x ^ 2)

Next tactic:
exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
    exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
    

Proof state:
case inl
b : ℝ
hb : b ≤ 0
⊢ ¬Integrable fun x => rexp (-b * x ^ 2)

Next tactic:
rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
    exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
    rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
  

Proof state:
case inr
b : ℝ
hb : 0 < b
⊢ ∫ (x : ℝ) in Ioi 0, rexp (-b * x ^ 2) = sqrt (π / b) / 2

Next tactic:
rw [← IsROrC.ofReal_inj (K := ℂ), ← integral_ofReal, ← IsROrC.algebraMap_eq_ofReal,
    coe_algebraMap]
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
    exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
    rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
  rw [← IsROrC.ofReal_inj (K := ℂ), ← integral_ofReal, ← IsROrC.algebraMap_eq_ofReal,
    coe_algebraMap]
  

Proof state:
case inr
b : ℝ
hb : 0 < b
⊢ ∫ (a : ℝ) in Ioi 0, ↑(rexp (-b * a ^ 2)) = ↑(sqrt (π / b) / 2)

Next tactic:
convert integral_gaussian_complex_Ioi (by rwa [ofReal_re] : 0 < (b : ℂ).re)
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
    exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
    rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
  rw [← IsROrC.ofReal_inj (K := ℂ), ← integral_ofReal, ← IsROrC.algebraMap_eq_ofReal,
    coe_algebraMap]
  convert integral_gaussian_complex_Ioi (by 

Proof state:
b : ℝ
hb : 0 < b
⊢ 0 < (↑b).re

Next tactic:
rwa [ofReal_re]
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
    exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
    rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
  rw [← IsROrC.ofReal_inj (K := ℂ), ← integral_ofReal, ← IsROrC.algebraMap_eq_ofReal,
    coe_algebraMap]
  convert integral_gaussian_complex_Ioi (by rwa [ofReal_re] : 0 < (b : ℂ).re)
  · 

Proof state:
case h.e'_2.h.e'_7.h
b : ℝ
hb : 0 < b
x✝ : ℝ
⊢ ↑(rexp (-b * x✝ ^ 2)) = cexp (-↑b * ↑x✝ ^ 2)

Next tactic:
simp
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
    exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
    rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
  rw [← IsROrC.ofReal_inj (K := ℂ), ← integral_ofReal, ← IsROrC.algebraMap_eq_ofReal,
    coe_algebraMap]
  convert integral_gaussian_complex_Ioi (by rwa [ofReal_re] : 0 < (b : ℂ).re)
  · simp
  · 

Proof state:
case h.e'_3
b : ℝ
hb : 0 < b
⊢ ↑(sqrt (π / b) / 2) = (↑π / ↑b) ^ (1 / 2) / 2

Next tactic:
rw [sqrt_eq_rpow, ← ofReal_div, ofReal_div, ofReal_cpow]
theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
  rcases le_or_lt b 0 with (hb | hb)
  · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
    exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
    rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
  rw [← IsROrC.ofReal_inj (K := ℂ), ← integral_ofReal, ← IsROrC.algebraMap_eq_ofReal,
    coe_algebraMap]
  convert integral_gaussian_complex_Ioi (by rwa [ofReal_re] : 0 < (b : ℂ).re)
  · simp
  · rw [sqrt_eq_rpow, ← ofReal_div, ofReal_div, ofReal_cpow]
    

Proof state:
case h.e'_3
b : ℝ
hb : 0 < b
⊢ ↑(π / b) ^ ↑(1 / 2) / ↑2 = ↑(π / b) ^ (1 / 2) / 2
case h.e'_3.hx b : ℝ hb : 0 < b ⊢ 0 ≤ π / b

Next tactic:
norm_num