Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Topology/     Datei vom 15.10.2026 mit Größe 8 kB image not shown  

Quelle  Germ.lean   Sprache: Lean

 

/-
Copyright (c) 2023 Patrick Massot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Patrick Massot
-/

module

public import Mathlib.Algebra.BigOperators.Group.Finset.Defs
public import Mathlib.Algebra.Module.LinearMap.Defs
public import Mathlib.Algebra.Order.Hom.Ring
public import Mathlib.Order.Filter.Germ.Basic
public import Mathlib.Topology.LocallyConstant.Basic

/-! # Germs of functions between topological spaces

In this file, we prove basic properties of germs of functions between topological spaces,
with respect to the neighbourhood filter `�� x`.

## Main definitions and results

* `Filter.Germ.value φ f`: value associated to the germ `φ` at a point `x`, w.r.t. the
  neighbourhood filter at `x`. This is the common value of all representatives of `φ` at `x`.
* `Filter.Germ.valueOrderRingHom` and friends: the map `Germ (�� x) E → E` is a
  monoid homomorphism, ��-linear map, ring homomorphism, monotone ring homomorphism

* `RestrictGermPredicate`: given a predicate on germs `P : Π x : X, germ (�� x) Y → Prop` and
  `A : set X`, build a new predicate on germs `restrictGermPredicate P A` such that
  `(∀ x, RestrictGermPredicate P A x f) ↔ ∀ᶠ x near A, P x f`;
  `forall_restrictGermPredicate_iff` is this equivalence.

* `Filter.Germ.sliceLeft, sliceRight`: map the germ of functions `X × Y → Z` at `p = (x,y) ∈ X × Y`
  to the corresponding germ of functions `X → Z` at `x ∈ X` resp. `Y → Z` at `y ∈ Y`.
* `eq_of_germ_isConstant`: if each germ of `f : X → Y` is constant and `X` is pre-connected,
  `f` is constant.
-/


@[expose] public section

open scoped Topology

open Filter Set

variable {X Y Z : Type*} [TopologicalSpace X] {f g : X → Y} {A : Set X} {x : X}

namespace Filter.Germ

/-- The value associated to a germ at a point. This is the common value
shared by all representatives at the given point. -/

def value {X α : Type*} [TopologicalSpace X] {x : X} (φ : Germ (�� x) α) : α :=
  Quotient.liftOn' φ (fun f ↦ f x) fun f g h ↦ by rw [Eventually.self_of_nhds h]

@[simp]
theorem value_ofFun (f : X → Y) (x : X) : value (f : Germ (�� x) Y) = f x := rfl

@[simp]
theorem value_const (c : Y) (x : X) : value (c : Germ (�� x) Y) = c := rfl

theorem value_smul {α β : Type*} [SMul α β] (φ : Germ (�� x) α)
    (ψ : Germ (�� x) β) : (φ • ψ).value = φ.value • ψ.value :=
  Germ.inductionOn φ fun _ ↦ Germ.inductionOn ψ fun _ ↦ rfl

/-- The map `Germ (�� x) E → E` into a monoid `E` as a monoid homomorphism -/
@[to_additive /-- The map `Germ (�� x) E → E` as an additive monoid homomorphism -/]
def valueMulHom {X E : Type*} [Monoid E] [TopologicalSpace X] {x : X} : Germ (�� x) E →* E where
  toFun := Filter.Germ.value
  map_one' := rfl
  map_mul' φ ψ := Germ.inductionOn φ fun _ ↦ Germ.inductionOn ψ fun _ ↦ rfl

/-- The map `Germ (�� x) E → E` into a `��`-module `E` as a `��`-linear map -/
def valueₗ {X �� E : Type*} [Semiring ��] [AddCommMonoid E] [Module �� E] [TopologicalSpace X]
    {x : X} : Germ (�� x) E →ₗ[��] E where
  __ := Filter.Germ.valueAddHom
  map_smul' := fun _ φ ↦ Germ.inductionOn φ fun _ ↦ rfl

