Skip to content

Commit 01cceef

Browse files
committed
chore: make ModelProd and ModelPi implicit_reducible (leanprover-community#42038)
They should not be instance reducible (their entire raison d'être is to be a type synonym to disambiguate typeclass synthesis), but they can be implicit_reducible just fine. This allows removing another 10-20 backcompat options.
1 parent c7202db commit 01cceef

9 files changed

Lines changed: 5 additions & 17 deletions

File tree

Mathlib/Geometry/Manifold/Algebra/Structures.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ instance (priority := 100) ContMDiffRing.toLieAddGroup (I : ModelWithCorners
4848

4949
end ContMDiffRing
5050

51-
set_option backward.isDefEq.respectTransparency false in
5251
-- see Note [lower instance priority]
5352
instance (priority := 100) instFieldContMDiffRing
5453
{𝕜 : Type*} [NontriviallyNormedField 𝕜] {n : ℕ∞ω} :
@@ -57,7 +56,7 @@ instance (priority := 100) instFieldContMDiffRing
5756
contMDiff_mul := by
5857
rw [contMDiff_iff]
5958
refine ⟨continuous_mul, fun x y => ?_⟩
60-
simp only [mfld_simps]
59+
simp only [mfld_simps, chartAt_self_eq]
6160
rw [contDiffOn_univ]
6261
exact contDiff_mul }
6362

Mathlib/Geometry/Manifold/ChartedSpace.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,13 @@ solves this problem. -/
400400

401401
/-- Same thing as `H × H'`. We introduce it for technical reasons,
402402
see note [Manifold type tags]. -/
403+
@[implicit_reducible]
403404
def ModelProd (H : Type*) (H' : Type*) :=
404405
H × H'
405406

406407
/-- Same thing as `∀ i, H i`. We introduce it for technical reasons,
407408
see note [Manifold type tags]. -/
409+
@[implicit_reducible]
408410
def ModelPi {ι : Type*} (H : ι → Type*) :=
409411
∀ i, H i
410412

@@ -462,7 +464,6 @@ theorem prodChartedSpace_chartAt :
462464
chartAt (ModelProd H H') x = (chartAt H x.fst).prod (chartAt H' x.snd) :=
463465
rfl
464466

465-
set_option backward.isDefEq.respectTransparency false in
466467
theorem chartedSpaceSelf_prod : prodChartedSpace H H H' H' = chartedSpaceSelf (H × H') := by
467468
ext1
468469
· simp [atlas, ChartedSpace.atlas]

Mathlib/Geometry/Manifold/Immersion.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ lemma _root_.IsOpen.isImmersionAtOfComplement :
360360
IsOpen {x | IsImmersionAtOfComplement F I J n f x} :=
361361
IsOpen.liftSourceTargetPropertyAt
362362

363-
set_option backward.isDefEq.respectTransparency false in
364363
/-- If `f: M → N` and `g: M' × N'` are immersions at `x` and `x'`, respectively,
365364
then `f × g: M × N → M' × N'` is an immersion at `(x, x')`. -/
366365
theorem prodMap {f : M → N} {g : M' → N'} {x' : M'}
@@ -631,7 +630,6 @@ lemma congr_iff (hfg : f =ᶠ[𝓝 x] g) :
631630
IsImmersionAt I J n f x ↔ IsImmersionAt I J n g x :=
632631
fun h ↦ h.congr_of_eventuallyEq hfg, fun h ↦ h.congr_of_eventuallyEq hfg.symm⟩
633632

634-
set_option backward.isDefEq.respectTransparency false in
635633
/- The set of points where `IsImmersionAt` holds is open. -/
636634
lemma _root_.IsOpen.isImmersionAt :
637635
IsOpen {x | IsImmersionAt I J n f x} := by

Mathlib/Geometry/Manifold/IsManifold/Basic.lean

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ def ModelWithCorners.prod {𝕜 : Type u} [NontriviallyNormedField 𝕜] {E : Ty
517517
continuous_toFun := I.continuous_toFun.prodMap I'.continuous_toFun
518518
continuous_invFun := I.continuous_invFun.prodMap I'.continuous_invFun }
519519

520-
set_option backward.isDefEq.respectTransparency false in
521520
/-- Given a finite family of `ModelWithCorners` `I i` on `(E i, H i)`, we define the model with
522521
corners `pi I` on `(Π i, E i, ModelPi H)`. See note [Manifold type tags] for explanation about
523522
`ModelPi H`. -/
@@ -609,16 +608,15 @@ instance modelWithCornersSelf_boundaryless (𝕜 : Type*) [NontriviallyNormedFie
609608
[NormedAddCommGroup E] [NormedSpace 𝕜 E] : (modelWithCornersSelf 𝕜 E).Boundaryless :=
610609
by simp⟩
611610

612-
set_option backward.isDefEq.respectTransparency false in
613611
/-- If two model with corners are boundaryless, their product also is -/
614612
instance ModelWithCorners.range_eq_univ_prod {𝕜 : Type u} [NontriviallyNormedField 𝕜] {E : Type v}
615613
[NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type w} [TopologicalSpace H]
616614
(I : ModelWithCorners 𝕜 E H) [I.Boundaryless] {E' : Type v'} [NormedAddCommGroup E']
617615
[NormedSpace 𝕜 E'] {H' : Type w'} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H')
618616
[I'.Boundaryless] : (I.prod I').Boundaryless := by
619617
constructor
620-
dsimp [ModelWithCorners.prod, ModelProd]
621-
rw [← prod_range_range_eq, ModelWithCorners.Boundaryless.range_eq_univ,
618+
dsimp
619+
rw [Set.range_prodMap, ModelWithCorners.Boundaryless.range_eq_univ,
622620
ModelWithCorners.Boundaryless.range_eq_univ, univ_prod_univ]
623621

624622
end Boundaryless
@@ -922,7 +920,6 @@ theorem of_discreteTopology [DiscreteTopology M] [Unique E] :
922920
attribute [local instance] ChartedSpace.ofDiscreteTopology in
923921
example [Unique E] : IsManifold (𝓘(𝕜, E)) n (Fin 2) := of_discreteTopology _
924922

925-
set_option backward.isDefEq.respectTransparency false in
926923
/-- The product of two `C^n` manifolds is naturally a `C^n` manifold. -/
927924
instance prod {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E]
928925
[NormedSpace 𝕜 E] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H : Type*}
@@ -944,7 +941,6 @@ variable {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*}
944941
[TopologicalSpace H'] {I' : ModelWithCorners 𝕜 E' H'} {n : ℕ∞ω}
945942
{M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M']
946943

947-
set_option backward.isDefEq.respectTransparency false in
948944
lemma mem_maximalAtlas_prod [IsManifold I n M] [IsManifold I' n M']
949945
{e : OpenPartialHomeomorph M H} (he : e ∈ maximalAtlas I n M)
950946
{e' : OpenPartialHomeomorph M' H'} (he' : e' ∈ maximalAtlas I' n M') :

Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,6 @@ variable {G G' F F' N N' : Type*}
835835
{J : ModelWithCorners 𝕜 F G} {J' : ModelWithCorners 𝕜 F' G'}
836836
[ChartedSpace G N] [ChartedSpace G' N']
837837

838-
set_option backward.isDefEq.respectTransparency false in
839838
lemma writtenInExtChartAt_prod {f : M → N} {g : M' → N'} {x : M} {x' : M'} :
840839
(writtenInExtChartAt (I.prod I') (J.prod J') (x, x') (Prod.map f g)) =
841840
Prod.map (writtenInExtChartAt I J x f) (writtenInExtChartAt I' J' x' g) := by
@@ -865,7 +864,6 @@ theorem ext_chart_model_space_apply {x y : E} : extChartAt 𝓘(𝕜, E) x y = y
865864

866865
variable {𝕜}
867866

868-
set_option backward.isDefEq.respectTransparency false in
869867
theorem extChartAt_prod (x : M × M') :
870868
extChartAt (I.prod I') x = (extChartAt I x.1).prod (extChartAt I' x.2) := by
871869
simp only [mfld_simps]

Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ variable
491491
{N : Type*} [TopologicalSpace N] [ChartedSpace H' N]
492492
{J : ModelWithCorners 𝕜 E' H'} {x : M} {y : N}
493493

494-
set_option backward.isDefEq.respectTransparency false in
495494
/-- The interior of `M × N` is the product of the interiors of `M` and `N`. -/
496495
lemma interior_prod :
497496
(I.prod J).interior (M × N) = (I.interior M) ×ˢ (J.interior N) := by

Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ theorem MDifferentiableOn.prodMap (hf : MDiff[s] f) (hg : MDiff[r] g) :
479479
theorem MDifferentiable.prodMap (hf : MDiff f) (hg : MDiff g) : MDiff (Prod.map f g) := fun p ↦
480480
(hf p.1).prodMap' (hg p.2)
481481

482-
set_option backward.isDefEq.respectTransparency false in
483482
lemma HasMFDerivWithinAt.prodMap {s : Set <| M × M'} {p : M × M'} {f : M → N} {g : M' → N'}
484483
{df : TangentSpace% p.1 →L[𝕜] TangentSpace% (f p.1)}
485484
(hf : HasMFDerivAt[Prod.fst '' s] f p.1 df)

Mathlib/Geometry/Manifold/MFDeriv/UniqueDifferential.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ open Bundle
136136
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {Z : M → Type*}
137137
[TopologicalSpace (TotalSpace F Z)] [∀ b, TopologicalSpace (Z b)] [FiberBundle F Z]
138138

139-
set_option backward.isDefEq.respectTransparency false in
140139
private lemma UniqueMDiffWithinAt.bundle_preimage_aux {p : TotalSpace F Z}
141140
(hs : UniqueMDiffAt[s] p.proj) (h's : s ⊆ (trivializationAt F Z p.proj).baseSet) :
142141
UniqueMDiffAt[π F Z ⁻¹' s] p := by

Mathlib/Geometry/Manifold/Submersion.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ lemma _root_.isOpen_isSubmersionAtOfComplement :
335335
IsOpen {x | IsSubmersionAtOfComplement F I J n f x} := by
336336
exact IsOpen.liftSourceTargetPropertyAt
337337

338-
set_option backward.isDefEq.respectTransparency false in
339338
/-- If `f: M → N` and `g: M' → N'` are submersions at `x` and `x'`, respectively,
340339
then `f × g: M × M' → N × N'` is a submersion at `(x, x')`. -/
341340
theorem prodMap {f : M → N} {g : M' → N'} {x' : M'}

0 commit comments

Comments
 (0)