@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Nicolò Cavalleri
55-/
66import Mathlib.Data.Set.UnionLift
7+ import Mathlib.Data.Set.Subset
78import Mathlib.Topology.ContinuousMap.Defs
89import Mathlib.Topology.Homeomorph.Defs
910import Mathlib.Topology.Separation.Hausdorff
@@ -165,6 +166,10 @@ def _root_.Homeomorph.continuousMapCongr {X₁ X₂ Y₁ Y₂ : Type*}
165166 left_inv _ := by aesop
166167 right_inv _ := by aesop
167168
169+ @[simp]
170+ lemma mk_apply {X Y : Type *} [TopologicalSpace X] [TopologicalSpace Y] (f : X → Y)
171+ (hf : Continuous f) (x : X) : { toFun := f, continuous_toFun := hf : C(X, Y) } x = f x:= by rfl
172+
168173section Prod
169174
170175variable {α₁ α₂ β₁ β₂ : Type *} [TopologicalSpace α₁] [TopologicalSpace α₂] [TopologicalSpace β₁]
@@ -199,6 +204,66 @@ def prodSwap : C(α × β, β × α) := .prodMk .snd .fst
199204
200205end Prod
201206
207+ section Sum
208+ variable {X Y : Type *} [TopologicalSpace X] [TopologicalSpace Y]
209+
210+ /-- `Sum.inl : X → X ⊕ Y` as a bundled continuous map. -/
211+ def inl : C(X, X ⊕ Y) where
212+ toFun := Sum.inl
213+ continuous_toFun := by continuity
214+
215+ @[simp]
216+ lemma coe_inl : ⇑(inl : C(X, X ⊕ Y)) = Sum.inl := rfl
217+
218+ /-- `Sum.inr : Y → X ⊕ Y` as a bundled continuous map. -/
219+ def inr : C(Y, X ⊕ Y) where
220+ toFun := Sum.inr
221+ continuous_toFun := by continuity
222+
223+ @[simp]
224+ lemma coe_inr : ⇑(inr : C(Y, X ⊕ Y)) = Sum.inr := rfl
225+
226+ /-- A continuous map from a sum can be defined by its action on the summands.
227+ This is `Continuous.sumElim` bundled into a continuous map. -/
228+ @[simps]
229+ def sum {X Y Z : Type *} [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z]
230+ (f : C(X, Z)) (g : C(Y, Z)) : C(X ⊕ Y, Z) where
231+ toFun := fun x ↦ Sum.elim f.toFun g.toFun x
232+ continuous_toFun := Continuous.sumElim f.continuous g.continuous
233+
234+ @[simp]
235+ lemma sum_comp_inl {X Y Z : Type *} [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z]
236+ (f : C(X, Z)) (g : C(Y, Z)) : (sum f g) ∘ Sum.inl = f := by
237+ ext x; simp
238+
239+ @[simp]
240+ lemma sum_comp_inr {X Y Z : Type *} [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z]
241+ (f : C(X, Z)) (g : C(Y, Z)) : (sum f g) ∘ Sum.inr = g := by
242+ ext x; simp
243+
244+
245+ /-- A continuous map between sums can be defined fiberwise by its action on the summands.
246+ This is `Continuous.sumMap` bundled into a continuous map. -/
247+ @[simps]
248+ def sumMap {X Y Z W : Type *}
249+ [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] [TopologicalSpace W]
250+ (f : C(X, Z)) (g : C(Y, W)) : C(X ⊕ Y, Z ⊕ W) where
251+ toFun := Sum.map f g
252+
253+ @[simp]
254+ lemma sumMap_comp_inl {X Y Z W : Type *}
255+ [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] [TopologicalSpace W]
256+ (f : C(X, Z)) (g : C(Y, W)) : (sumMap f g) ∘ Sum.inl = Sum.inl ∘ f := by
257+ ext x; simp
258+
259+ @[simp]
260+ lemma sumMap_comp_inr {X Y Z W : Type *}
261+ [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] [TopologicalSpace W]
262+ (f : C(X, Z)) (g : C(Y, W)) : (sumMap f g) ∘ Sum.inr = Sum.inr ∘ g := by
263+ ext x; simp
264+
265+ end Sum
266+
202267section Sigma
203268
204269variable {I A : Type *} {X : I → Type *} [TopologicalSpace A] [∀ i, TopologicalSpace (X i)]
@@ -208,6 +273,8 @@ variable {I A : Type*} {X : I → Type*} [TopologicalSpace A] [∀ i, Topologica
208273def sigmaMk (i : I) : C(X i, Σ i, X i) where
209274 toFun := Sigma.mk i
210275
276+ lemma coe_sigmaMk (i : I) : ⇑(sigmaMk (X := X) i) = Sigma.mk i := rfl
277+
211278/--
212279To give a continuous map out of a disjoint union, it suffices to give a continuous map out of
213280each term. This is `Sigma.uncurry` for continuous maps.
@@ -216,6 +283,29 @@ each term. This is `Sigma.uncurry` for continuous maps.
216283def sigma (f : ∀ i, C(X i, A)) : C((Σ i, X i), A) where
217284 toFun ig := f ig.fst ig.snd
218285
286+ lemma coe_sigma (f : ∀ i, C(X i, A)) : ⇑(sigma f) = Sigma.uncurry (f · ·) := rfl
287+
288+ @[simp]
289+ lemma sigma_comp_mk
290+ {I A} {X : I → Type *} [TopologicalSpace A] [(i : I) → TopologicalSpace (X i)]
291+ (f : (i : I) → C(X i, A)) (i : I) : (sigma f).comp (sigmaMk i) = f i := by
292+ ext x; simp
293+
294+ /-- A continuous map between sigma types can be defined fiberwise by its action on the summands.
295+ This is `Continuous.sigma_map` bundled into a continuous map. -/
296+ @[simps]
297+ def sigmaMap {ι κ : Type *} {σ : ι → Type *} {τ : κ → Type *}
298+ [(i : ι) → TopologicalSpace (σ i)] [(k : κ) → TopologicalSpace (τ k)]
299+ (f₁ : ι → κ) (f₂ : (i : ι) → C(σ i, τ (f₁ i))) : C(Sigma σ, Sigma τ) where
300+ toFun := (Sigma.map f₁ (f₂ ·))
301+
302+ @[simp]
303+ lemma sigmaMap_comp_mk {ι κ : Type *} {σ : ι → Type *} {τ : κ → Type *}
304+ [(i : ι) → TopologicalSpace (σ i)] [(k : κ) → TopologicalSpace (τ k)]
305+ (f₁ : ι → κ) (f₂ : (i : ι) → C(σ i, τ (f₁ i))) (i : ι) :
306+ (sigmaMap f₁ f₂).comp (sigmaMk i) = (sigmaMk (f₁ i)).comp (f₂ i) := by
307+ ext x <;> simp [Sigma.map]
308+
219309variable (A X) in
220310/--
221311Giving a continuous map out of a disjoint union is the same as giving a continuous map out of
@@ -300,6 +390,15 @@ def restrictPreimage (f : C(α, β)) (s : Set β) : C(f ⁻¹' s, s) :=
300390 ⟨s.restrictPreimage f, continuous_iff_continuousAt.mpr fun _ ↦
301391 (map_continuousAt f _).restrictPreimage⟩
302392
393+ open Set in
394+ /-- Given a function `f : α → β` s.t. `MapsTo f s t`, if `f` is continuous on `s` then `f` can
395+ be lifted into a continuous map from `s` to `t`. -/
396+ @ [simps -fullyApplied]
397+ def mapsTo (f : α → β) (s : Set α) (t : Set β) (h : MapsTo f s t) (hf : ContinuousOn f s) :
398+ C(s, t) where
399+ toFun := MapsTo.restrict f s t h
400+ continuous_toFun := ContinuousOn.restrict_mapsTo hf _
401+
303402end Restrict
304403
305404section mkD
0 commit comments