l3lab/ntp-mathlib huggingface dataset:
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  

Proof state:
⊢ LocallyIntegrableOn zetaKernel₂ (Ioi 0)

Next tactic:
refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · 

Proof state:
case refine_1
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ Integrable zetaKernel₁

Next tactic:
refine ContinuousOn.integrableOn_compact hk' ?_
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    

Proof state:
case refine_1
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ ContinuousOn zetaKernel₁ k

Next tactic:
exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · 

Proof state:
case refine_2
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ Integrable (indicator (Ioc 0 1) fun t => (1 - 1 / ↑(sqrt t)) / 2)

Next tactic:
refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    

Proof state:
case refine_2
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ IntegrableOn (fun t => (1 - 1 / ↑(sqrt t)) / 2) (Ioc 0 1)

Next tactic:
rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    

Proof state:
case refine_2
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ IntegrableOn (fun t => (1 - 1 / ↑(sqrt t)) / 2) (Ioc 0 1 ∩ k)
case refine_2 k : Set ℝ hk : k ⊆ Ioi 0 hk' : IsCompact k ⊢ MeasurableSet (Ioc 0 1)

Next tactic:
swap
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · 

Proof state:
case refine_2
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ MeasurableSet (Ioc 0 1)

Next tactic:
exact measurableSet_Ioc
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · exact measurableSet_Ioc
    

Proof state:
case refine_2
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ IntegrableOn (fun t => (1 - 1 / ↑(sqrt t)) / 2) (Ioc 0 1 ∩ k)

Next tactic:
apply ContinuousOn.integrableOn_compact
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · exact measurableSet_Ioc
    apply ContinuousOn.integrableOn_compact
    · 

Proof state:
case refine_2.hK
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ IsCompact (Ioc 0 1 ∩ k)

Next tactic:
convert (isCompact_Icc : IsCompact <| Icc (0 : ℝ) 1).inter hk' using 1
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · exact measurableSet_Ioc
    apply ContinuousOn.integrableOn_compact
    · convert (isCompact_Icc : IsCompact <| Icc (0 : ℝ) 1).inter hk' using 1
      

Proof state:
case h.e'_3
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ Ioc 0 1 ∩ k = Icc 0 1 ∩ k

Next tactic:
exact
        Set.ext fun t => ⟨fun h => ⟨Ioc_subset_Icc_self h.1, h.2⟩, fun h => ⟨⟨hk h.2, h.1.2⟩, h.2⟩⟩
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · exact measurableSet_Ioc
    apply ContinuousOn.integrableOn_compact
    · convert (isCompact_Icc : IsCompact <| Icc (0 : ℝ) 1).inter hk' using 1
      exact
        Set.ext fun t => ⟨fun h => ⟨Ioc_subset_Icc_self h.1, h.2⟩, fun h => ⟨⟨hk h.2, h.1.2⟩, h.2⟩⟩
    · 

Proof state:
case refine_2.hf
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ ContinuousOn (fun t => (1 - 1 / ↑(sqrt t)) / 2) (Ioc 0 1 ∩ k)

Next tactic:
refine ContinuousOn.mono ?_ ((inter_subset_right _ _).trans hk)
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · exact measurableSet_Ioc
    apply ContinuousOn.integrableOn_compact
    · convert (isCompact_Icc : IsCompact <| Icc (0 : ℝ) 1).inter hk' using 1
      exact
        Set.ext fun t => ⟨fun h => ⟨Ioc_subset_Icc_self h.1, h.2⟩, fun h => ⟨⟨hk h.2, h.1.2⟩, h.2⟩⟩
    · refine ContinuousOn.mono ?_ ((inter_subset_right _ _).trans hk)
      

Proof state:
case refine_2.hf
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ ContinuousOn (fun t => (1 - 1 / ↑(sqrt t)) / 2) (Ioi 0)

Next tactic:
refine (continuousOn_const.sub ?_).div_const _
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · exact measurableSet_Ioc
    apply ContinuousOn.integrableOn_compact
    · convert (isCompact_Icc : IsCompact <| Icc (0 : ℝ) 1).inter hk' using 1
      exact
        Set.ext fun t => ⟨fun h => ⟨Ioc_subset_Icc_self h.1, h.2⟩, fun h => ⟨⟨hk h.2, h.1.2⟩, h.2⟩⟩
    · refine ContinuousOn.mono ?_ ((inter_subset_right _ _).trans hk)
      refine (continuousOn_const.sub ?_).div_const _
      

Proof state:
case refine_2.hf
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ ContinuousOn (fun t => 1 / ↑(sqrt t)) (Ioi 0)

