l3lab/ntp-mathlib huggingface dataset:
/-- If a short complex `S` is such that `S.f = 0` and that the kernel of `S.g` is preserved
by a functor `F`, then `F` preserves the right homology of `S`. -/
noncomputable def preservesRightHomologyOfZerof (hf : S.f = 0)
    [PreservesLimit (parallelPair S.g 0) F] :
    F.PreservesRightHomologyOf S := ⟨fun h =>
  { f := by
      rw [hf]
      infer_instance
    g' := by
      have := h.isIso_p hf
      

Proof state:
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.219136, u_1} C
inst✝⁴ : Category.{?u.219140, u_2} D
inst✝³ : HasZeroMorphisms C
inst✝² : HasZeroMorphisms D
F : C ⥤ D
inst✝¹ : PreservesZeroMorphisms F
S : ShortComplex C
hf : S.f = 0
inst✝ : PreservesLimit (parallelPair S.g 0) F
h : ShortComplex.RightHomologyData S
this : IsIso h.p
⊢ PreservesLimit (parallelPair (ShortComplex.RightHomologyData.g' h) 0) F

Next tactic:
let e : parallelPair S.g 0 ≅ parallelPair h.g' 0 :=
        parallelPair.ext (asIso h.p) (Iso.refl _) (by aesop_cat) (by aesop_cat)
/-- If a short complex `S` is such that `S.f = 0` and that the kernel of `S.g` is preserved
by a functor `F`, then `F` preserves the right homology of `S`. -/
noncomputable def preservesRightHomologyOfZerof (hf : S.f = 0)
    [PreservesLimit (parallelPair S.g 0) F] :
    F.PreservesRightHomologyOf S := ⟨fun h =>
  { f := by
      rw [hf]
      infer_instance
    g' := by
      have := h.isIso_p hf
      let e : parallelPair S.g 0 ≅ parallelPair h.g' 0 :=
        parallelPair.ext (asIso h.p) (Iso.refl _) (by 

Proof state:
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.219136, u_1} C
inst✝⁴ : Category.{?u.219140, u_2} D
inst✝³ : HasZeroMorphisms C
inst✝² : HasZeroMorphisms D
F : C ⥤ D
inst✝¹ : PreservesZeroMorphisms F
S : ShortComplex C
hf : S.f = 0
inst✝ : PreservesLimit (parallelPair S.g 0) F
h : ShortComplex.RightHomologyData S
this : IsIso h.p
⊢ (parallelPair S.g 0).map WalkingParallelPairHom.left ≫
      (Iso.refl ((parallelPair S.g 0).obj WalkingParallelPair.one)).hom =
    (asIso h.p).hom ≫ (parallelPair (ShortComplex.RightHomologyData.g' h) 0).map WalkingParallelPairHom.left

Next tactic:
aesop_cat
/-- If a short complex `S` is such that `S.f = 0` and that the kernel of `S.g` is preserved
by a functor `F`, then `F` preserves the right homology of `S`. -/
noncomputable def preservesRightHomologyOfZerof (hf : S.f = 0)
    [PreservesLimit (parallelPair S.g 0) F] :
    F.PreservesRightHomologyOf S := ⟨fun h =>
  { f := by
      rw [hf]
      infer_instance
    g' := by
      have := h.isIso_p hf
      let e : parallelPair S.g 0 ≅ parallelPair h.g' 0 :=
        parallelPair.ext (asIso h.p) (Iso.refl _) (by aesop_cat) (by 

Proof state:
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.219136, u_1} C
inst✝⁴ : Category.{?u.219140, u_2} D
inst✝³ : HasZeroMorphisms C
inst✝² : HasZeroMorphisms D
F : C ⥤ D
inst✝¹ : PreservesZeroMorphisms F
S : ShortComplex C
hf : S.f = 0
inst✝ : PreservesLimit (parallelPair S.g 0) F
h : ShortComplex.RightHomologyData S
this : IsIso h.p
⊢ (parallelPair S.g 0).map WalkingParallelPairHom.right ≫
      (Iso.refl ((parallelPair S.g 0).obj WalkingParallelPair.one)).hom =
    (asIso h.p).hom ≫ (parallelPair (ShortComplex.RightHomologyData.g' h) 0).map WalkingParallelPairHom.right

Next tactic:
aesop_cat
/-- If a short complex `S` is such that `S.f = 0` and that the kernel of `S.g` is preserved
by a functor `F`, then `F` preserves the right homology of `S`. -/
noncomputable def preservesRightHomologyOfZerof (hf : S.f = 0)
    [PreservesLimit (parallelPair S.g 0) F] :
    F.PreservesRightHomologyOf S := ⟨fun h =>
  { f := by
      rw [hf]
      infer_instance
    g' := by
      have := h.isIso_p hf
      let e : parallelPair S.g 0 ≅ parallelPair h.g' 0 :=
        parallelPair.ext (asIso h.p) (Iso.refl _) (by aesop_cat) (by aesop_cat)
      

Proof state:
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.219136, u_1} C
inst✝⁴ : Category.{?u.219140, u_2} D
inst✝³ : HasZeroMorphisms C
inst✝² : HasZeroMorphisms D
F : C ⥤ D
inst✝¹ : PreservesZeroMorphisms F
S : ShortComplex C
hf : S.f = 0
inst✝ : PreservesLimit (parallelPair S.g 0) F
h : ShortComplex.RightHomologyData S
this : IsIso h.p
e : parallelPair S.g 0 ≅ parallelPair (ShortComplex.RightHomologyData.g' h) 0 :=
  parallelPair.ext (asIso h.p) (Iso.refl ((parallelPair S.g 0).obj WalkingParallelPair.one))
    (_ : S.g ≫ 𝟙 S.X₃ = h.p ≫ ShortComplex.RightHomologyData.g' h) (_ : 0 ≫ 𝟙 S.X₃ = h.p ≫ 0)
⊢ PreservesLimit (parallelPair (ShortComplex.RightHomologyData.g' h) 0) F

Next tactic:
exact Limits.preservesLimitOfIsoDiagram F e
lemma NatTrans.app_homology {F G : C ⥤ D} (τ : F ⟶ G)
    (S : ShortComplex C) [S.HasHomology] [F.PreservesZeroMorphisms] [G.PreservesZeroMorphisms]
    [F.PreservesLeftHomologyOf S] [G.PreservesLeftHomologyOf S] [F.PreservesRightHomologyOf S]
    [G.PreservesRightHomologyOf S] :
    τ.app S.homology = (S.mapHomologyIso F).inv ≫
      ShortComplex.homologyMap (S.mapNatTrans τ) ≫ (S.mapHomologyIso G).hom := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝¹⁰ : Category.{u_3, u_1} C
inst✝⁹ : Category.{u_4, u_2} D
inst✝⁸ : HasZeroMorphisms C
inst✝⁷ : HasZeroMorphisms D
F G : C ⥤ D
τ : F ⟶ G
S : ShortComplex C
inst✝⁶ : ShortComplex.HasHomology S
inst✝⁵ : Functor.PreservesZeroMorphisms F
inst✝⁴ : Functor.PreservesZeroMorphisms G
inst✝³ : Functor.PreservesLeftHomologyOf F S
inst✝² : Functor.PreservesLeftHomologyOf G S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Functor.PreservesRightHomologyOf G S
⊢ τ.app (ShortComplex.homology S) =
    (ShortComplex.mapHomologyIso S F).inv ≫
      ShortComplex.homologyMap (ShortComplex.mapNatTrans S τ) ≫ (ShortComplex.mapHomologyIso S G).hom

Next tactic:
rw [ShortComplex.homologyMap_mapNatTrans, assoc, assoc, Iso.inv_hom_id,
    comp_id, Iso.inv_hom_id_assoc]
theorem mk {s t : Set α} (hs : μ s = 0) (ht : ν t = 0) (hst : univ ⊆ s ∪ t) :
    MutuallySingular μ ν := by
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ μ₁ μ₂ ν ν₁ ν₂ : Measure α
s t : Set α
hs : ↑↑μ s = 0
ht : ↑↑ν t = 0
hst : univ ⊆ s ∪ t
⊢ μ ⟂ₘ ν

Next tactic:
use toMeasurable μ s, measurableSet_toMeasurable _ _, (measure_toMeasurable _).trans hs
theorem mk {s t : Set α} (hs : μ s = 0) (ht : ν t = 0) (hst : univ ⊆ s ∪ t) :
    MutuallySingular μ ν := by
  use toMeasurable μ s, measurableSet_toMeasurable _ _, (measure_toMeasurable _).trans hs
  

Proof state:
case right
α : Type u_1
m0 : MeasurableSpace α
μ μ₁ μ₂ ν ν₁ ν₂ : Measure α
s t : Set α
hs : ↑↑μ s = 0
ht : ↑↑ν t = 0
hst : univ ⊆ s ∪ t
⊢ ↑↑ν (toMeasurable μ s)ᶜ = 0

Next tactic:
refine' measure_mono_null (fun x hx => (hst trivial).resolve_left fun hxs => hx _) ht
theorem mk {s t : Set α} (hs : μ s = 0) (ht : ν t = 0) (hst : univ ⊆ s ∪ t) :
    MutuallySingular μ ν := by
  use toMeasurable μ s, measurableSet_toMeasurable _ _, (measure_toMeasurable _).trans hs
  refine' measure_mono_null (fun x hx => (hst trivial).resolve_left fun hxs => hx _) ht
  

Proof state:
case right
α : Type u_1
m0 : MeasurableSpace α
μ μ₁ μ₂ ν ν₁ ν₂ : Measure α
s t : Set α
hs : ↑↑μ s = 0
ht : ↑↑ν t = 0
hst : univ ⊆ s ∪ t
x : α
hx : x ∈ (toMeasurable μ s)ᶜ
hxs : x ∈ s
⊢ x ∈ toMeasurable μ s

Next tactic:
exact subset_toMeasurable _ _ hxs
@[simp]
lemma restrict_nullSet (h : μ ⟂ₘ ν) : μ.restrict h.nullSet = 0 := by 

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ μ₁ μ₂ ν ν₁ ν₂ : Measure α
h : μ ⟂ₘ ν
⊢ restrict μ (nullSet h) = 0

Next tactic:
simp
@[simp]
lemma restrict_compl_nullSet (h : μ ⟂ₘ ν) : ν.restrict h.nullSetᶜ = 0 := by 

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ μ₁ μ₂ ν ν₁ ν₂ : Measure α
h : μ ⟂ₘ ν
⊢ restrict ν (nullSet h)ᶜ = 0

Next tactic:
simp
@[simp]
lemma self_iff (μ : Measure α) : μ ⟂ₘ μ ↔ μ = 0 := by
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ μ : Measure α
⊢ μ ⟂ₘ μ ↔ μ = 0

Next tactic:
refine ⟨?_, fun h ↦ by (rw [h]; exact zero_left)⟩
@[simp]
lemma self_iff (μ : Measure α) : μ ⟂ₘ μ ↔ μ = 0 := by
  refine ⟨?_, fun h ↦ by (

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ μ : Measure α
h : μ = 0
⊢ μ ⟂ₘ μ

Next tactic:
rw [h]
@[simp]
lemma self_iff (μ : Measure α) : μ ⟂ₘ μ ↔ μ = 0 := by
  refine ⟨?_, fun h ↦ by (rw [h]; 

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ μ : Measure α
h : μ = 0
⊢ 0 ⟂ₘ 0

Next tactic:
exact zero_left
@[simp]
lemma self_iff (μ : Measure α) : μ ⟂ₘ μ ↔ μ = 0 := by
  refine ⟨?_, fun h ↦ by (rw [h]; exact zero_left)⟩
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ μ : Measure α
⊢ μ ⟂ₘ μ → μ = 0

Next tactic:
rintro ⟨s, hs, hμs, hμs_compl⟩
@[simp]
lemma self_iff (μ : Measure α) : μ ⟂ₘ μ ↔ μ = 0 := by
  refine ⟨?_, fun h ↦ by (rw [h]; exact zero_left)⟩
  rintro ⟨s, hs, hμs, hμs_compl⟩
  

Proof state:
case intro.intro.intro
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ μ : Measure α
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s = 0
hμs_compl : ↑↑μ sᶜ = 0
⊢ μ = 0

Next tactic:
suffices μ Set.univ = 0 by rwa [measure_univ_eq_zero] at this
@[simp]
lemma self_iff (μ : Measure α) : μ ⟂ₘ μ ↔ μ = 0 := by
  refine ⟨?_, fun h ↦ by (rw [h]; exact zero_left)⟩
  rintro ⟨s, hs, hμs, hμs_compl⟩
  suffices μ Set.univ = 0 by 

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ μ : Measure α
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s = 0
hμs_compl : ↑↑μ sᶜ = 0
this : ↑↑μ univ = 0
⊢ μ = 0

Next tactic:
rwa [measure_univ_eq_zero] at this
@[simp]
lemma self_iff (μ : Measure α) : μ ⟂ₘ μ ↔ μ = 0 := by
  refine ⟨?_, fun h ↦ by (rw [h]; exact zero_left)⟩
  rintro ⟨s, hs, hμs, hμs_compl⟩
  suffices μ Set.univ = 0 by rwa [measure_univ_eq_zero] at this
  

Proof state:
case intro.intro.intro
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ μ : Measure α
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s = 0
hμs_compl : ↑↑μ sᶜ = 0
⊢ ↑↑μ univ = 0

Next tactic:
rw [← Set.union_compl_self s, measure_union disjoint_compl_right hs.compl, hμs, hμs_compl,
    add_zero]
@[simp]
theorem sum_left {ι : Type*} [Countable ι] {μ : ι → Measure α} : sum μ ⟂ₘ ν ↔ ∀ i, μ i ⟂ₘ ν := by
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ : Measure α
ι : Type u_2
inst✝ : Countable ι
μ : ι → Measure α
⊢ sum μ ⟂ₘ ν ↔ ∀ (i : ι), μ i ⟂ₘ ν

Next tactic:
refine' ⟨fun h i => h.mono (le_sum _ _) le_rfl, fun H => _⟩
@[simp]
theorem sum_left {ι : Type*} [Countable ι] {μ : ι → Measure α} : sum μ ⟂ₘ ν ↔ ∀ i, μ i ⟂ₘ ν := by
  refine' ⟨fun h i => h.mono (le_sum _ _) le_rfl, fun H => _⟩
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ : Measure α
ι : Type u_2
inst✝ : Countable ι
μ : ι → Measure α
H : ∀ (i : ι), μ i ⟂ₘ ν
⊢ sum μ ⟂ₘ ν

Next tactic:
choose s hsm hsμ hsν using H
@[simp]
theorem sum_left {ι : Type*} [Countable ι] {μ : ι → Measure α} : sum μ ⟂ₘ ν ↔ ∀ i, μ i ⟂ₘ ν := by
  refine' ⟨fun h i => h.mono (le_sum _ _) le_rfl, fun H => _⟩
  choose s hsm hsμ hsν using H
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ : Measure α
ι : Type u_2
inst✝ : Countable ι
μ : ι → Measure α
s : ι → Set α
hsm : ∀ (i : ι), MeasurableSet (s i)
hsμ : ∀ (i : ι), ↑↑(μ i) (s i) = 0
hsν : ∀ (i : ι), ↑↑ν (s i)ᶜ = 0
⊢ sum μ ⟂ₘ ν

Next tactic:
refine' ⟨⋂ i, s i, MeasurableSet.iInter hsm, _, _⟩
@[simp]
theorem sum_left {ι : Type*} [Countable ι] {μ : ι → Measure α} : sum μ ⟂ₘ ν ↔ ∀ i, μ i ⟂ₘ ν := by
  refine' ⟨fun h i => h.mono (le_sum _ _) le_rfl, fun H => _⟩
  choose s hsm hsμ hsν using H
  refine' ⟨⋂ i, s i, MeasurableSet.iInter hsm, _, _⟩
  · 

Proof state:
case refine'_1
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ : Measure α
ι : Type u_2
inst✝ : Countable ι
μ : ι → Measure α
s : ι → Set α
hsm : ∀ (i : ι), MeasurableSet (s i)
hsμ : ∀ (i : ι), ↑↑(μ i) (s i) = 0
hsν : ∀ (i : ι), ↑↑ν (s i)ᶜ = 0
⊢ ↑↑(sum μ) (⋂ i, s i) = 0

Next tactic:
rw [sum_apply _ (MeasurableSet.iInter hsm), ENNReal.tsum_eq_zero]
@[simp]
theorem sum_left {ι : Type*} [Countable ι] {μ : ι → Measure α} : sum μ ⟂ₘ ν ↔ ∀ i, μ i ⟂ₘ ν := by
  refine' ⟨fun h i => h.mono (le_sum _ _) le_rfl, fun H => _⟩
  choose s hsm hsμ hsν using H
  refine' ⟨⋂ i, s i, MeasurableSet.iInter hsm, _, _⟩
  · rw [sum_apply _ (MeasurableSet.iInter hsm), ENNReal.tsum_eq_zero]
    

Proof state:
case refine'_1
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ : Measure α
ι : Type u_2
inst✝ : Countable ι
μ : ι → Measure α
s : ι → Set α
hsm : ∀ (i : ι), MeasurableSet (s i)
hsμ : ∀ (i : ι), ↑↑(μ i) (s i) = 0
hsν : ∀ (i : ι), ↑↑ν (s i)ᶜ = 0
⊢ ∀ (i : ι), ↑↑(μ i) (⋂ b, s b) = 0

Next tactic:
exact fun i => measure_mono_null (iInter_subset _ _) (hsμ i)
@[simp]
theorem sum_left {ι : Type*} [Countable ι] {μ : ι → Measure α} : sum μ ⟂ₘ ν ↔ ∀ i, μ i ⟂ₘ ν := by
  refine' ⟨fun h i => h.mono (le_sum _ _) le_rfl, fun H => _⟩
  choose s hsm hsμ hsν using H
  refine' ⟨⋂ i, s i, MeasurableSet.iInter hsm, _, _⟩
  · rw [sum_apply _ (MeasurableSet.iInter hsm), ENNReal.tsum_eq_zero]
    exact fun i => measure_mono_null (iInter_subset _ _) (hsμ i)
  · 

Proof state:
case refine'_2
α : Type u_1
m0 : MeasurableSpace α
μ✝ μ₁ μ₂ ν ν₁ ν₂ : Measure α
ι : Type u_2
inst✝ : Countable ι
μ : ι → Measure α
s : ι → Set α
hsm : ∀ (i : ι), MeasurableSet (s i)
hsμ : ∀ (i : ι), ↑↑(μ i) (s i) = 0
hsν : ∀ (i : ι), ↑↑ν (s i)ᶜ = 0
⊢ ↑↑ν (⋂ i, s i)ᶜ = 0

Next tactic:
rwa [compl_iInter, measure_iUnion_null_iff]
@[simp]
theorem add_left_iff : μ₁ + μ₂ ⟂ₘ ν ↔ μ₁ ⟂ₘ ν ∧ μ₂ ⟂ₘ ν := by
  

Proof state:
α : Type u_1
m0 : MeasurableSpace α
μ μ₁ μ₂ ν ν₁ ν₂ : Measure α
⊢ μ₁ + μ₂ ⟂ₘ ν ↔ μ₁ ⟂ₘ ν ∧ μ₂ ⟂ₘ ν

Next tactic:
rw [← sum_cond, sum_left, Bool.forall_bool, cond, cond, and_comm]
theorem QuotientRing.isOpenMap_coe : IsOpenMap (mk N) := by
  

Proof state:
R : Type u_1
inst✝² : TopologicalSpace R
inst✝¹ : CommRing R
N : Ideal R
inst✝ : TopologicalRing R
⊢ IsOpenMap ⇑(mk N)

Next tactic:
intro s s_op
theorem QuotientRing.isOpenMap_coe : IsOpenMap (mk N) := by
  intro s s_op
  

Proof state:
R : Type u_1
inst✝² : TopologicalSpace R
inst✝¹ : CommRing R
N : Ideal R
inst✝ : TopologicalRing R
s : Set R
s_op : IsOpen s
⊢ IsOpen (⇑(mk N) '' s)

Next tactic:
change IsOpen (mk N ⁻¹' (mk N '' s))
theorem QuotientRing.isOpenMap_coe : IsOpenMap (mk N) := by
  intro s s_op
  change IsOpen (mk N ⁻¹' (mk N '' s))
  

Proof state:
R : Type u_1
inst✝² : TopologicalSpace R
inst✝¹ : CommRing R
N : Ideal R
inst✝ : TopologicalRing R
s : Set R
s_op : IsOpen s
⊢ IsOpen (⇑(mk N) ⁻¹' (⇑(mk N) '' s))

Next tactic:
rw [quotient_ring_saturate]
theorem QuotientRing.isOpenMap_coe : IsOpenMap (mk N) := by
  intro s s_op
  change IsOpen (mk N ⁻¹' (mk N '' s))
  rw [quotient_ring_saturate]
  

Proof state:
R : Type u_1
inst✝² : TopologicalSpace R
inst✝¹ : CommRing R
N : Ideal R
inst✝ : TopologicalRing R
s : Set R
s_op : IsOpen s
⊢ IsOpen (⋃ x, (fun y => ↑x + y) '' s)

Next tactic:
exact isOpen_iUnion fun ⟨n, _⟩ => isOpenMap_add_left n s s_op
theorem QuotientRing.quotientMap_coe_coe : QuotientMap fun p : R × R => (mk N p.1, mk N p.2) :=
  IsOpenMap.to_quotientMap ((QuotientRing.isOpenMap_coe N).prod (QuotientRing.isOpenMap_coe N))
    ((continuous_quot_mk.comp continuous_fst).prod_mk (continuous_quot_mk.comp continuous_snd))
    (by 

Proof state:
R : Type u_1
inst✝² : TopologicalSpace R
inst✝¹ : CommRing R
N : Ideal R
inst✝ : TopologicalRing R
⊢ Function.Surjective fun p => ((mk N) p.1, (mk N) p.2)

Next tactic:
rintro ⟨⟨x⟩, ⟨y⟩⟩
theorem QuotientRing.quotientMap_coe_coe : QuotientMap fun p : R × R => (mk N p.1, mk N p.2) :=
  IsOpenMap.to_quotientMap ((QuotientRing.isOpenMap_coe N).prod (QuotientRing.isOpenMap_coe N))
    ((continuous_quot_mk.comp continuous_fst).prod_mk (continuous_quot_mk.comp continuous_snd))
    (by rintro ⟨⟨x⟩, ⟨y⟩⟩; 

Proof state:
case mk.mk.mk
R : Type u_1
inst✝² : TopologicalSpace R
inst✝¹ : CommRing R
N : Ideal R
inst✝ : TopologicalRing R
fst✝ snd✝ : R ⧸ N
x y : R
⊢ ∃ a, (fun p => ((mk N) p.1, (mk N) p.2)) a = (Quot.mk Setoid.r x, Quot.mk Setoid.r y)

Next tactic:
exact ⟨(x, y), rfl⟩
theorem nonempty_monotone_mem {s : Set α} (hs : s.Nonempty) :
    Nonempty { u // Monotone u ∧ ∀ i : ℕ, u i ∈ s } := by
  

Proof state:
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
s : Set α
hs : Set.Nonempty s
⊢ Nonempty { u // Monotone u ∧ ∀ (i : ℕ), u i ∈ s }

Next tactic:
obtain ⟨x, hx⟩ := hs
theorem nonempty_monotone_mem {s : Set α} (hs : s.Nonempty) :
    Nonempty { u // Monotone u ∧ ∀ i : ℕ, u i ∈ s } := by
  obtain ⟨x, hx⟩ := hs
  

Proof state:
case intro
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
s : Set α
x : α
hx : x ∈ s
⊢ Nonempty { u // Monotone u ∧ ∀ (i : ℕ), u i ∈ s }

Next tactic:
exact ⟨⟨fun _ => x, fun i j _ => le_rfl, fun _ => hx⟩⟩
theorem eq_of_edist_zero_on {f f' : α → E} {s : Set α} (h : ∀ ⦃x⦄, x ∈ s → edist (f x) (f' x) = 0) :
    eVariationOn f s = eVariationOn f' s := by
  

Proof state:
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f f' : α → E
s : Set α
h : ∀ ⦃x : α⦄, x ∈ s → edist (f x) (f' x) = 0
⊢ eVariationOn f s = eVariationOn f' s

Next tactic:
dsimp only [eVariationOn]
theorem eq_of_edist_zero_on {f f' : α → E} {s : Set α} (h : ∀ ⦃x⦄, x ∈ s → edist (f x) (f' x) = 0) :
    eVariationOn f s = eVariationOn f' s := by
  dsimp only [eVariationOn]
  

Proof state:
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f f' : α → E
s : Set α
h : ∀ ⦃x : α⦄, x ∈ s → edist (f x) (f' x) = 0
⊢ ⨆ p, ∑ i in Finset.range p.1, edist (f (↑p.2 (i + 1))) (f (↑p.2 i)) =
    ⨆ p, ∑ i in Finset.range p.1, edist (f' (↑p.2 (i + 1))) (f' (↑p.2 i))

Next tactic:
congr 1 with p : 1
theorem eq_of_edist_zero_on {f f' : α → E} {s : Set α} (h : ∀ ⦃x⦄, x ∈ s → edist (f x) (f' x) = 0) :
    eVariationOn f s = eVariationOn f' s := by
  dsimp only [eVariationOn]
  congr 1 with p : 1
  

Proof state:
case e_s.h
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f f' : α → E
s : Set α
h : ∀ ⦃x : α⦄, x ∈ s → edist (f x) (f' x) = 0
p : ℕ × { u // Monotone u ∧ ∀ (i : ℕ), u i ∈ s }
⊢ ∑ i in Finset.range p.1, edist (f (↑p.2 (i + 1))) (f (↑p.2 i)) =
    ∑ i in Finset.range p.1, edist (f' (↑p.2 (i + 1))) (f' (↑p.2 i))

Next tactic:
congr 1 with i : 1
theorem eq_of_edist_zero_on {f f' : α → E} {s : Set α} (h : ∀ ⦃x⦄, x ∈ s → edist (f x) (f' x) = 0) :
    eVariationOn f s = eVariationOn f' s := by
  dsimp only [eVariationOn]
  congr 1 with p : 1
  congr 1 with i : 1
  

Proof state:
case e_s.h.e_f.h
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f f' : α → E
s : Set α
h : ∀ ⦃x : α⦄, x ∈ s → edist (f x) (f' x) = 0
p : ℕ × { u // Monotone u ∧ ∀ (i : ℕ), u i ∈ s }
i : ℕ
⊢ edist (f (↑p.2 (i + 1))) (f (↑p.2 i)) = edist (f' (↑p.2 (i + 1))) (f' (↑p.2 i))

Next tactic:
rw [edist_congr_right (h <| p.snd.prop.2 (i + 1)), edist_congr_left (h <| p.snd.prop.2 i)]
theorem eq_of_eqOn {f f' : α → E} {s : Set α} (h : EqOn f f' s) :
    eVariationOn f s = eVariationOn f' s :=
  eq_of_edist_zero_on fun x xs => by 

Proof state:
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f f' : α → E
s : Set α
h : EqOn f f' s
x : α
xs : x ∈ s
⊢ edist (f x) (f' x) = 0

Next tactic:
rw [h xs, edist_self]
theorem sum_le_of_monotoneOn_Icc (f : α → E) {s : Set α} {m n : ℕ} {u : ℕ → α}
    (hu : MonotoneOn u (Icc m n)) (us : ∀ i ∈ Icc m n, u i ∈ s) :
    (∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := by
  

Proof state:
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f : α → E
s : Set α
m n : ℕ
u : ℕ → α
hu : MonotoneOn u (Icc m n)
us : ∀ i ∈ Icc m n, u i ∈ s
⊢ ∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i)) ≤ eVariationOn f s

Next tactic:
rcases le_total n m with hnm | hmn
theorem sum_le_of_monotoneOn_Icc (f : α → E) {s : Set α} {m n : ℕ} {u : ℕ → α}
    (hu : MonotoneOn u (Icc m n)) (us : ∀ i ∈ Icc m n, u i ∈ s) :
    (∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := by
  rcases le_total n m with hnm | hmn
  · 

Proof state:
case inl
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f : α → E
s : Set α
m n : ℕ
u : ℕ → α
hu : MonotoneOn u (Icc m n)
us : ∀ i ∈ Icc m n, u i ∈ s
hnm : n ≤ m
⊢ ∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i)) ≤ eVariationOn f s

Next tactic:
simp [Finset.Ico_eq_empty_of_le hnm]
theorem sum_le_of_monotoneOn_Icc (f : α → E) {s : Set α} {m n : ℕ} {u : ℕ → α}
    (hu : MonotoneOn u (Icc m n)) (us : ∀ i ∈ Icc m n, u i ∈ s) :
    (∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := by
  rcases le_total n m with hnm | hmn
  · simp [Finset.Ico_eq_empty_of_le hnm]
  

Proof state:
case inr
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f : α → E
s : Set α
m n : ℕ
u : ℕ → α
hu : MonotoneOn u (Icc m n)
us : ∀ i ∈ Icc m n, u i ∈ s
hmn : m ≤ n
⊢ ∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i)) ≤ eVariationOn f s

Next tactic:
let π := projIcc m n hmn
theorem sum_le_of_monotoneOn_Icc (f : α → E) {s : Set α} {m n : ℕ} {u : ℕ → α}
    (hu : MonotoneOn u (Icc m n)) (us : ∀ i ∈ Icc m n, u i ∈ s) :
    (∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := by
  rcases le_total n m with hnm | hmn
  · simp [Finset.Ico_eq_empty_of_le hnm]
  let π := projIcc m n hmn
  

Proof state:
case inr
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f : α → E
s : Set α
m n : ℕ
u : ℕ → α
hu : MonotoneOn u (Icc m n)
us : ∀ i ∈ Icc m n, u i ∈ s
hmn : m ≤ n
π : ℕ → ↑(Icc m n) := projIcc m n hmn
⊢ ∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i)) ≤ eVariationOn f s

Next tactic:
let v i := u (π i)
theorem sum_le_of_monotoneOn_Icc (f : α → E) {s : Set α} {m n : ℕ} {u : ℕ → α}
    (hu : MonotoneOn u (Icc m n)) (us : ∀ i ∈ Icc m n, u i ∈ s) :
    (∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := by
  rcases le_total n m with hnm | hmn
  · simp [Finset.Ico_eq_empty_of_le hnm]
  let π := projIcc m n hmn
  let v i := u (π i)
  

Proof state:
case inr
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f : α → E
s : Set α
m n : ℕ
u : ℕ → α
hu : MonotoneOn u (Icc m n)
us : ∀ i ∈ Icc m n, u i ∈ s
hmn : m ≤ n
π : ℕ → ↑(Icc m n) := projIcc m n hmn
v : ℕ → α := fun i => u ↑(π i)
⊢ ∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i)) ≤ eVariationOn f s

Next tactic:
calc
    ∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i))
        = ∑ i in Finset.Ico m n, edist (f (v (i + 1))) (f (v i)) :=
      Finset.sum_congr rfl fun i hi ↦ by
        rw [Finset.mem_Ico] at hi
        simp only [projIcc_of_mem hmn ⟨hi.1, hi.2.le⟩,
          projIcc_of_mem hmn ⟨hi.1.trans i.le_succ, hi.2⟩]
    _ ≤ ∑ i in Finset.range n, edist (f (v (i + 1))) (f (v i)) :=
      Finset.sum_mono_set _ (Nat.Iio_eq_range ▸ Finset.Ico_subset_Iio_self)
    _ ≤ eVariationOn f s :=
      sum_le _ _ (fun i j h ↦ hu (π i).2 (π j).2 (monotone_projIcc hmn h)) fun i ↦ us _ (π i).2
theorem sum_le_of_monotoneOn_Icc (f : α → E) {s : Set α} {m n : ℕ} {u : ℕ → α}
    (hu : MonotoneOn u (Icc m n)) (us : ∀ i ∈ Icc m n, u i ∈ s) :
    (∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := by
  rcases le_total n m with hnm | hmn
  · simp [Finset.Ico_eq_empty_of_le hnm]
  let π := projIcc m n hmn
  let v i := u (π i)
  calc
    ∑ i in Finset.Ico m n, edist (f (u (i + 1))) (f (u i))
        = ∑ i in Finset.Ico m n, edist (f (v (i + 1))) (f (v i)) :=
      Finset.sum_congr rfl fun i hi ↦ by
        

Proof state:
α : Type u_1
inst✝¹ : LinearOrder α
E : Type u_2
inst✝ : PseudoEMetricSpace E
f : α → E
s : Set α
m n : ℕ
u : ℕ → α
hu : MonotoneOn u (Icc m n)
us : ∀ i ∈ Icc m n, u i ∈ s
hmn : m ≤ n
π : ℕ → ↑(Icc m n) := projIcc m n hmn
v : ℕ → α := fun i => u ↑(π i)
i : ℕ
hi : i ∈ Finset.Ico m n
⊢ edist (f (u (i + 1))) (f (u i)) = edist (f (v (i + 1))) (f (v i))

Next tactic:
rw [Finset.mem_Ico] at hi