l3lab/ntp-mathlib huggingface dataset:
/-- If `s : ι → Set α` is a countable family of pairwise a.e. disjoint sets, then there exists a
family of measurable null sets `t i` such that `s i \ t i` are pairwise disjoint. -/
theorem exists_null_pairwise_disjoint_diff [Countable ι] {s : ι → Set α}
    (hd : Pairwise (AEDisjoint μ on s)) : ∃ t : ι → Set α, (∀ i, MeasurableSet (t i)) ∧
    (∀ i, μ (t i) = 0) ∧ Pairwise (Disjoint on fun i => s i \ t i) := by
  refine' ⟨fun i => toMeasurable μ (s i ∩ ⋃ j ∈ ({i}ᶜ : Set ι), s j), fun i =>
    measurableSet_toMeasurable _ _, fun i => _, _⟩
  · simp only [measure_toMeasurable, inter_iUnion]
    exact (measure_biUnion_null_iff <| to_countable _).2 fun j hj => hd (Ne.symm hj)
  · simp only [Pairwise, disjoint_left, onFun, mem_diff, not_and, and_imp, Classical.not_not]
    intro i j hne x hi hU hj
    replace hU : x ∉ s i ∩ iUnion λ j => iUnion λ _ => s j := λ h => hU (subset_toMeasurable _ _ h)
    

Proof state:
case refine'_2
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s✝ t u v : Set α
inst✝ : Countable ι
s : ι → Set α
hd : Pairwise (AEDisjoint μ on s)
i j : ι
hne : i ≠ j
x : α
hi : x ∈ s i
hj : x ∈ s j
hU : x ∉ s i ∩ ⋃ j ∈ {i}ᶜ, s j
⊢ x ∈ toMeasurable μ (s j ∩ ⋃ j_1 ∈ {j}ᶜ, s j_1)

Next tactic:
simp only [mem_inter_iff, mem_iUnion, not_and, not_exists] at hU
/-- If `s : ι → Set α` is a countable family of pairwise a.e. disjoint sets, then there exists a
family of measurable null sets `t i` such that `s i \ t i` are pairwise disjoint. -/
theorem exists_null_pairwise_disjoint_diff [Countable ι] {s : ι → Set α}
    (hd : Pairwise (AEDisjoint μ on s)) : ∃ t : ι → Set α, (∀ i, MeasurableSet (t i)) ∧
    (∀ i, μ (t i) = 0) ∧ Pairwise (Disjoint on fun i => s i \ t i) := by
  refine' ⟨fun i => toMeasurable μ (s i ∩ ⋃ j ∈ ({i}ᶜ : Set ι), s j), fun i =>
    measurableSet_toMeasurable _ _, fun i => _, _⟩
  · simp only [measure_toMeasurable, inter_iUnion]
    exact (measure_biUnion_null_iff <| to_countable _).2 fun j hj => hd (Ne.symm hj)
  · simp only [Pairwise, disjoint_left, onFun, mem_diff, not_and, and_imp, Classical.not_not]
    intro i j hne x hi hU hj
    replace hU : x ∉ s i ∩ iUnion λ j => iUnion λ _ => s j := λ h => hU (subset_toMeasurable _ _ h)
    simp only [mem_inter_iff, mem_iUnion, not_and, not_exists] at hU
    

Proof state:
case refine'_2
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s✝ t u v : Set α
inst✝ : Countable ι
s : ι → Set α
hd : Pairwise (AEDisjoint μ on s)
i j : ι
hne : i ≠ j
x : α
hi : x ∈ s i
hj : x ∈ s j
hU : x ∈ s i → ∀ x_1 ∈ {i}ᶜ, x ∉ s x_1
⊢ x ∈ toMeasurable μ (s j ∩ ⋃ j_1 ∈ {j}ᶜ, s j_1)

Next tactic:
exact (hU hi j hne.symm hj).elim
@[symm]
protected theorem symm (h : AEDisjoint μ s t) : AEDisjoint μ t s := by 

Proof state:
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s t u v : Set α
h : AEDisjoint μ s t
⊢ AEDisjoint μ t s

Next tactic:
rwa [AEDisjoint, inter_comm]
protected theorem _root_.Disjoint.aedisjoint (h : Disjoint s t) : AEDisjoint μ s t := by
  

Proof state:
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s t u v : Set α
h : Disjoint s t
⊢ AEDisjoint μ s t

