Zulip Chat Archive
Stream: Is there code for X?
Topic: Subalgebra.equivOpposite
Jz Pan (Apr 06 2024 at 18:19):
Do we have this (or is it correct):
def Subalgebra.equivOpposite
{R : Type*} [CommSemiring R] {A : Type*} [Semiring A] [Algebra R A] :
Subalgebra R Aᵐᵒᵖ ≃o Subalgebra R A :=
sorry
I think we only have docs#Submodule.equivOpposite, but not the above. Also, I think Submodule.equivOpposite
is also an OrderIso
, but this is also not in mathlib yet?
Yaël Dillies (Apr 06 2024 at 18:34):
It seems correct
Jz Pan (Apr 06 2024 at 18:36):
I started with this code:
variable {R : Type*} [CommSemiring R] {A : Type*} [Semiring A] [Algebra R A]
def _root_.Subalgebra.fromOpposite (S : Subalgebra R Aᵐᵒᵖ) : Subalgebra R A where
__ := MulOpposite.unop (Submodule.equivOpposite (toSubmodule S))
mul_mem' ha hb := by
sorry
algebraMap_mem' r := by
sorry
def _root_.Subalgebra.toOpposite (S : Subalgebra R A) : Subalgebra R Aᵐᵒᵖ where
__ := Submodule.equivOpposite.symm (MulOpposite.op (toSubmodule S))
mul_mem' ha hb := sorry
algebraMap_mem' r := sorry
def _root_.Subalgebra.equivOpposite : Subalgebra R Aᵐᵒᵖ ≃o Subalgebra R A :=
sorry
but it immediately crashes Lean at the by sorry
code :man_facepalming:
Jz Pan (Apr 06 2024 at 18:39):
algebraMap_mem' r := sorry
works, but algebraMap_mem' r := by sorry
crashes
Jz Pan (Apr 06 2024 at 19:00):
OK this works:
variable {R : Type*} [CommSemiring R] {A : Type*} [Semiring A] [Algebra R A]
def _root_.Subalgebra.equivOpposite : Subalgebra R Aᵐᵒᵖ ≃o Subalgebra R A where
toFun S := { MulOpposite.unop (Submodule.equivOpposite (toSubmodule S)) with
mul_mem' := fun ha hb ↦ S.mul_mem hb ha
algebraMap_mem' := S.algebraMap_mem }
invFun S := { Submodule.equivOpposite.symm (MulOpposite.op (toSubmodule S)) with
mul_mem' := fun ha hb ↦ S.mul_mem hb ha
algebraMap_mem' := S.algebraMap_mem }
left_inv _ := rfl
right_inv _ := rfl
map_rel_iff' {_} {_} :=
Submodule.comap_le_comap_iff_of_surjective (MulOpposite.opLinearEquiv R).surjective _ _
I still need to define the map from S
to equivOpposite S
...
Eric Wieser (Apr 06 2024 at 19:40):
do we have docs#Subring.equivOpposite
Eric Wieser (Apr 06 2024 at 19:41):
It might make sense to build all the weaker versions along the way at the same time
Kevin Buzzard (Apr 06 2024 at 19:41):
I raised the issue of the crash here.
Eric Wieser (Apr 06 2024 at 19:41):
We have docs#Submonoid.equivOpposite, right?
Eric Wieser (Apr 06 2024 at 19:41):
Maybe docs#Submonoid.op ?
Eric Wieser (Apr 06 2024 at 19:42):
Aha, docs#AddSubmonoid.opEquiv
Eric Wieser (Apr 06 2024 at 19:42):
I guess we need to unify these names too
Jz Pan (May 12 2024 at 16:32):
PR created as #12846.
Last updated: May 02 2025 at 03:31 UTC