/-- The map `Germ (�� x) E → E` as a ring homomorphism -/
def valueRingHom {X E : Type*} [Semiring E] [TopologicalSpace X] {x : X} : Germ (�� x) E →+* E :=
  { Filter.Germ.valueMulHom, Filter.Germ.valueAddHom with }

/-- The map `Germ (�� x) E → E` as a monotone ring homomorphism -/
def valueOrderRingHom {X E : Type*} [Semiring E] [PartialOrder E] [TopologicalSpace X] {x : X} :
    Germ (�� x) E →+*o E where
  __ := Filter.Germ.valueRingHom
  monotone' := fun φ ψ ↦
  Germ.inductionOn φ fun _ ↦ Germ.inductionOn ψ fun _ h ↦ h.self_of_nhds

end Filter.Germ

section RestrictGermPredicate
/-- Given a predicate on germs `P : Π x : X, germ (�� x) Y → Prop` and `A : set X`,
build a new predicate on germs `RestrictGermPredicate P A` such that
`(∀ x, RestrictGermPredicate P A x f) ↔ ∀ᶠ x near A, P x f`, see
`forall_restrictGermPredicate_iff` for this equivalence. -/

def RestrictGermPredicate (P : ∀ x : X, Germ (�� x) Y → Prop)
    (A : Set X) : ∀ x : X, Germ (�� x) Y → Prop := fun x φ ↦
  Germ.liftOn φ (fun f ↦ x ∈ A → ∀ᶠ y in �� x, P y f)
    haveI : ∀ f f' : X → Y, f =ᶠ[�� x] f' → (∀ᶠ y in �� x, P y f) → ∀ᶠ y in �� x, P y f' := by
      intro f f' hff' hf
      apply (hf.and <| Eventually.eventually_nhds hff').mono
      rintro y ⟨hy, hy'⟩
      rwa [Germ.coe_eq.mpr (EventuallyEq.symm hy')]
    fun f f' hff' ↦ propext <| forall_congr' fun _ ↦ ⟨this f f' hff', this f' f hff'.symm⟩

theorem Filter.Eventually.germ_congr_set
    {P : ∀ x : X, Germ (�� x) Y → Prop} (hf : ∀ᶠ x in ��ˢ A, P x f)
    (h : ∀ᶠ z in ��ˢ A, g z = f z) : ∀ᶠ x in ��ˢ A, P x g := by
  rw [eventually_nhdsSet_iff_forall] at *
  intro x hx
  apply ((hf x hx).and (h x hx).eventually_nhds).mono
  intro y hy
  convert hy.1 using 1
  exact Germ.coe_eq.mpr hy.2

theorem restrictGermPredicate_congr {P : ∀ x : X, Germ (�� x) Y → Prop}
    (hf : RestrictGermPredicate P A x f) (h : ∀ᶠ z in ��ˢ A, g z = f z) :
    RestrictGermPredicate P A x g := by
  intro hx
  apply ((hf hx).and (eventually_nhdsSet_iff_forall.mp h x hx).eventually_nhds).mono
  rintro y ⟨hy, h'y⟩
  rwa [Germ.coe_eq.mpr h'y]

theorem forall_restrictGermPredicate_iff {P : ∀ x : X, Germ (�� x) Y → Prop} :
    (∀ x, RestrictGermPredicate P A x f) ↔ ∀ᶠ x in ��ˢ A, P x f := by
  rw [eventually_nhdsSet_iff_forall]
  rfl

theorem forall_restrictGermPredicate_of_forall
    {P : ∀ x : X, Germ (�� x) Y → Prop} (h : ∀ x, P x f) :
    ∀ x, RestrictGermPredicate P A x f :=
  forall_restrictGermPredicate_iff.mpr (Eventually.of_forall h)
end RestrictGermPredicate

namespace Filter.Germ
/-- Map the germ of functions `X × Y → Z` at `p = (x,y) ∈ X × Y` to the corresponding germ
  of functions `X → Z` at `x ∈ X` -/

def sliceLeft [TopologicalSpace Y] {p : X × Y} (P : Germ (�� p) Z) : Germ (�� p.1) Z :=
  P.compTendsto (Prod.mk · p.2) (Continuous.prodMk_left p.2).continuousAt

@[simp]
theorem sliceLeft_coe [TopologicalSpace Y] {y : Y} (f : X × Y → Z) :
    (↑f : Germ (�� (x, y)) Z).sliceLeft = fun x' ↦ f (x', y) :=
  rfl

/-- Map the germ of functions `X × Y → Z` at `p = (x,y) ∈ X × Y` to the corresponding germ
  of functions `Y → Z` at `y ∈ Y` -/

def sliceRight [TopologicalSpace Y] {p : X × Y} (P : Germ (�� p) Z) : Germ (�� p.2) Z :=
  P.compTendsto (Prod.mk p.1) (Continuous.prodMk_right p.1).continuousAt

@[simp]
theorem sliceRight_coe [TopologicalSpace Y] {y : Y} (f : X × Y → Z) :
    (↑f : Germ (�� (x, y)) Z).sliceRight = fun y' ↦ f (x, y') :=
  rfl

lemma isConstant_comp_subtype {s : Set X} {f : X → Y} {x : s}
    (hf : (f : Germ (�� (x : X)) Y).IsConstant) :
    ((f ∘ Subtype.val : s → Y) : Germ (�� x) Y).IsConstant :=
  isConstant_comp_tendsto hf continuousAt_subtype_val

end Filter.Germ

/-- If the germ of `f` w.r.t. each `�� x` is constant, `f` is locally constant. -/
lemma IsLocallyConstant.of_germ_isConstant (h : ∀ x : X, (f : Germ (�� x) Y).IsConstant) :
    IsLocallyConstant f := by
  intro s
  rw [isOpen_iff_mem_nhds]
  intro a ha
  obtain ⟨b, hb⟩ := h a
  apply mem_of_superset hb
  intro x hx
  have : f x = f a := (mem_of_mem_nhds hb) ▸ hx
  rw [mem_preimage, this]
  exact ha

theorem eq_of_germ_isConstant [i : PreconnectedSpace X]
    (h : ∀ x : X, (f : Germ (�� x) Y).IsConstant) (x x' : X) : f x = f x' :=
  (IsLocallyConstant.of_germ_isConstant h).apply_eq_of_isPreconnected
    (preconnectedSpace_iff_univ.mp i) (by trivial) (by trivial)

lemma eq_of_germ_isConstant_on {s : Set X} (h : ∀ x ∈ s, (f : Germ (�� x) Y).IsConstant)
    (hs : IsPreconnected s) {x' : X} (x_in : x ∈ s) (x'_in : x' ∈ s) : f x = f x' := by
  let i : s → X := fun x ↦ x
  change (f ∘ i) (⟨x, x_in⟩ : s) = (f ∘ i) (⟨x', x'_in⟩ : s)
  have : PreconnectedSpace s := Subtype.preconnectedSpace hs
  exact eq_of_germ_isConstant (fun y ↦ Germ.isConstant_comp_subtype (h y y.2)) _ _

@[to_additive (attr := simp)]
theorem Germ.coe_prod {α : Type*} (l : Filter α) (R : Type*) [CommMonoid R] {ι} (f : ι → α → R)
    (s : Finset ι) : ((∏ i ∈ s, f i : α → R) : Germ l R) = ∏ i ∈ s, (f i : Germ l R) :=
  map_prod (Germ.coeMulHom l : (α → R) →* Germ l R) f s

Messung
CHZG
9410010097

¤ Dauer der Verarbeitung: 0.9 Sekunden  ¤

*© Formatika GbR, Deutschland