Skip to content

Commit

Permalink
feat(geometry/manifold|topology): add simps and ext attributes (#15314)
Browse files Browse the repository at this point in the history
* From the sphere eversion project
  • Loading branch information
fpvandoorn committed Jul 16, 2022
1 parent 21a387f commit 3d6c3b6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
17 changes: 16 additions & 1 deletion src/geometry/manifold/smooth_manifold_with_corners.lean
Expand Up @@ -161,6 +161,21 @@ instance : has_coe_to_fun (model_with_corners 𝕜 E H) (λ _, H → E) := ⟨λ
/-- The inverse to a model with corners, only registered as a local equiv. -/
protected def symm : local_equiv E H := I.to_local_equiv.symm

/-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
because it is a composition of multiple projections. -/
def simps.apply (𝕜 : Type*) [nondiscrete_normed_field 𝕜]
(E : Type*) [normed_group E] [normed_space 𝕜 E] (H : Type*) [topological_space H]
(I : model_with_corners 𝕜 E H) : H → E := I

/-- See Note [custom simps projection] -/
def simps.symm_apply (𝕜 : Type*) [nondiscrete_normed_field 𝕜]
(E : Type*) [normed_group E] [normed_space 𝕜 E] (H : Type*) [topological_space H]
(I : model_with_corners 𝕜 E H) : E → H := I.symm

initialize_simps_projections model_with_corners
(to_local_equiv_to_fun → apply, to_local_equiv_inv_fun → symm_apply,
to_local_equiv_source → source, to_local_equiv_target → target, -to_local_equiv)

/- Register a few lemmas to make sure that `simp` puts expressions in normal form -/
@[simp, mfld_simps] lemma to_local_equiv_coe : (I.to_local_equiv : H → E) = I :=
rfl
Expand Down Expand Up @@ -289,7 +304,7 @@ corners `I.prod I'` on `(E × E', model_prod H H')`. This appears in particular
structure on the tangent bundle to a manifold modelled on `(E, H)`: it will be modelled on
`(E × E, H × E)`. See note [Manifold type tags] for explanation about `model_prod H H'`
vs `H × H'`. -/
def model_with_corners.prod
@[simps (lemmas_only)] def model_with_corners.prod
{𝕜 : Type u} [nondiscrete_normed_field 𝕜]
{E : Type v} [normed_group E] [normed_space 𝕜 E] {H : Type w} [topological_space H]
(I : model_with_corners 𝕜 E H)
Expand Down
4 changes: 3 additions & 1 deletion src/geometry/manifold/tangent_bundle.lean
Expand Up @@ -149,6 +149,7 @@ begin
end

/-- Vector bundle core associated to a basic smooth bundle core -/
@[simps coord_change index_at]
def to_topological_vector_bundle_core : topological_vector_bundle_core 𝕜 M F (atlas H M) :=
{ base_set := λ i, i.1.source,
is_open_base_set := λ i, i.1.open_source,
Expand Down Expand Up @@ -191,6 +192,7 @@ by { simp only [chart], mfld_set_tac }

/-- The total space of a basic smooth bundle is endowed with a charted space structure, where the
charts are in bijection with the charts of the basis. -/
@[simps chart_at (lemmas_only)]
instance to_charted_space :
charted_space (model_prod H F) Z.to_topological_vector_bundle_core.total_space :=
{ atlas := ⋃(e : local_homeomorph M H) (he : e ∈ atlas H M), {Z.chart he},
Expand Down Expand Up @@ -295,7 +297,7 @@ variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜]
/-- Basic smooth bundle core version of the tangent bundle of a smooth manifold `M` modelled over a
model with corners `I` on `(E, H)`. The fibers are equal to `E`, and the coordinate change in the
fiber corresponds to the derivative of the coordinate change in `M`. -/
def tangent_bundle_core : basic_smooth_vector_bundle_core I M E :=
@[simps] def tangent_bundle_core : basic_smooth_vector_bundle_core I M E :=
{ coord_change := λ i j x, (fderiv_within 𝕜 (I ∘ j.1 ∘ i.1.symm ∘ I.symm) (range I) (I x)),
coord_change_smooth_clm := λ i j,
begin
Expand Down
9 changes: 7 additions & 2 deletions src/topology/fiber_bundle.lean
Expand Up @@ -164,7 +164,7 @@ below as `trivialization F proj`) if the total space has not been given a topolo
have a topology on both the fiber and the base space. Through the construction
`topological_fiber_prebundle F proj` it will be possible to promote a
`pretrivialization F proj` to a `trivialization F proj`. -/
@[nolint has_inhabited_instance]
@[ext, nolint has_inhabited_instance]
structure topological_fiber_bundle.pretrivialization (proj : Z → B) extends local_equiv Z (B × F) :=
(open_target : is_open target)
(base_set : set B)
Expand Down Expand Up @@ -278,7 +278,7 @@ A structure extending local homeomorphisms, defining a local trivialization of a
`proj : Z → B` with fiber `F`, as a local homeomorphism between `Z` and `B × F` defined between two
sets of the form `proj ⁻¹' base_set` and `base_set × F`, acting trivially on the first coordinate.
-/
@[nolint has_inhabited_instance]
@[ext, nolint has_inhabited_instance]
structure topological_fiber_bundle.trivialization (proj : Z → B)
extends local_homeomorph Z (B × F) :=
(base_set : set B)
Expand All @@ -300,6 +300,11 @@ instance : has_coe_to_fun (trivialization F proj) (λ _, Z → B × F) := ⟨λ
instance : has_coe (trivialization F proj) (pretrivialization F proj) :=
⟨to_pretrivialization⟩

lemma to_pretrivialization_injective :
function.injective (λ e : trivialization F proj, e.to_pretrivialization) :=
by { intros e e', rw [pretrivialization.ext_iff, trivialization.ext_iff,
← local_homeomorph.to_local_equiv_injective.eq_iff], exact id }

@[simp, mfld_simps] lemma coe_coe : ⇑e.to_local_homeomorph = e := rfl
@[simp, mfld_simps] lemma coe_fst (ex : x ∈ e.source) : (e x).1 = proj x := e.proj_to_fun x ex
protected lemma eq_on : eq_on (prod.fst ∘ e) proj e.source := λ x hx, e.coe_fst hx
Expand Down
9 changes: 7 additions & 2 deletions src/topology/vector_bundle/basic.lean
Expand Up @@ -56,7 +56,7 @@ variables [semiring R] [∀ x, add_comm_monoid (E x)] [∀ x, module R (E x)]
/-- A pretrivialization for a (yet to be defined) topological vector bundle `total_space E` is a
local equiv between sets of the form `proj ⁻¹' base_set` and `base_set × F` which respects the
first coordinate, and is linear in each fiber. -/
@[nolint has_inhabited_instance]
@[ext, nolint has_inhabited_instance]
structure topological_vector_bundle.pretrivialization extends to_fiber_bundle_pretrivialization :
topological_fiber_bundle.pretrivialization F (@total_space.proj B E) :=
(linear' : ∀ x ∈ base_set, is_linear_map R (λ y : E x, (to_fun (total_space_mk x y)).2))
Expand Down Expand Up @@ -234,7 +234,7 @@ A structure extending local homeomorphisms, defining a local trivialization of t
and `B × F` defined between two sets of the form `proj ⁻¹' base_set` and `base_set × F`,
acting trivially on the first coordinate and linear in the fibers.
-/
@[nolint has_inhabited_instance]
@[ext, nolint has_inhabited_instance]
structure topological_vector_bundle.trivialization extends to_fiber_bundle_trivialization :
topological_fiber_bundle.trivialization F (@total_space.proj B E) :=
(linear' : ∀ x ∈ base_set, is_linear_map R (λ y : E x, (to_fun (total_space_mk x y)).2))
Expand All @@ -261,6 +261,11 @@ e.linear' b hb

protected lemma continuous_on : continuous_on e e.source := e.continuous_to_fun

lemma to_pretrivialization_injective :
function.injective (λ e : trivialization R F E, e.to_pretrivialization) :=
by { intros e e', rw [pretrivialization.ext_iff, trivialization.ext_iff,
← topological_fiber_bundle.trivialization.to_pretrivialization_injective.eq_iff], exact id }

@[simp, mfld_simps] lemma coe_coe : ⇑e.to_local_homeomorph = e := rfl
@[simp, mfld_simps] lemma coe_fst (ex : x ∈ e.source) : (e x).1 = x.proj := e.proj_to_fun x ex
lemma mem_source : x ∈ e.source ↔ x.proj ∈ e.base_set := by rw [e.source_eq, mem_preimage]
Expand Down

0 comments on commit 3d6c3b6

Please sign in to comment.