Zulip Chat Archive
Stream: new members
Topic: Mul of pos is pos
Rida Hamadani (Aug 28 2024 at 04:28):
I'm proving that composition of orientation preserving maps is orientation preserving, and the part I'm having trouble with is, believe it or not, proving that the product of two positives is a positive.
import Mathlib.Geometry.Manifold.SmoothManifoldWithCorners
variable (๐ : Type*) [NormedAddCommGroup ๐] [NontriviallyNormedField ๐] [LT ๐] {H : Type*}
[NormedAddCommGroup H] [NormedSpace ๐ H] [Preorder ๐] [PosMulStrictMono ๐]
def OrientationPreserving (f : H โ H) (s : Set H) : Prop :=
โ x โ s, 0 < (fderiv ๐ f x).det
lemma orientationPreserving_comp (f g : H โ H) (u v : Set H) (hf : OrientationPreserving ๐ f u)
(hg : OrientationPreserving ๐ g v) : OrientationPreserving ๐ (g โ f) (u โฉ f โปยน' v) := by
dsimp [OrientationPreserving] at *
intro x โจhxu, hxvโฉ
rw [fderiv.comp _ _ _]
ยท have hโ : 0 < (fderiv ๐ f x).det := hf x hxu
have hโ : 0 < (fderiv ๐ g (f x)).det := hg (f x) hxv
unfold ContinuousLinearMap.det ContinuousLinearMap.comp
rw [(fderiv ๐ g (f x)).toLinearMap.det_comp (fderiv ๐ f x).toLinearMap]
exact mul_pos hโ hโ
ยท sorry
ยท sorry
Ignore the last 2 sorries, in the exact mul_pos hโ hโ
line, I'm running into a problem with a metavariable, although I've added instances to ๐
so that I can use mul_pos
. How can I fix this?
Daniel Weber (Aug 28 2024 at 04:37):
Using convert
instead of exact
can often show the problem in these cases. Here, you have a diamond with the LT
instance on ๐
and the one obtained from the Preorder
, which aren't necessarily equal
Daniel Weber (Aug 28 2024 at 04:37):
Removing the LT
instance solves this
Rida Hamadani (Aug 28 2024 at 04:39):
I see, thank you!
Daniel Weber (Aug 28 2024 at 04:40):
Note that the NormedAddCommGroup
also conflicts with the one derived from NontriviallyNormedField
and should be removed
Rida Hamadani (Aug 28 2024 at 04:43):
It never occurred to me that instances can conflict, it makes sense.
Rida Hamadani (Aug 28 2024 at 06:09):
I'm still running into similar problems. Using convert
in the code below gives me 4 new goals, does this mean that I have 4 conflicting instances?
In general, how can one make sure to not run into this sort of "inheritance problems"? And how do we figure out how to fix them if they arise?
import Mathlib.Geometry.Manifold.SmoothManifoldWithCorners
variable (๐ : Type*) [NontriviallyNormedField ๐] [Preorder ๐] [PosMulStrictMono ๐] {H : Type*}
[NormedAddCommGroup H] [NormedSpace ๐ H]
def OrientationPreserving (f : H โ H) (s : Set H) : Prop :=
โ x โ s,
DifferentiableAt ๐ f x โง
0 < (fderiv ๐ f x).det
def orientationPreservingPregroupoid : Pregroupoid H where
property f s := OrientationPreserving ๐ f s
comp {f g u v} hf hg _ _ _ := by
intro x โจhxu, hxvโฉ
rw [fderiv.comp _ (hg (f x) hxv).1 (hf x hxu).1]
ยท have hโ : 0 < (fderiv ๐ f x).det := (hf x hxu).2
have hโ : 0 < (fderiv ๐ g (f x)).det := (hg (f x) hxv).2
unfold ContinuousLinearMap.det ContinuousLinearMap.comp
rw [(fderiv ๐ g (f x)).toLinearMap.det_comp (fderiv ๐ f x).toLinearMap]
apply And.intro ?_ <| mul_pos hโ hโ
apply DifferentiableAt.comp
ยท exact (hg (f x) hxv).1
ยท exact (hf x hxu).1
id_mem := by
intro x hx
simp only [Set.mem_univ, differentiableAt_id, fderiv_id, true_and]
unfold ContinuousLinearMap.id ContinuousLinearMap.det
rw [LinearMap.det_id]
convert zero_lt_one
Daniel Weber (Aug 28 2024 at 06:16):
I believe you need to use docs#NormedLinearOrderedField
Heather Macbeth (Aug 28 2024 at 06:30):
Frankly, you can just use โ
... this is a case where I don't think extra generality is useful!
Last updated: May 02 2025 at 03:31 UTC