-- Mathlib/MeasureTheory/Measure/OpenPos.lean
theorem eqOn_open_of_ae_eq {f g : X → Y} (h : f =ᵐ[μ.restrict U] g) (hU : IsOpen U)
    (hf : ContinuousOn f U) (hg : ContinuousOn g U) : EqOn f g U

Proof state:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
⊢ EqOn f g U

Tactic:
have : IsOpen (U ∩ { a | f a ≠ g a }) := by
  refine isOpen_iff_mem_nhds.mpr fun a ha => inter_mem (hU.mem_nhds ha.1) ?_
  rcases ha with ⟨ha : a ∈ U, ha' : (f a, g a) ∈ (diagonal Y)ᶜ⟩
  exact
    (hf.continuousAt (hU.mem_nhds ha)).prod_mk_nhds (hg.continuousAt (hU.mem_nhds ha))
      (isClosed_diagonal.isOpen_compl.mem_nhds ha')

Result:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
this : IsOpen (U ∩ {a | f a ≠ g a})
⊢ EqOn f g U

Proof state:
case intro
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
a : X
ha : a ∈ U
ha' : (f a, g a) ∈ (diagonal Y)ᶜ
⊢ {a | f a ≠ g a} ∈ 𝓝 a

Tactic:
exact
  (hf.continuousAt (hU.mem_nhds ha)).prod_mk_nhds (hg.continuousAt (hU.mem_nhds ha))
    (isClosed_diagonal.isOpen_compl.mem_nhds ha')

Result:
no goals

Proof state:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
this : IsOpen (U ∩ {a | f a ≠ g a})
⊢ EqOn f g U

Tactic:
replace := (this.eq_empty_of_measure_zero h).le

Result:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
this : U ∩ {a | f a ≠ g a} ≤ ∅
⊢ EqOn f g U

Proof state:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
this : U ∩ {a | f a ≠ g a} ≤ ∅
⊢ EqOn f g U

Tactic:
exact fun x hx => Classical.not_not.1 fun h => this ⟨hx, h⟩

Result:
no goals

Proof state:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
a : X
ha : a ∈ U ∩ {a | f a ≠ g a}
⊢ {a | f a ≠ g a} ∈ 𝓝 a

Tactic:
rcases ha with ⟨ha : a ∈ U, ha' : (f a, g a) ∈ (diagonal Y)ᶜ⟩

Result:
case intro
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
a : X
ha : a ∈ U
ha' : (f a, g a) ∈ (diagonal Y)ᶜ
⊢ {a | f a ≠ g a} ∈ 𝓝 a

Proof state:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
h : f =ᶠ[ae (μ.restrict U)] g
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
⊢ EqOn f g U

Tactic:
replace h := ae_imp_of_ae_restrict h

Result:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : ∀ᵐ (x : X) ∂μ, x ∈ U → f x = g x
⊢ EqOn f g U

Proof state:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
⊢ IsOpen (U ∩ {a | f a ≠ g a})

Tactic:
refine isOpen_iff_mem_nhds.mpr fun a ha => inter_mem (hU.mem_nhds ha.1) ?_

Result:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
a : X
ha : a ∈ U ∩ {a | f a ≠ g a}
⊢ {a | f a ≠ g a} ∈ 𝓝 a

Proof state:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : ∀ᵐ (x : X) ∂μ, x ∈ U → f x = g x
⊢ EqOn f g U

Tactic:
simp only [EventuallyEq, ae_iff, Classical.not_imp] at h

Result:
X : Type u_1
Y : Type u_2
inst✝³ : TopologicalSpace X
m : MeasurableSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : T2Space Y
μ : Measure X
inst✝ : μ.IsOpenPosMeasure
U : Set X
f g : X → Y
hU : IsOpen U
hf : ContinuousOn f U
hg : ContinuousOn g U
h : μ {a | a ∈ U ∧ ¬f a = g a} = 0
⊢ EqOn f g U