Next tactic:
refine ContinuousOn.div continuousOn_const ?_ fun x hx => ?_
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · exact measurableSet_Ioc
    apply ContinuousOn.integrableOn_compact
    · convert (isCompact_Icc : IsCompact <| Icc (0 : ℝ) 1).inter hk' using 1
      exact
        Set.ext fun t => ⟨fun h => ⟨Ioc_subset_Icc_self h.1, h.2⟩, fun h => ⟨⟨hk h.2, h.1.2⟩, h.2⟩⟩
    · refine ContinuousOn.mono ?_ ((inter_subset_right _ _).trans hk)
      refine (continuousOn_const.sub ?_).div_const _
      refine ContinuousOn.div continuousOn_const ?_ fun x hx => ?_
      · 

Proof state:
case refine_2.hf.refine_1
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
⊢ ContinuousOn (fun t => ↑(sqrt t)) (Ioi 0)

Next tactic:
exact (continuous_ofReal.comp continuous_sqrt).continuousOn
/-- Local integrability of `zetaKernel₂`. -/
theorem locally_integrable_zetaKernel₂ : LocallyIntegrableOn zetaKernel₂ (Ioi 0) := by
  refine (locallyIntegrableOn_iff (Or.inr isOpen_Ioi)).mpr fun k hk hk' => Integrable.add ?_ ?_
  · refine ContinuousOn.integrableOn_compact hk' ?_
    exact ContinuousAt.continuousOn fun x hx => continuousAt_zetaKernel₁ (hk hx)
  · refine (integrable_indicator_iff measurableSet_Ioc).mpr ?_
    rw [IntegrableOn, Measure.restrict_restrict, ← IntegrableOn]
    swap; · exact measurableSet_Ioc
    apply ContinuousOn.integrableOn_compact
    · convert (isCompact_Icc : IsCompact <| Icc (0 : ℝ) 1).inter hk' using 1
      exact
        Set.ext fun t => ⟨fun h => ⟨Ioc_subset_Icc_self h.1, h.2⟩, fun h => ⟨⟨hk h.2, h.1.2⟩, h.2⟩⟩
    · refine ContinuousOn.mono ?_ ((inter_subset_right _ _).trans hk)
      refine (continuousOn_const.sub ?_).div_const _
      refine ContinuousOn.div continuousOn_const ?_ fun x hx => ?_
      · exact (continuous_ofReal.comp continuous_sqrt).continuousOn
      

Proof state:
case refine_2.hf.refine_2
k : Set ℝ
hk : k ⊆ Ioi 0
hk' : IsCompact k
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(sqrt x) ≠ 0

