l3lab/ntp-mathlib huggingface dataset:
theorem image_coe_ball (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' ball (α := ℍ) z r = ball ↑(z.center r) (z.im * Real.sinh r) := by
  

Proof state:
z✝ w : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
⊢ UpperHalfPlane.coe '' ball z r = ball (↑(center z r)) (im z * Real.sinh r)

Next tactic:
ext w
theorem image_coe_ball (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' ball (α := ℍ) z r = ball ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; 

Proof state:
case h
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℂ
⊢ w ∈ UpperHalfPlane.coe '' ball z r ↔ w ∈ ball (↑(center z r)) (im z * Real.sinh r)

Next tactic:
constructor
theorem image_coe_ball (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' ball (α := ℍ) z r = ball ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · 

Proof state:
case h.mp
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℂ
⊢ w ∈ UpperHalfPlane.coe '' ball z r → w ∈ ball (↑(center z r)) (im z * Real.sinh r)

Next tactic:
rintro ⟨w, hw, rfl⟩
theorem image_coe_ball (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' ball (α := ℍ) z r = ball ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · rintro ⟨w, hw, rfl⟩
    

Proof state:
case h.mp.intro.intro
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℍ
hw : w ∈ ball z r
⊢ ↑w ∈ ball (↑(center z r)) (im z * Real.sinh r)

Next tactic:
exact dist_lt_iff_dist_coe_center_lt.1 hw
theorem image_coe_ball (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' ball (α := ℍ) z r = ball ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · rintro ⟨w, hw, rfl⟩
    exact dist_lt_iff_dist_coe_center_lt.1 hw
  · 

Proof state:
case h.mpr
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℂ
⊢ w ∈ ball (↑(center z r)) (im z * Real.sinh r) → w ∈ UpperHalfPlane.coe '' ball z r

Next tactic:
intro hw
theorem image_coe_ball (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' ball (α := ℍ) z r = ball ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · rintro ⟨w, hw, rfl⟩
    exact dist_lt_iff_dist_coe_center_lt.1 hw
  · intro hw
    

Proof state:
case h.mpr
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℂ
hw : w ∈ ball (↑(center z r)) (im z * Real.sinh r)
⊢ w ∈ UpperHalfPlane.coe '' ball z r

Next tactic:
lift w to ℍ using im_pos_of_dist_center_le (ball_subset_closedBall hw)
theorem image_coe_ball (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' ball (α := ℍ) z r = ball ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · rintro ⟨w, hw, rfl⟩
    exact dist_lt_iff_dist_coe_center_lt.1 hw
  · intro hw
    lift w to ℍ using im_pos_of_dist_center_le (ball_subset_closedBall hw)
    

Proof state:
case h.mpr.intro
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℍ
hw : ↑w ∈ ball (↑(center z r)) (im z * Real.sinh r)
⊢ ↑w ∈ UpperHalfPlane.coe '' ball z r

Next tactic:
exact mem_image_of_mem _ (dist_lt_iff_dist_coe_center_lt.2 hw)
theorem image_coe_sphere (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' sphere (α := ℍ) z r = sphere ↑(z.center r) (z.im * Real.sinh r) := by
  

Proof state:
z✝ w : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
⊢ UpperHalfPlane.coe '' sphere z r = sphere (↑(center z r)) (im z * Real.sinh r)

Next tactic:
ext w
theorem image_coe_sphere (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' sphere (α := ℍ) z r = sphere ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; 

Proof state:
case h
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℂ
⊢ w ∈ UpperHalfPlane.coe '' sphere z r ↔ w ∈ sphere (↑(center z r)) (im z * Real.sinh r)

Next tactic:
constructor
theorem image_coe_sphere (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' sphere (α := ℍ) z r = sphere ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · 

Proof state:
case h.mp
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℂ
⊢ w ∈ UpperHalfPlane.coe '' sphere z r → w ∈ sphere (↑(center z r)) (im z * Real.sinh r)

Next tactic:
rintro ⟨w, hw, rfl⟩
theorem image_coe_sphere (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' sphere (α := ℍ) z r = sphere ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · rintro ⟨w, hw, rfl⟩
    

Proof state:
case h.mp.intro.intro
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℍ
hw : w ∈ sphere z r
⊢ ↑w ∈ sphere (↑(center z r)) (im z * Real.sinh r)

Next tactic:
exact dist_eq_iff_dist_coe_center_eq.1 hw
theorem image_coe_sphere (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' sphere (α := ℍ) z r = sphere ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · rintro ⟨w, hw, rfl⟩
    exact dist_eq_iff_dist_coe_center_eq.1 hw
  · 

Proof state:
case h.mpr
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℂ
⊢ w ∈ sphere (↑(center z r)) (im z * Real.sinh r) → w ∈ UpperHalfPlane.coe '' sphere z r

Next tactic:
intro hw
theorem image_coe_sphere (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' sphere (α := ℍ) z r = sphere ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · rintro ⟨w, hw, rfl⟩
    exact dist_eq_iff_dist_coe_center_eq.1 hw
  · intro hw
    

Proof state:
case h.mpr
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℂ
hw : w ∈ sphere (↑(center z r)) (im z * Real.sinh r)
⊢ w ∈ UpperHalfPlane.coe '' sphere z r

Next tactic:
lift w to ℍ using im_pos_of_dist_center_le (sphere_subset_closedBall hw)
theorem image_coe_sphere (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' sphere (α := ℍ) z r = sphere ↑(z.center r) (z.im * Real.sinh r) := by
  ext w; constructor
  · rintro ⟨w, hw, rfl⟩
    exact dist_eq_iff_dist_coe_center_eq.1 hw
  · intro hw
    lift w to ℍ using im_pos_of_dist_center_le (sphere_subset_closedBall hw)
    

Proof state:
case h.mpr.intro
z✝ w✝ : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
w : ℍ
hw : ↑w ∈ sphere (↑(center z r)) (im z * Real.sinh r)
⊢ ↑w ∈ UpperHalfPlane.coe '' sphere z r

Next tactic:
exact mem_image_of_mem _ (dist_eq_iff_dist_coe_center_eq.2 hw)
instance : ProperSpace ℍ := by
  

Proof state:
z w : ℍ
r R : ℝ
⊢ ProperSpace ℍ

Next tactic:
refine' ⟨fun z r => _⟩
instance : ProperSpace ℍ := by
  refine' ⟨fun z r => _⟩
  

Proof state:
z✝ w : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
⊢ IsCompact (closedBall z r)

Next tactic:
rw [inducing_subtype_val.isCompact_iff (f := ((↑) : ℍ → ℂ)), image_coe_closedBall]
instance : ProperSpace ℍ := by
  refine' ⟨fun z r => _⟩
  rw [inducing_subtype_val.isCompact_iff (f := ((↑) : ℍ → ℂ)), image_coe_closedBall]
  

Proof state:
z✝ w : ℍ
r✝ R : ℝ
z : ℍ
r : ℝ
⊢ IsCompact (closedBall (↑(center z r)) (im z * Real.sinh r))

Next tactic:
apply isCompact_closedBall
theorem isometry_vertical_line (a : ℝ) : Isometry fun y => mk ⟨a, exp y⟩ (exp_pos y) := by
  

Proof state:
z w : ℍ
r R a : ℝ
⊢ Isometry fun y => mk { re := a, im := rexp y } (_ : 0 < rexp y)

Next tactic:
refine' Isometry.of_dist_eq fun y₁ y₂ => _
theorem isometry_vertical_line (a : ℝ) : Isometry fun y => mk ⟨a, exp y⟩ (exp_pos y) := by
  refine' Isometry.of_dist_eq fun y₁ y₂ => _
  

Proof state:
z w : ℍ
r R a y₁ y₂ : ℝ
⊢ dist (mk { re := a, im := rexp y₁ } (_ : 0 < rexp y₁)) (mk { re := a, im := rexp y₂ } (_ : 0 < rexp y₂)) = dist y₁ y₂

Next tactic:
rw [dist_of_re_eq]
theorem isometry_vertical_line (a : ℝ) : Isometry fun y => mk ⟨a, exp y⟩ (exp_pos y) := by
  refine' Isometry.of_dist_eq fun y₁ y₂ => _
  rw [dist_of_re_eq]
  

Proof state:
z w : ℍ
r R a y₁ y₂ : ℝ
⊢ dist (log (im (mk { re := a, im := rexp y₁ } (_ : 0 < rexp y₁))))
      (log (im (mk { re := a, im := rexp y₂ } (_ : 0 < rexp y₂)))) =
    dist y₁ y₂
z w : ℍ
r R a y₁ y₂ : ℝ
⊢ re (mk { re := a, im := rexp y₁ } (_ : 0 < rexp y₁)) = re (mk { re := a, im := rexp y₂ } (_ : 0 < rexp y₂))

Next tactic:
exacts [congr_arg₂ _ (log_exp _) (log_exp _), rfl]
theorem isometry_real_vadd (a : ℝ) : Isometry (a +ᵥ · : ℍ → ℍ) :=
  Isometry.of_dist_eq fun y₁ y₂ => by 

Proof state:
z w : ℍ
r R a : ℝ
y₁ y₂ : ℍ
⊢ dist (a +ᵥ y₁) (a +ᵥ y₂) = dist y₁ y₂

Next tactic:
simp only [dist_eq, coe_vadd, vadd_im, dist_add_left]
theorem isometry_pos_mul (a : { x : ℝ // 0 < x }) : Isometry (a • · : ℍ → ℍ) := by
  

Proof state:
z w : ℍ
r R : ℝ
a : { x // 0 < x }
⊢ Isometry fun x => a • x

Next tactic:
refine' Isometry.of_dist_eq fun y₁ y₂ => _
theorem isometry_pos_mul (a : { x : ℝ // 0 < x }) : Isometry (a • · : ℍ → ℍ) := by
  refine' Isometry.of_dist_eq fun y₁ y₂ => _
  

Proof state:
z w : ℍ
r R : ℝ
a : { x // 0 < x }
y₁ y₂ : ℍ
⊢ dist (a • y₁) (a • y₂) = dist y₁ y₂

Next tactic:
simp only [dist_eq, coe_pos_real_smul, pos_real_im]
theorem isometry_pos_mul (a : { x : ℝ // 0 < x }) : Isometry (a • · : ℍ → ℍ) := by
  refine' Isometry.of_dist_eq fun y₁ y₂ => _
  simp only [dist_eq, coe_pos_real_smul, pos_real_im]; 

Proof state:
z w : ℍ
r R : ℝ
a : { x // 0 < x }
y₁ y₂ : ℍ
⊢ 2 * arsinh (dist (↑a • ↑y₁) (↑a • ↑y₂) / (2 * sqrt (↑a * im y₁ * (↑a * im y₂)))) =
    2 * arsinh (dist ↑y₁ ↑y₂ / (2 * sqrt (im y₁ * im y₂)))

Next tactic:
congr 2
theorem isometry_pos_mul (a : { x : ℝ // 0 < x }) : Isometry (a • · : ℍ → ℍ) := by
  refine' Isometry.of_dist_eq fun y₁ y₂ => _
  simp only [dist_eq, coe_pos_real_smul, pos_real_im]; congr 2
  

Proof state:
case e_a.e_x
z w : ℍ
r R : ℝ
a : { x // 0 < x }
y₁ y₂ : ℍ
⊢ dist (↑a • ↑y₁) (↑a • ↑y₂) / (2 * sqrt (↑a * im y₁ * (↑a * im y₂))) = dist ↑y₁ ↑y₂ / (2 * sqrt (im y₁ * im y₂))

Next tactic:
rw [dist_smul₀, mul_mul_mul_comm, Real.sqrt_mul (mul_self_nonneg _), Real.sqrt_mul_self_eq_abs,
    Real.norm_eq_abs, mul_left_comm]
theorem isometry_pos_mul (a : { x : ℝ // 0 < x }) : Isometry (a • · : ℍ → ℍ) := by
  refine' Isometry.of_dist_eq fun y₁ y₂ => _
  simp only [dist_eq, coe_pos_real_smul, pos_real_im]; congr 2
  rw [dist_smul₀, mul_mul_mul_comm, Real.sqrt_mul (mul_self_nonneg _), Real.sqrt_mul_self_eq_abs,
    Real.norm_eq_abs, mul_left_comm]
  

Proof state:
case e_a.e_x
z w : ℍ
r R : ℝ
a : { x // 0 < x }
y₁ y₂ : ℍ
⊢ |↑a| * dist ↑y₁ ↑y₂ / (|↑a| * (2 * sqrt (im y₁ * im y₂))) = dist ↑y₁ ↑y₂ / (2 * sqrt (im y₁ * im y₂))

Next tactic:
exact mul_div_mul_left _ _ (mt _root_.abs_eq_zero.1 a.2.ne')
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    

Proof state:
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
⊢ Isometry fun x => g • x

Next tactic:
have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        

Proof state:
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
y₁ y₂ : ℍ
⊢ dist (ModularGroup.S • y₁) (ModularGroup.S • y₂) = dist y₁ y₂

Next tactic:
have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        

Proof state:
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
y₁ y₂ : ℍ
h₁ : 0 ≤ im y₁ * im y₂
⊢ dist (ModularGroup.S • y₁) (ModularGroup.S • y₂) = dist y₁ y₂

Next tactic:
have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by 

Proof state:
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
y₁ y₂ : ℍ
h₁ : 0 ≤ im y₁ * im y₂
⊢ Complex.abs (↑y₁ * ↑y₂) ≠ 0

Next tactic:
simp [y₁.ne_zero, y₂.ne_zero]
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        

Proof state:
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
y₁ y₂ : ℍ
h₁ : 0 ≤ im y₁ * im y₂
h₂ : Complex.abs (↑y₁ * ↑y₂) ≠ 0
⊢ dist (ModularGroup.S • y₁) (ModularGroup.S • y₂) = dist y₁ y₂

Next tactic:
simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
    

Proof state:
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
h₀ : Isometry fun z => ModularGroup.S • z
⊢ Isometry fun x => g • x

Next tactic:
by_cases hc : g 1 0 = 0
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
    by_cases hc : g 1 0 = 0
    · 

Proof state:
case pos
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
h₀ : Isometry fun z => ModularGroup.S • z
hc : ↑g 1 0 = 0
⊢ Isometry fun x => g • x

Next tactic:
obtain ⟨u, v, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_eq_zero g hc
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
    by_cases hc : g 1 0 = 0
    · obtain ⟨u, v, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_eq_zero g hc
      

Proof state:
case pos.intro.intro
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
h₀ : Isometry fun z => ModularGroup.S • z
hc : ↑g 1 0 = 0
u : { x // 0 < x }
v : ℝ
h : (fun x => g • x) = (fun x => v +ᵥ x) ∘ fun x => u • x
⊢ Isometry fun x => g • x

Next tactic:
rw [h]
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
    by_cases hc : g 1 0 = 0
    · obtain ⟨u, v, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_eq_zero g hc
      rw [h]
      

Proof state:
case pos.intro.intro
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
h₀ : Isometry fun z => ModularGroup.S • z
hc : ↑g 1 0 = 0
u : { x // 0 < x }
v : ℝ
h : (fun x => g • x) = (fun x => v +ᵥ x) ∘ fun x => u • x
⊢ Isometry ((fun x => v +ᵥ x) ∘ fun x => u • x)

Next tactic:
exact (isometry_real_vadd v).comp (isometry_pos_mul u)
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
    by_cases hc : g 1 0 = 0
    · obtain ⟨u, v, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_eq_zero g hc
      rw [h]
      exact (isometry_real_vadd v).comp (isometry_pos_mul u)
    · 

Proof state:
case neg
z w : ℍ
r R : ℝ
g : SL(2, ℝ)
h₀ : Isometry fun z => ModularGroup.S • z
hc : ¬↑g 1 0 = 0
⊢ Isometry fun x => g • x

Next tactic:
obtain ⟨u, v, w, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_ne_zero g hc
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
    by_cases hc : g 1 0 = 0
    · obtain ⟨u, v, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_eq_zero g hc
      rw [h]
      exact (isometry_real_vadd v).comp (isometry_pos_mul u)
    · obtain ⟨u, v, w, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_ne_zero g hc
      

Proof state:
case neg.intro.intro.intro
z w✝ : ℍ
r R : ℝ
g : SL(2, ℝ)
h₀ : Isometry fun z => ModularGroup.S • z
hc : ¬↑g 1 0 = 0
u : { x // 0 < x }
v w : ℝ
h : (fun x => g • x) = (fun x => w +ᵥ x) ∘ (fun x => ModularGroup.S • x) ∘ (fun x => v +ᵥ x) ∘ fun x => u • x
⊢ Isometry fun x => g • x

Next tactic:
rw [h]
/-- `SL(2, ℝ)` acts on the upper half plane as an isometry.-/
instance : IsometricSMul SL(2, ℝ) ℍ :=
  ⟨fun g => by
    have h₀ : Isometry (fun z => ModularGroup.S • z : ℍ → ℍ) :=
      Isometry.of_dist_eq fun y₁ y₂ => by
        have h₁ : 0 ≤ im y₁ * im y₂ := mul_nonneg y₁.property.le y₂.property.le
        have h₂ : Complex.abs (y₁ * y₂) ≠ 0 := by simp [y₁.ne_zero, y₂.ne_zero]
        simp only [dist_eq, modular_S_smul, inv_neg, neg_div, div_mul_div_comm, coe_mk, mk_im,
          div_one, Complex.inv_im, Complex.neg_im, coe_im, neg_neg, Complex.normSq_neg,
          mul_eq_mul_left_iff, Real.arsinh_inj, bit0_eq_zero, one_ne_zero, or_false_iff,
          dist_neg_neg, mul_neg, neg_mul, dist_inv_inv₀ y₁.ne_zero y₂.ne_zero, ←
          AbsoluteValue.map_mul, ← Complex.normSq_mul, Real.sqrt_div h₁, ← Complex.abs_apply,
          mul_div (2 : ℝ), div_div_div_comm, div_self h₂, Complex.norm_eq_abs]
    by_cases hc : g 1 0 = 0
    · obtain ⟨u, v, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_eq_zero g hc
      rw [h]
      exact (isometry_real_vadd v).comp (isometry_pos_mul u)
    · obtain ⟨u, v, w, h⟩ := exists_SL2_smul_eq_of_apply_zero_one_ne_zero g hc
      rw [h]
      

Proof state:
case neg.intro.intro.intro
z w✝ : ℍ
r R : ℝ
g : SL(2, ℝ)
h₀ : Isometry fun z => ModularGroup.S • z
hc : ¬↑g 1 0 = 0
u : { x // 0 < x }
v w : ℝ
h : (fun x => g • x) = (fun x => w +ᵥ x) ∘ (fun x => ModularGroup.S • x) ∘ (fun x => v +ᵥ x) ∘ fun x => u • x
⊢ Isometry ((fun x => w +ᵥ x) ∘ (fun x => ModularGroup.S • x) ∘ (fun x => v +ᵥ x) ∘ fun x => u • x)

Next tactic:
exact
        (isometry_real_vadd w).comp (h₀.comp <| (isometry_real_vadd v).comp <| isometry_pos_mul u)
lemma iCondIndepSets_iff (π : ι → Set (Set Ω)) (hπ : ∀ i s (_hs : s ∈ π i), MeasurableSet s)
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' π μ ↔ ∀ (s : Finset ι) {f : ι → Set Ω} (_H : ∀ i, i ∈ s → f i ∈ π i),
      μ⟦⋂ i ∈ s, f i | m'⟧ =ᵐ[μ] ∏ i in s, (μ⟦f i | m'⟧) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
π : ι → Set (Set Ω)
hπ : ∀ (i : ι), ∀ s ∈ π i, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
⊢ iCondIndepSets m' hm' π ↔
    ∀ (s : Finset ι) {f : ι → Set Ω},
      (∀ i ∈ s, f i ∈ π i) →
        μ[Set.indicator (⋂ i ∈ s, f i) fun ω => 1|m'] =ᵐ[μ] ∏ i in s, μ[Set.indicator (f i) fun ω => 1|m']

Next tactic:
simp only [iCondIndepSets, kernel.iIndepSets]
lemma iCondIndepSets_iff (π : ι → Set (Set Ω)) (hπ : ∀ i s (_hs : s ∈ π i), MeasurableSet s)
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' π μ ↔ ∀ (s : Finset ι) {f : ι → Set Ω} (_H : ∀ i, i ∈ s → f i ∈ π i),
      μ⟦⋂ i ∈ s, f i | m'⟧ =ᵐ[μ] ∏ i in s, (μ⟦f i | m'⟧) := by
  simp only [iCondIndepSets, kernel.iIndepSets]
  

Proof state:
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
π : ι → Set (Set Ω)
hπ : ∀ (i : ι), ∀ s ∈ π i, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
⊢ (∀ (s : Finset ι) {f : ι → Set Ω},
      (∀ i ∈ s, f i ∈ π i) →
        ∀ᵐ (a : Ω) ∂Measure.trim μ hm',
          ↑↑((condexpKernel μ m') a) (⋂ i ∈ s, f i) = ∏ i in s, ↑↑((condexpKernel μ m') a) (f i)) ↔
    ∀ (s : Finset ι) {f : ι → Set Ω},
      (∀ i ∈ s, f i ∈ π i) →
        μ[Set.indicator (⋂ i ∈ s, f i) fun ω => 1|m'] =ᵐ[μ] ∏ i in s, μ[Set.indicator (f i) fun ω => 1|m']

Next tactic:
have h_eq' : ∀ (s : Finset ι) (f : ι → Set Ω) (_H : ∀ i, i ∈ s → f i ∈ π i) i (_hi : i ∈ s),
      (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω (f i))) =ᵐ[μ] μ⟦f i | m'⟧ :=
    fun s f H i hi ↦ condexpKernel_ae_eq_condexp hm' (hπ i (f i) (H i hi))