Skip to content

Commit

Permalink
feat(topology/separation): add eq_on_closure₂ (#16206)
Browse files Browse the repository at this point in the history
Also use it to golf `submonoid.comm_monoid_topological_closure`.
  • Loading branch information
urkud committed Aug 24, 2022
1 parent 6274086 commit a51c2fd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
23 changes: 4 additions & 19 deletions src/topology/algebra/monoid.lean
Expand Up @@ -295,25 +295,10 @@ topological closure."]
def submonoid.comm_monoid_topological_closure [t2_space M] (s : submonoid M)
(hs : ∀ (x y : s), x * y = y * x) : comm_monoid s.topological_closure :=
{ mul_comm :=
begin
intros a b,
have h₁ : (s.topological_closure : set M) = closure s := rfl,
let f₁ := λ (x : M × M), x.1 * x.2,
let f₂ := λ (x : M × M), x.2 * x.1,
let S : set (M × M) := s ×ˢ s,
have h₃ : set.eq_on f₁ f₂ (closure S),
{ refine set.eq_on.closure _ continuous_mul (by continuity),
intros x hx,
rw [set.mem_prod] at hx,
rcases hx with ⟨hx₁, hx₂⟩,
change ((⟨x.1, hx₁⟩ : s) : M) * (⟨x.2, hx₂⟩ : s) = (⟨x.2, hx₂⟩ : s) * (⟨x.1, hx₁⟩ : s),
exact_mod_cast hs _ _ },
ext,
change f₁ ⟨a, b⟩ = f₂ ⟨a, b⟩,
refine h₃ _,
rw [closure_prod_eq, set.mem_prod],
exact ⟨by simp [←h₁], by simp [←h₁]⟩
end,
have ∀ (x ∈ s) (y ∈ s), x * y = y * x,
from λ x hx y hy, congr_arg subtype.val (hs ⟨x, hx⟩ ⟨y, hy⟩),
λ ⟨x, hx⟩ ⟨y, hy⟩, subtype.ext $
eq_on_closure₂ this continuous_mul (continuous_snd.mul continuous_fst) x hx y hy,
..s.topological_closure.to_monoid }

@[to_additive exists_open_nhds_zero_half]
Expand Down
18 changes: 17 additions & 1 deletion src/topology/separation.lean
Expand Up @@ -1021,7 +1021,7 @@ begin
{ exact ⟨_, _, is_open_range_sigma_mk, is_open_range_sigma_mk, ⟨x, rfl⟩, ⟨y, rfl⟩, by tidy⟩ }
end

variables [topological_space β]
variables {γ : Type*} [topological_space β] [topological_space γ]

lemma is_closed_eq [t2_space α] {f g : β → α}
(hf : continuous f) (hg : continuous g) : is_closed {x:β | f x = g x} :=
Expand All @@ -1044,6 +1044,22 @@ lemma continuous.ext_on [t2_space α] {s : set β} (hs : dense s) {f g : β →
f = g :=
funext $ λ x, h.closure hf hg (hs x)

lemma eq_on_closure₂' [t2_space α] {s : set β} {t : set γ} {f g : β → γ → α}
(h : ∀ (x ∈ s) (y ∈ t), f x y = g x y)
(hf₁ : ∀ x, continuous (f x)) (hf₂ : ∀ y, continuous (λ x, f x y))
(hg₁ : ∀ x, continuous (g x)) (hg₂ : ∀ y, continuous (λ x, g x y)) :
∀ (x ∈ closure s) (y ∈ closure t), f x y = g x y :=
suffices closure s ⊆ ⋂ y ∈ closure t, {x | f x y = g x y}, by simpa only [subset_def, mem_Inter],
closure_minimal (λ x hx, mem_Inter₂.2 $ set.eq_on.closure (h x hx) (hf₁ _) (hg₁ _)) $
is_closed_bInter $ λ y hy, is_closed_eq (hf₂ _) (hg₂ _)

lemma eq_on_closure₂ [t2_space α] {s : set β} {t : set γ} {f g : β → γ → α}
(h : ∀ (x ∈ s) (y ∈ t), f x y = g x y)
(hf : continuous (uncurry f)) (hg : continuous (uncurry g)) :
∀ (x ∈ closure s) (y ∈ closure t), f x y = g x y :=
eq_on_closure₂' h (λ x, continuous_uncurry_left x hf) (λ x, continuous_uncurry_right x hf)
(λ y, continuous_uncurry_left y hg) (λ y, continuous_uncurry_right y hg)

/-- If `f x = g x` for all `x ∈ s` and `f`, `g` are continuous on `t`, `s ⊆ t ⊆ closure s`, then
`f x = g x` for all `x ∈ t`. See also `set.eq_on.closure`. -/
lemma set.eq_on.of_subset_closure [t2_space α] {s t : set β} {f g : β → α} (h : eq_on f g s)
Expand Down

0 comments on commit a51c2fd

Please sign in to comment.