Next tactic:
exact ofReal_ne_zero.mpr (sqrt_ne_zero'.mpr hx)
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  

Proof state:
t : ℝ
ht : 0 ≤ t
⊢ zetaKernel₂ (1 / t) = ↑(sqrt t) * zetaKernel₂ t

Next tactic:
rcases ht.eq_or_lt with rfl|h't
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · 

Proof state:
case inl
ht : 0 ≤ 0
⊢ zetaKernel₂ (1 / 0) = ↑(sqrt 0) * zetaKernel₂ 0

Next tactic:
simp [zetaKernel₂, zetaKernel₁]
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  

Proof state:
case inr
t : ℝ
ht : 0 ≤ t
h't : 0 < t
⊢ zetaKernel₂ (1 / t) = ↑(sqrt t) * zetaKernel₂ t

Next tactic:
have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    swap; · exact ⟨one_div_pos.mpr (zero_lt_one.trans hu), (one_div u).symm ▸ inv_le_one hu.le⟩
    rw [zetaKernel₁_eq_jacobiTheta (one_div_pos.mpr <| zero_lt_one.trans hu),
      zetaKernel₁_eq_jacobiTheta (zero_lt_one.trans hu), ← add_div, ← mul_div_assoc, add_sub,
      sub_add_cancel, sqrt_div zero_le_one, sqrt_one, one_div (sqrt _), ofReal_inv, ← one_div,
      one_div_one_div, mul_sub, mul_one]
    congr 2
    let τ : UpperHalfPlane := .mk (u * I) ((mul_I_im u).symm ▸ zero_lt_one.trans hu)
    convert jacobiTheta_S_smul τ using 2
    · rw [UpperHalfPlane.modular_S_smul, UpperHalfPlane.coe_mk, UpperHalfPlane.coe_mk, ← neg_inv,
        mul_inv, inv_I, mul_neg, neg_neg, one_div, ofReal_inv]
    · rw [UpperHalfPlane.coe_mk, mul_comm, mul_assoc, mul_neg, I_mul_I, neg_neg, mul_one,
        sqrt_eq_rpow, ofReal_cpow (zero_lt_one.trans hu).le]
      push_cast
      rfl
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    

Proof state:
t : ℝ
ht : 0 ≤ t
h't : 0 < t
⊢ ∀ {u : ℝ}, 1 < u → zetaKernel₂ (1 / u) = ↑(sqrt u) * zetaKernel₂ u

Next tactic:
intro u hu
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    

Proof state:
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
⊢ zetaKernel₂ (1 / u) = ↑(sqrt u) * zetaKernel₂ u

Next tactic:
simp_rw [zetaKernel₂, Pi.add_apply]
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    

Proof state:
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
⊢ zetaKernel₁ (1 / u) + indicator (Ioc 0 1) (fun t => (1 - 1 / ↑(sqrt t)) / 2) (1 / u) =
    ↑(sqrt u) * (zetaKernel₁ u + indicator (Ioc 0 1) (fun t => (1 - 1 / ↑(sqrt t)) / 2) u)

Next tactic:
rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    

Proof state:
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
⊢ zetaKernel₁ (1 / u) + (1 - 1 / ↑(sqrt (1 / u))) / 2 = ↑(sqrt u) * zetaKernel₁ u
case h t : ℝ ht : 0 ≤ t h't : 0 < t u : ℝ hu : 1 < u ⊢ 1 / u ∈ Ioc 0 1

Next tactic:
swap
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    swap; · 

Proof state:
case h
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
⊢ 1 / u ∈ Ioc 0 1

Next tactic:
exact ⟨one_div_pos.mpr (zero_lt_one.trans hu), (one_div u).symm ▸ inv_le_one hu.le⟩
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    swap; · exact ⟨one_div_pos.mpr (zero_lt_one.trans hu), (one_div u).symm ▸ inv_le_one hu.le⟩
    

Proof state:
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
⊢ zetaKernel₁ (1 / u) + (1 - 1 / ↑(sqrt (1 / u))) / 2 = ↑(sqrt u) * zetaKernel₁ u

Next tactic:
rw [zetaKernel₁_eq_jacobiTheta (one_div_pos.mpr <| zero_lt_one.trans hu),
      zetaKernel₁_eq_jacobiTheta (zero_lt_one.trans hu), ← add_div, ← mul_div_assoc, add_sub,
      sub_add_cancel, sqrt_div zero_le_one, sqrt_one, one_div (sqrt _), ofReal_inv, ← one_div,
      one_div_one_div, mul_sub, mul_one]
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    swap; · exact ⟨one_div_pos.mpr (zero_lt_one.trans hu), (one_div u).symm ▸ inv_le_one hu.le⟩
    rw [zetaKernel₁_eq_jacobiTheta (one_div_pos.mpr <| zero_lt_one.trans hu),
      zetaKernel₁_eq_jacobiTheta (zero_lt_one.trans hu), ← add_div, ← mul_div_assoc, add_sub,
      sub_add_cancel, sqrt_div zero_le_one, sqrt_one, one_div (sqrt _), ofReal_inv, ← one_div,
      one_div_one_div, mul_sub, mul_one]
    

Proof state:
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
⊢ (jacobiTheta (↑(1 / u) * I) - ↑(sqrt u)) / 2 = (↑(sqrt u) * jacobiTheta (↑u * I) - ↑(sqrt u)) / 2

Next tactic:
congr 2
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    swap; · exact ⟨one_div_pos.mpr (zero_lt_one.trans hu), (one_div u).symm ▸ inv_le_one hu.le⟩
    rw [zetaKernel₁_eq_jacobiTheta (one_div_pos.mpr <| zero_lt_one.trans hu),
      zetaKernel₁_eq_jacobiTheta (zero_lt_one.trans hu), ← add_div, ← mul_div_assoc, add_sub,
      sub_add_cancel, sqrt_div zero_le_one, sqrt_one, one_div (sqrt _), ofReal_inv, ← one_div,
      one_div_one_div, mul_sub, mul_one]
    congr 2
    

Proof state:
case e_a.e_a
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
⊢ jacobiTheta (↑(1 / u) * I) = ↑(sqrt u) * jacobiTheta (↑u * I)

Next tactic:
let τ : UpperHalfPlane := .mk (u * I) ((mul_I_im u).symm ▸ zero_lt_one.trans hu)
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    swap; · exact ⟨one_div_pos.mpr (zero_lt_one.trans hu), (one_div u).symm ▸ inv_le_one hu.le⟩
    rw [zetaKernel₁_eq_jacobiTheta (one_div_pos.mpr <| zero_lt_one.trans hu),
      zetaKernel₁_eq_jacobiTheta (zero_lt_one.trans hu), ← add_div, ← mul_div_assoc, add_sub,
      sub_add_cancel, sqrt_div zero_le_one, sqrt_one, one_div (sqrt _), ofReal_inv, ← one_div,
      one_div_one_div, mul_sub, mul_one]
    congr 2
    let τ : UpperHalfPlane := .mk (u * I) ((mul_I_im u).symm ▸ zero_lt_one.trans hu)
    

Proof state:
case e_a.e_a
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
τ : UpperHalfPlane := UpperHalfPlane.mk (↑u * I) (_ : 0 < (↑u * I).im)
⊢ jacobiTheta (↑(1 / u) * I) = ↑(sqrt u) * jacobiTheta (↑u * I)

Next tactic:
convert jacobiTheta_S_smul τ using 2
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    swap; · exact ⟨one_div_pos.mpr (zero_lt_one.trans hu), (one_div u).symm ▸ inv_le_one hu.le⟩
    rw [zetaKernel₁_eq_jacobiTheta (one_div_pos.mpr <| zero_lt_one.trans hu),
      zetaKernel₁_eq_jacobiTheta (zero_lt_one.trans hu), ← add_div, ← mul_div_assoc, add_sub,
      sub_add_cancel, sqrt_div zero_le_one, sqrt_one, one_div (sqrt _), ofReal_inv, ← one_div,
      one_div_one_div, mul_sub, mul_one]
    congr 2
    let τ : UpperHalfPlane := .mk (u * I) ((mul_I_im u).symm ▸ zero_lt_one.trans hu)
    convert jacobiTheta_S_smul τ using 2
    · 

Proof state:
case h.e'_2.h.e'_1
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
τ : UpperHalfPlane := UpperHalfPlane.mk (↑u * I) (_ : 0 < (↑u * I).im)
⊢ ↑(1 / u) * I = ↑(ModularGroup.S • τ)

Next tactic:
rw [UpperHalfPlane.modular_S_smul, UpperHalfPlane.coe_mk, UpperHalfPlane.coe_mk, ← neg_inv,
        mul_inv, inv_I, mul_neg, neg_neg, one_div, ofReal_inv]
/-- Functional equation for `zetaKernel₂`. -/
theorem zetaKernel₂_one_div {t : ℝ} (ht : 0 ≤ t) :
    zetaKernel₂ (1 / t) = sqrt t * zetaKernel₂ t := by
  rcases ht.eq_or_lt with rfl|h't
  · simp [zetaKernel₂, zetaKernel₁]
  have aux : ∀ {u : ℝ} (_ : 1 < u), zetaKernel₂ (1 / u) = sqrt u * zetaKernel₂ u := by
    intro u hu
    simp_rw [zetaKernel₂, Pi.add_apply]
    rw [indicator_of_mem, indicator_of_not_mem (not_mem_Ioc_of_gt hu), add_zero]
    swap; · exact ⟨one_div_pos.mpr (zero_lt_one.trans hu), (one_div u).symm ▸ inv_le_one hu.le⟩
    rw [zetaKernel₁_eq_jacobiTheta (one_div_pos.mpr <| zero_lt_one.trans hu),
      zetaKernel₁_eq_jacobiTheta (zero_lt_one.trans hu), ← add_div, ← mul_div_assoc, add_sub,
      sub_add_cancel, sqrt_div zero_le_one, sqrt_one, one_div (sqrt _), ofReal_inv, ← one_div,
      one_div_one_div, mul_sub, mul_one]
    congr 2
    let τ : UpperHalfPlane := .mk (u * I) ((mul_I_im u).symm ▸ zero_lt_one.trans hu)
    convert jacobiTheta_S_smul τ using 2
    · rw [UpperHalfPlane.modular_S_smul, UpperHalfPlane.coe_mk, UpperHalfPlane.coe_mk, ← neg_inv,
        mul_inv, inv_I, mul_neg, neg_neg, one_div, ofReal_inv]
    · 

Proof state:
case h.e'_3.h.e'_5
t : ℝ
ht : 0 ≤ t
h't : 0 < t
u : ℝ
hu : 1 < u
τ : UpperHalfPlane := UpperHalfPlane.mk (↑u * I) (_ : 0 < (↑u * I).im)
⊢ ↑(sqrt u) = (-I * ↑τ) ^ (1 / 2)

Next tactic:
rw [UpperHalfPlane.coe_mk, mul_comm, mul_assoc, mul_neg, I_mul_I, neg_neg, mul_one,
        sqrt_eq_rpow, ofReal_cpow (zero_lt_one.trans hu).le]