Next tactic:
rw [AEDisjoint, disjoint_iff_inter_eq_empty.1 h, measure_empty]
@[simp]
theorem iUnion_left_iff [Countable ι] {s : ι → Set α} :
    AEDisjoint μ (⋃ i, s i) t ↔ ∀ i, AEDisjoint μ (s i) t := by
  

Proof state:
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s✝ t u v : Set α
inst✝ : Countable ι
s : ι → Set α
⊢ AEDisjoint μ (⋃ i, s i) t ↔ ∀ (i : ι), AEDisjoint μ (s i) t

Next tactic:
simp only [AEDisjoint, iUnion_inter, measure_iUnion_null_iff]
@[simp]
theorem iUnion_right_iff [Countable ι] {t : ι → Set α} :
    AEDisjoint μ s (⋃ i, t i) ↔ ∀ i, AEDisjoint μ s (t i) := by
  

Proof state:
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s t✝ u v : Set α
inst✝ : Countable ι
t : ι → Set α
⊢ AEDisjoint μ s (⋃ i, t i) ↔ ∀ (i : ι), AEDisjoint μ s (t i)

Next tactic:
simp only [AEDisjoint, inter_iUnion, measure_iUnion_null_iff]
@[simp]
theorem union_left_iff : AEDisjoint μ (s ∪ t) u ↔ AEDisjoint μ s u ∧ AEDisjoint μ t u := by
  

Proof state:
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s t u v : Set α
⊢ AEDisjoint μ (s ∪ t) u ↔ AEDisjoint μ s u ∧ AEDisjoint μ t u

Next tactic:
simp [union_eq_iUnion, and_comm]
@[simp]
theorem union_right_iff : AEDisjoint μ s (t ∪ u) ↔ AEDisjoint μ s t ∧ AEDisjoint μ s u := by
  

Proof state:
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s t u v : Set α
⊢ AEDisjoint μ s (t ∪ u) ↔ AEDisjoint μ s t ∧ AEDisjoint μ s u

Next tactic:
simp [union_eq_iUnion, and_comm]
/-- If `s` and `t` are `μ`-a.e. disjoint, then `s \ u` and `t` are disjoint for some measurable null
set `u`. -/
theorem exists_disjoint_diff (h : AEDisjoint μ s t) :
    ∃ u, MeasurableSet u ∧ μ u = 0 ∧ Disjoint (s \ u) t :=
  ⟨toMeasurable μ (s ∩ t), measurableSet_toMeasurable _ _, (measure_toMeasurable _).trans h,
    disjoint_sdiff_self_left.mono_left fun x hx => by
      

Proof state:
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s t u v : Set α
h : AEDisjoint μ s t
x : α
hx : x ∈ s \ toMeasurable μ (s ∩ t)
⊢ x ∈ ?m.9701 h \ t

Next tactic:
simp
/-- If `s` and `t` are `μ`-a.e. disjoint, then `s \ u` and `t` are disjoint for some measurable null
set `u`. -/
theorem exists_disjoint_diff (h : AEDisjoint μ s t) :
    ∃ u, MeasurableSet u ∧ μ u = 0 ∧ Disjoint (s \ u) t :=
  ⟨toMeasurable μ (s ∩ t), measurableSet_toMeasurable _ _, (measure_toMeasurable _).trans h,
    disjoint_sdiff_self_left.mono_left fun x hx => by
      simp; 

Proof state:
ι : Type u_1
α : Type u_2
m : MeasurableSpace α
μ : Measure α
s t u v : Set α
h : AEDisjoint μ s t
x : α
hx : x ∈ s \ toMeasurable μ (s ∩ t)
⊢ x ∈ ?m.9701 h ∧ x ∉ t

Next tactic:
exact ⟨hx.1, fun hxt => hx.2 <| subset_toMeasurable _ _ ⟨hx.1, hxt⟩⟩
/-- On pseudometric spaces, a map is an isometry if and only if it preserves nonnegative
distances. -/
theorem isometry_iff_nndist_eq [PseudoMetricSpace α] [PseudoMetricSpace β] {f : α → β} :
    Isometry f ↔ ∀ x y, nndist (f x) (f y) = nndist x y := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
f : α → β
⊢ Isometry f ↔ ∀ (x y : α), nndist (f x) (f y) = nndist x y

