Skip to content

Commit

Permalink
chore(Geometry): remove a few porting notes (#12061)
Browse files Browse the repository at this point in the history
In all cases, the original proof fixed itself.
  • Loading branch information
grunweg committed Apr 11, 2024
1 parent 8856dfd commit 488eafd
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 39 deletions.
2 changes: 0 additions & 2 deletions Mathlib/Geometry/Manifold/ContMDiff/Product.lean
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,6 @@ variable {ι : Type*} [Fintype ι] {Fi : ι → Type*} [∀ i, NormedAddCommGrou
theorem contMDiffWithinAt_pi_space :
ContMDiffWithinAt I 𝓘(𝕜, ∀ i, Fi i) n φ s x ↔
∀ i, ContMDiffWithinAt I 𝓘(𝕜, Fi i) n (fun x => φ x i) s x := by
-- Porting note: `simp` fails to apply it on the LHS
rw [contMDiffWithinAt_iff]
simp only [contMDiffWithinAt_iff, continuousWithinAt_pi, contDiffWithinAt_pi, forall_and,
writtenInExtChartAt, extChartAt_model_space_eq_id, (· ∘ ·), PartialEquiv.refl_coe, id]
#align cont_mdiff_within_at_pi_space contMDiffWithinAt_pi_space
Expand Down
11 changes: 5 additions & 6 deletions Mathlib/Geometry/Manifold/Diffeomorph.lean
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,11 @@ with model `I.trans_diffeomorph e`. -/
def toTransDiffeomorph (e : E ≃ₘ[𝕜] F) : M ≃ₘ⟮I, I.transDiffeomorph e⟯ M where
toEquiv := Equiv.refl M
contMDiff_toFun x := by
refine' contMDiffWithinAt_iff'.2 ⟨continuousWithinAt_id, _⟩
refine' e.contDiff.contDiffWithinAt.congr' (fun y hy => _) _
· simp only [Equiv.coe_refl, id, (· ∘ ·), I.coe_extChartAt_transDiffeomorph]
-- Porting note: `simp only` failed to used next lemma, converted to `rw`
rw [(extChartAt I x).right_inv hy.1]
exact
refine contMDiffWithinAt_iff'.2 ⟨continuousWithinAt_id, ?_⟩
refine e.contDiff.contDiffWithinAt.congr' (fun y hy ↦ ?_) ?_
· simp only [Equiv.coe_refl, id, (· ∘ ·), I.coe_extChartAt_transDiffeomorph,
(extChartAt I x).right_inv hy.1]
· exact
⟨(extChartAt I x).map_source (mem_extChartAt_source I x), trivial, by simp only [mfld_simps]⟩
contMDiff_invFun x := by
refine' contMDiffWithinAt_iff'.2 ⟨continuousWithinAt_id, _⟩
Expand Down
4 changes: 1 addition & 3 deletions Mathlib/Geometry/Manifold/VectorBundle/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,7 @@ is a smooth vector bundle. -/
instance smoothVectorBundle : SmoothVectorBundle F Z.Fiber IB where
smoothOn_coordChangeL := by
rintro - - ⟨i, rfl⟩ ⟨i', rfl⟩
-- Porting note: Originally `Z.smoothOn_coordChange IB i i'`
refine'
(VectorBundleCore.IsSmooth.smoothOn_coordChange (Z := Z) (IB := IB) i i').congr fun b hb => _
refine (Z.smoothOn_coordChange IB i i').congr fun b hb ↦ ?_
ext v
exact Z.localTriv_coordChange_eq i i' hb v
#align vector_bundle_core.smooth_vector_bundle VectorBundleCore.smoothVectorBundle
Expand Down
48 changes: 22 additions & 26 deletions Mathlib/Geometry/Manifold/VectorBundle/FiberwiseLinear.lean
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,6 @@ theorem SmoothFiberwiseLinear.locality_aux₂ (e : PartialHomeomorph (B × F) (B
apply hux
#align smooth_fiberwise_linear.locality_aux₂ SmoothFiberwiseLinear.locality_aux₂

/- Porting note: `simp only [mem_iUnion]` fails in the next definition. This aux lemma is a
workaround. -/
private theorem mem_aux {e : PartialHomeomorph (B × F) (B × F)} :
(e ∈ ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
(hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
(h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
{e | e.EqOnSource (FiberwiseLinear.partialHomeomorph φ hU hφ.continuousOn
h2φ.continuousOn)}) ↔
∃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
(hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
(h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
e.EqOnSource
(FiberwiseLinear.partialHomeomorph φ hU hφ.continuousOn h2φ.continuousOn) := by
simp only [mem_iUnion, mem_setOf_eq]

variable (F B IB)

/-- For `B` a manifold and `F` a normed space, the groupoid on `B × F` consisting of local
Expand All @@ -249,7 +234,7 @@ def smoothFiberwiseLinear : StructureGroupoid (B × F) where
(h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
{e | e.EqOnSource (FiberwiseLinear.partialHomeomorph φ hU hφ.continuousOn h2φ.continuousOn)}
trans' := by
simp only [mem_aux]
simp only [mem_iUnion]
rintro e e' ⟨φ, U, hU, hφ, h2φ, heφ⟩ ⟨φ', U', hU', hφ', h2φ', heφ'⟩
refine' ⟨fun b => (φ b).trans (φ' b), _, hU.inter hU', _, _,
Setoid.trans (PartialHomeomorph.EqOnSource.trans' heφ heφ') ⟨_, _⟩⟩
Expand All @@ -272,27 +257,38 @@ def smoothFiberwiseLinear : StructureGroupoid (B × F) where
simp_rw [ContinuousLinearEquiv.symm_symm]
exact hφ
id_mem' := by
/- porting note: `simp_rw [mem_iUnion]` failed; expanding. Was:
simp_rw [mem_iUnion]
refine' ⟨fun b => ContinuousLinearEquiv.refl 𝕜 F, univ, isOpen_univ, _, _, ⟨_, fun b hb => _⟩⟩
-/
refine mem_iUnion.2fun _ ↦ .refl 𝕜 F, mem_iUnion.2 ⟨univ, mem_iUnion.2 ⟨isOpen_univ, ?_⟩⟩⟩
refine mem_iUnion.2 ⟨contMDiffOn_const, mem_iUnion.2 ⟨contMDiffOn_const, ?_, ?_⟩⟩
· simp only [FiberwiseLinear.partialHomeomorph, PartialHomeomorph.refl_partialEquiv,
PartialEquiv.refl_source, univ_prod_univ]
· exact eqOn_refl id _
refine ⟨fun _ ↦ ContinuousLinearEquiv.refl 𝕜 F, univ, isOpen_univ, smoothOn_const,
smoothOn_const, ⟨?_, fun b _hb ↦ rfl⟩⟩
simp only [FiberwiseLinear.partialHomeomorph, PartialHomeomorph.refl_partialEquiv,
PartialEquiv.refl_source, univ_prod_univ]
locality' := by
-- the hard work has been extracted to `locality_aux₁` and `locality_aux₂`
simp only [mem_aux]
simp only [mem_iUnion]
intro e he
obtain ⟨U, hU, h⟩ := SmoothFiberwiseLinear.locality_aux₁ e he
exact SmoothFiberwiseLinear.locality_aux₂ e U hU h
mem_of_eqOnSource' := by
simp only [mem_aux]
simp only [mem_iUnion]
rintro e e' ⟨φ, U, hU, hφ, h2φ, heφ⟩ hee'
exact ⟨φ, U, hU, hφ, h2φ, Setoid.trans hee' heφ⟩
#align smooth_fiberwise_linear smoothFiberwiseLinear

variable {F B IB} in
-- TODO: can this be inlined into the next lemma?
private theorem mem_aux {e : PartialHomeomorph (B × F) (B × F)} :
(e ∈ ⋃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
(hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
(h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
{e | e.EqOnSource (FiberwiseLinear.partialHomeomorph φ hU hφ.continuousOn
h2φ.continuousOn)}) ↔
∃ (φ : B → F ≃L[𝕜] F) (U : Set B) (hU : IsOpen U)
(hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => φ x : B → F →L[𝕜] F) U)
(h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x).symm : B → F →L[𝕜] F) U),
e.EqOnSource
(FiberwiseLinear.partialHomeomorph φ hU hφ.continuousOn h2φ.continuousOn) := by
simp only [mem_iUnion, mem_setOf_eq]

@[simp]
theorem mem_smoothFiberwiseLinear_iff (e : PartialHomeomorph (B × F) (B × F)) :
e ∈ smoothFiberwiseLinear B F IB ↔
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ theorem tangentBundle_model_space_chartAt (p : TangentBundle I H) :
ext x : 1
· ext; · rfl
exact (tangentBundleCore I H).coordChange_self (achart _ x.1) x.1 (mem_achart_source H x.1) x.2
· -- Porting note: was ext; · rfl; apply hEq_of_eq
refine congr_arg (TotalSpace.mk _) ?_
· ext; · rfl
apply heq_of_eq
exact (tangentBundleCore I H).coordChange_self (achart _ x.1) x.1 (mem_achart_source H x.1) x.2
simp_rw [TangentBundle.chartAt, FiberBundleCore.localTriv,
FiberBundleCore.localTrivAsPartialEquiv, VectorBundleCore.toFiberBundleCore_baseSet,
Expand Down

0 comments on commit 488eafd

Please sign in to comment.