Next tactic:
simp only [Isometry, edist_nndist, ENNReal.coe_eq_coe]
/-- On pseudometric spaces, a map is an isometry if and only if it preserves distances. -/
theorem isometry_iff_dist_eq [PseudoMetricSpace α] [PseudoMetricSpace β] {f : α → β} :
    Isometry f ↔ ∀ x y, dist (f x) (f y) = dist x y := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
f : α → β
⊢ Isometry f ↔ ∀ (x y : α), dist (f x) (f y) = dist x y

Next tactic:
simp only [isometry_iff_nndist_eq, ← coe_nndist, NNReal.coe_eq]
theorem antilipschitz (h : Isometry f) : AntilipschitzWith 1 f := fun x y => by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f : α → β
x✝ y✝ z : α
s : Set α
h : Isometry f
x y : α
⊢ edist x y ≤ ↑1 * edist (f x) (f y)

Next tactic:
simp only [h x y, ENNReal.coe_one, one_mul, le_refl]
/-- Any map on a subsingleton is an isometry -/
@[nontriviality]
theorem _root_.isometry_subsingleton [Subsingleton α] : Isometry f := fun x y => by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : PseudoEMetricSpace α
inst✝² : PseudoEMetricSpace β
inst✝¹ : PseudoEMetricSpace γ
f : α → β
x✝ y✝ z : α
s : Set α
inst✝ : Subsingleton α
x y : α
⊢ edist (f x) (f y) = edist x y

Next tactic:
rw [Subsingleton.elim x y]
/-- Any map on a subsingleton is an isometry -/
@[nontriviality]
theorem _root_.isometry_subsingleton [Subsingleton α] : Isometry f := fun x y => by
  rw [Subsingleton.elim x y]; 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : PseudoEMetricSpace α
inst✝² : PseudoEMetricSpace β
inst✝¹ : PseudoEMetricSpace γ
f : α → β
x✝ y✝ z : α
s : Set α
inst✝ : Subsingleton α
x y : α
⊢ edist (f y) (f y) = edist y y

Next tactic:
simp
theorem prod_map {δ} [PseudoEMetricSpace δ] {f : α → β} {g : γ → δ} (hf : Isometry f)
    (hg : Isometry g) : Isometry (Prod.map f g) := fun x y => by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : PseudoEMetricSpace α
inst✝² : PseudoEMetricSpace β
inst✝¹ : PseudoEMetricSpace γ
f✝ : α → β
x✝ y✝ z : α
s : Set α
δ : Type u_2
inst✝ : PseudoEMetricSpace δ
f : α → β
g : γ → δ
hf : Isometry f
hg : Isometry g
x y : α × γ
⊢ edist (Prod.map f g x) (Prod.map f g y) = edist x y

Next tactic:
simp only [Prod.edist_eq, hf.edist_eq, hg.edist_eq, Prod_map]
theorem _root_.isometry_dcomp {ι} [Fintype ι] {α β : ι → Type*} [∀ i, PseudoEMetricSpace (α i)]
    [∀ i, PseudoEMetricSpace (β i)] (f : ∀ i, α i → β i) (hf : ∀ i, Isometry (f i)) :
    Isometry (fun g : (i : ι) → α i => fun i => f i (g i)) := fun x y => by
  

Proof state:
ι✝ : Type u_1
α✝ : Type u
β✝ : Type v
γ : Type w
inst✝⁵ : PseudoEMetricSpace α✝
inst✝⁴ : PseudoEMetricSpace β✝
inst✝³ : PseudoEMetricSpace γ
f✝ : α✝ → β✝
x✝ y✝ z : α✝
s : Set α✝
ι : Type u_4
inst✝² : Fintype ι
α : ι → Type u_2
β : ι → Type u_3
inst✝¹ : (i : ι) → PseudoEMetricSpace (α i)
inst✝ : (i : ι) → PseudoEMetricSpace (β i)
f : (i : ι) → α i → β i
hf : ∀ (i : ι), Isometry (f i)
x y : (i : ι) → α i
⊢ edist ((fun g i => f i (g i)) x) ((fun g i => f i (g i)) y) = edist x y

Next tactic:
simp only [edist_pi_def, (hf _).edist_eq]
/-- The right inverse of an isometry is an isometry. -/
theorem right_inv {f : α → β} {g : β → α} (h : Isometry f) (hg : RightInverse g f) : Isometry g :=
  fun x y => by 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f✝ : α → β
x✝ y✝ z : α
s : Set α
f : α → β
g : β → α
h : Isometry f
hg : Function.RightInverse g f
x y : β
⊢ edist (g x) (g y) = edist x y

Next tactic:
rw [← h, hg _, hg _]
theorem preimage_emetric_closedBall (h : Isometry f) (x : α) (r : ℝ≥0∞) :
    f ⁻¹' EMetric.closedBall (f x) r = EMetric.closedBall x r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f : α → β
x✝ y z : α
s : Set α
h : Isometry f
x : α
r : ℝ≥0∞
⊢ f ⁻¹' EMetric.closedBall (f x) r = EMetric.closedBall x r

Next tactic:
ext y
theorem preimage_emetric_closedBall (h : Isometry f) (x : α) (r : ℝ≥0∞) :
    f ⁻¹' EMetric.closedBall (f x) r = EMetric.closedBall x r := by
  ext y
  

Proof state:
case h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f : α → β
x✝ y✝ z : α
s : Set α
h : Isometry f
x : α
r : ℝ≥0∞
y : α
⊢ y ∈ f ⁻¹' EMetric.closedBall (f x) r ↔ y ∈ EMetric.closedBall x r

Next tactic:
simp [h.edist_eq]
theorem preimage_emetric_ball (h : Isometry f) (x : α) (r : ℝ≥0∞) :
    f ⁻¹' EMetric.ball (f x) r = EMetric.ball x r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f : α → β
x✝ y z : α
s : Set α
h : Isometry f
x : α
r : ℝ≥0∞
⊢ f ⁻¹' EMetric.ball (f x) r = EMetric.ball x r

Next tactic:
ext y
theorem preimage_emetric_ball (h : Isometry f) (x : α) (r : ℝ≥0∞) :
    f ⁻¹' EMetric.ball (f x) r = EMetric.ball x r := by
  ext y
  

Proof state:
case h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f : α → β
x✝ y✝ z : α
s : Set α
h : Isometry f
x : α
r : ℝ≥0∞
y : α
⊢ y ∈ f ⁻¹' EMetric.ball (f x) r ↔ y ∈ EMetric.ball x r

Next tactic:
simp [h.edist_eq]
/-- Isometries preserve the diameter in pseudoemetric spaces. -/
theorem ediam_image (hf : Isometry f) (s : Set α) : EMetric.diam (f '' s) = EMetric.diam s :=
  eq_of_forall_ge_iff fun d => by 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f : α → β
x y z : α
s✝ : Set α
hf : Isometry f
s : Set α
d : ℝ≥0∞
⊢ EMetric.diam (f '' s) ≤ d ↔ EMetric.diam s ≤ d

Next tactic:
simp only [EMetric.diam_le_iff, ball_image_iff, hf.edist_eq]
theorem ediam_range (hf : Isometry f) : EMetric.diam (range f) = EMetric.diam (univ : Set α) := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f : α → β
x y z : α
s : Set α
hf : Isometry f
⊢ EMetric.diam (range f) = EMetric.diam univ

Next tactic:
rw [← image_univ]
theorem ediam_range (hf : Isometry f) : EMetric.diam (range f) = EMetric.diam (univ : Set α) := by
  rw [← image_univ]
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
f : α → β
x y z : α
s : Set α
hf : Isometry f
⊢ EMetric.diam (f '' univ) = EMetric.diam univ

Next tactic:
exact hf.ediam_image univ
/-- An isometry preserves the diameter in pseudometric spaces. -/
theorem diam_image (hf : Isometry f) (s : Set α) : Metric.diam (f '' s) = Metric.diam s := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
f : α → β
hf : Isometry f
s : Set α
⊢ Metric.diam (f '' s) = Metric.diam s

Next tactic:
rw [Metric.diam, Metric.diam, hf.ediam_image]
theorem diam_range (hf : Isometry f) : Metric.diam (range f) = Metric.diam (univ : Set α) := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
f : α → β
hf : Isometry f
⊢ Metric.diam (range f) = Metric.diam univ

Next tactic:
rw [← image_univ]
theorem diam_range (hf : Isometry f) : Metric.diam (range f) = Metric.diam (univ : Set α) := by
  rw [← image_univ]
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
f : α → β
hf : Isometry f
⊢ Metric.diam (f '' univ) = Metric.diam univ

Next tactic:
exact hf.diam_image univ
theorem preimage_setOf_dist (hf : Isometry f) (x : α) (p : ℝ → Prop) :
    f ⁻¹' { y | p (dist y (f x)) } = { y | p (dist y x) } := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
f : α → β
hf : Isometry f
x : α
p : ℝ → Prop
⊢ f ⁻¹' {y | p (dist y (f x))} = {y | p (dist y x)}

Next tactic:
ext y
theorem preimage_setOf_dist (hf : Isometry f) (x : α) (p : ℝ → Prop) :
    f ⁻¹' { y | p (dist y (f x)) } = { y | p (dist y x) } := by
  ext y
  

Proof state:
case h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
f : α → β
hf : Isometry f
x : α
p : ℝ → Prop
y : α
⊢ y ∈ f ⁻¹' {y | p (dist y (f x))} ↔ y ∈ {y | p (dist y x)}

Next tactic:
simp [hf.dist_eq]
theorem ediam_univ (h : α ≃ᵢ β) : EMetric.diam (univ : Set α) = EMetric.diam (univ : Set β) := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
h : α ≃ᵢ β
⊢ EMetric.diam univ = EMetric.diam univ

Next tactic:
rw [← h.range_eq_univ, h.isometry.ediam_range]
@[simp]
theorem ediam_preimage (h : α ≃ᵢ β) (s : Set β) : EMetric.diam (h ⁻¹' s) = EMetric.diam s := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
h : α ≃ᵢ β
s : Set β
⊢ EMetric.diam (⇑h ⁻¹' s) = EMetric.diam s

Next tactic:
rw [← image_symm, ediam_image]
@[simp]
theorem preimage_emetric_ball (h : α ≃ᵢ β) (x : β) (r : ℝ≥0∞) :
    h ⁻¹' EMetric.ball x r = EMetric.ball (h.symm x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
h : α ≃ᵢ β
x : β
r : ℝ≥0∞
⊢ ⇑h ⁻¹' EMetric.ball x r = EMetric.ball ((IsometryEquiv.symm h) x) r

Next tactic:
rw [← h.isometry.preimage_emetric_ball (h.symm x) r, h.apply_symm_apply]
@[simp]
theorem preimage_emetric_closedBall (h : α ≃ᵢ β) (x : β) (r : ℝ≥0∞) :
    h ⁻¹' EMetric.closedBall x r = EMetric.closedBall (h.symm x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
h : α ≃ᵢ β
x : β
r : ℝ≥0∞
⊢ ⇑h ⁻¹' EMetric.closedBall x r = EMetric.closedBall ((IsometryEquiv.symm h) x) r

Next tactic:
rw [← h.isometry.preimage_emetric_closedBall (h.symm x) r, h.apply_symm_apply]
@[simp]
theorem image_emetric_ball (h : α ≃ᵢ β) (x : α) (r : ℝ≥0∞) :
    h '' EMetric.ball x r = EMetric.ball (h x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
h : α ≃ᵢ β
x : α
r : ℝ≥0∞
⊢ ⇑h '' EMetric.ball x r = EMetric.ball (h x) r

Next tactic:
rw [← h.preimage_symm, h.symm.preimage_emetric_ball, symm_symm]
@[simp]
theorem image_emetric_closedBall (h : α ≃ᵢ β) (x : α) (r : ℝ≥0∞) :
    h '' EMetric.closedBall x r = EMetric.closedBall (h x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
h : α ≃ᵢ β
x : α
r : ℝ≥0∞
⊢ ⇑h '' EMetric.closedBall x r = EMetric.closedBall (h x) r

Next tactic:
rw [← h.preimage_symm, h.symm.preimage_emetric_closedBall, symm_symm]
theorem completeSpace_iff (e : α ≃ᵢ β) : CompleteSpace α ↔ CompleteSpace β := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
e : α ≃ᵢ β
⊢ CompleteSpace α ↔ CompleteSpace β

Next tactic:
simp only [completeSpace_iff_isComplete_univ, ← e.range_eq_univ, ← image_univ,
    isComplete_image_iff e.isometry.uniformInducing]
/-- `Equiv.funUnique` as an `IsometryEquiv`. -/
@[simps!]
def funUnique [Unique ι] [Fintype ι] : (ι → α) ≃ᵢ α where
  toEquiv := Equiv.funUnique ι α
  isometry_toFun x hx := by 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝⁴ : PseudoEMetricSpace α
inst✝³ : PseudoEMetricSpace β
inst✝² : PseudoEMetricSpace γ
inst✝¹ : Unique ι
inst✝ : Fintype ι
x hx : ι → α
⊢ edist (Equiv.toFun (Equiv.funUnique ι α) x) (Equiv.toFun (Equiv.funUnique ι α) hx) = edist x hx

Next tactic:
simp [edist_pi_def, Finset.univ_unique, Finset.sup_singleton]
/-- `piFinTwoEquiv` as an `IsometryEquiv`. -/
@[simps!]
def piFinTwo (α : Fin 2 → Type*) [∀ i, PseudoEMetricSpace (α i)] : (∀ i, α i) ≃ᵢ α 0 × α 1 where
  toEquiv := piFinTwoEquiv α
  isometry_toFun x hx := by 

Proof state:
ι : Type u_1
α✝ : Type u
β : Type v
γ : Type w
inst✝³ : PseudoEMetricSpace α✝
inst✝² : PseudoEMetricSpace β
inst✝¹ : PseudoEMetricSpace γ
α : Fin 2 → Type u_2
inst✝ : (i : Fin 2) → PseudoEMetricSpace (α i)
x hx : (i : Fin 2) → α i
⊢ edist (Equiv.toFun (piFinTwoEquiv α) x) (Equiv.toFun (piFinTwoEquiv α) hx) = edist x hx

Next tactic:
simp [edist_pi_def, Fin.univ_succ, Prod.edist_eq]
@[simp]
theorem diam_preimage (s : Set β) : Metric.diam (h ⁻¹' s) = Metric.diam s := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
h : α ≃ᵢ β
s : Set β
⊢ Metric.diam (⇑h ⁻¹' s) = Metric.diam s

Next tactic:
rw [← image_symm, diam_image]
@[simp]
theorem preimage_ball (h : α ≃ᵢ β) (x : β) (r : ℝ) :
    h ⁻¹' Metric.ball x r = Metric.ball (h.symm x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
h✝ h : α ≃ᵢ β
x : β
r : ℝ
⊢ ⇑h ⁻¹' Metric.ball x r = Metric.ball ((IsometryEquiv.symm h) x) r

Next tactic:
rw [← h.isometry.preimage_ball (h.symm x) r, h.apply_symm_apply]
@[simp]
theorem preimage_sphere (h : α ≃ᵢ β) (x : β) (r : ℝ) :
    h ⁻¹' Metric.sphere x r = Metric.sphere (h.symm x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
h✝ h : α ≃ᵢ β
x : β
r : ℝ
⊢ ⇑h ⁻¹' Metric.sphere x r = Metric.sphere ((IsometryEquiv.symm h) x) r

Next tactic:
rw [← h.isometry.preimage_sphere (h.symm x) r, h.apply_symm_apply]
@[simp]
theorem preimage_closedBall (h : α ≃ᵢ β) (x : β) (r : ℝ) :
    h ⁻¹' Metric.closedBall x r = Metric.closedBall (h.symm x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
h✝ h : α ≃ᵢ β
x : β
r : ℝ
⊢ ⇑h ⁻¹' Metric.closedBall x r = Metric.closedBall ((IsometryEquiv.symm h) x) r

Next tactic:
rw [← h.isometry.preimage_closedBall (h.symm x) r, h.apply_symm_apply]
@[simp]
theorem image_ball (h : α ≃ᵢ β) (x : α) (r : ℝ) : h '' Metric.ball x r = Metric.ball (h x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
h✝ h : α ≃ᵢ β
x : α
r : ℝ
⊢ ⇑h '' Metric.ball x r = Metric.ball (h x) r

Next tactic:
rw [← h.preimage_symm, h.symm.preimage_ball, symm_symm]
@[simp]
theorem image_sphere (h : α ≃ᵢ β) (x : α) (r : ℝ) :
    h '' Metric.sphere x r = Metric.sphere (h x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
h✝ h : α ≃ᵢ β
x : α
r : ℝ
⊢ ⇑h '' Metric.sphere x r = Metric.sphere (h x) r

Next tactic:
rw [← h.preimage_symm, h.symm.preimage_sphere, symm_symm]
@[simp]
theorem image_closedBall (h : α ≃ᵢ β) (x : α) (r : ℝ) :
    h '' Metric.closedBall x r = Metric.closedBall (h x) r := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : PseudoMetricSpace α
inst✝ : PseudoMetricSpace β
h✝ h : α ≃ᵢ β
x : α
r : ℝ
⊢ ⇑h '' Metric.closedBall x r = Metric.closedBall (h x) r

Next tactic:
rw [← h.preimage_symm, h.symm.preimage_closedBall, symm_symm]
instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
    SlashInvariantFormClass (SlashInvariantForm Γ k) Γ k where
  coe := SlashInvariantForm.toFun
  coe_injective' f g h := by 

Proof state:
F : Type u_1
Γ : outParam (Subgroup SL(2, ℤ))
k : outParam ℤ
f g : SlashInvariantForm Γ k
h : f.toFun = g.toFun
⊢ f = g

Next tactic:
cases f
instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
    SlashInvariantFormClass (SlashInvariantForm Γ k) Γ k where
  coe := SlashInvariantForm.toFun
  coe_injective' f g h := by cases f; 

Proof state:
case mk
F : Type u_1
Γ : outParam (Subgroup SL(2, ℤ))
k : outParam ℤ
g : SlashInvariantForm Γ k
toFun✝ : ℍ → ℂ
slash_action_eq'✝ : ∀ (γ : ↥Γ), toFun✝ ∣[k] γ = toFun✝
h : { toFun := toFun✝, slash_action_eq' := slash_action_eq'✝ }.toFun = g.toFun
⊢ { toFun := toFun✝, slash_action_eq' := slash_action_eq'✝ } = g

Next tactic:
cases g
instance (priority := 100) SlashInvariantFormClass.slashInvariantForm :
    SlashInvariantFormClass (SlashInvariantForm Γ k) Γ k where
  coe := SlashInvariantForm.toFun
  coe_injective' f g h := by cases f; cases g; 

Proof state:
case mk.mk
F : Type u_1
Γ : outParam (Subgroup SL(2, ℤ))
k : outParam ℤ
toFun✝¹ : ℍ → ℂ
slash_action_eq'✝¹ : ∀ (γ : ↥Γ), toFun✝¹ ∣[k] γ = toFun✝¹
toFun✝ : ℍ → ℂ
slash_action_eq'✝ : ∀ (γ : ↥Γ), toFun✝ ∣[k] γ = toFun✝
h :
  { toFun := toFun✝¹, slash_action_eq' := slash_action_eq'✝¹ }.toFun =
    { toFun := toFun✝, slash_action_eq' := slash_action_eq'✝ }.toFun
⊢ { toFun := toFun✝¹, slash_action_eq' := slash_action_eq'✝¹ } =
    { toFun := toFun✝, slash_action_eq' := slash_action_eq'✝ }

Next tactic:
congr
theorem slash_action_eqn' (k : ℤ) (Γ : Subgroup SL(2, ℤ)) [SlashInvariantFormClass F Γ k] (f : F)
    (γ : Γ) (z : ℍ) : f (γ • z) = ((↑ₘ[ℤ] γ 1 0 : ℂ) * z + (↑ₘ[ℤ] γ 1 1 : ℂ)) ^ k * f z := by
  

Proof state:
F : Type u_1
Γ✝ : outParam (Subgroup SL(2, ℤ))
k✝ : outParam ℤ
k : ℤ
Γ : Subgroup SL(2, ℤ)
inst✝ : SlashInvariantFormClass F Γ k
f : F
γ : ↥Γ
z : ℍ
⊢ f (γ • z) = (↑(↑↑↑γ 1 0) * ↑z + ↑(↑↑↑γ 1 1)) ^ k * f z

Next tactic:
rw [← ModularForm.slash_action_eq'_iff, slash_action_eqn]
instance instAdd : Add (SlashInvariantForm Γ k) :=
  ⟨fun f g =>
    { toFun := f + g
      slash_action_eq' := fun γ => by
        

Proof state:
F : Type u_1
Γ : outParam (Subgroup SL(2, ℤ))
k : outParam ℤ
f g : SlashInvariantForm Γ k
γ : ↥Γ
⊢ (⇑f + ⇑g) ∣[k] γ = ⇑f + ⇑g

Next tactic:
rw [SlashAction.add_slash, slash_action_eqn, slash_action_eqn]