@@ -3,10 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Yaël Dillies
5
5
-/
6
+ import Mathlib.Algebra.Group.Equiv.Defs
7
+ import Mathlib.Algebra.Group.Hom.Basic
6
8
import Mathlib.Algebra.Order.Group.Unbundled.Basic
7
- import Mathlib.Algebra.Order.GroupWithZero.Canonical
8
- import Mathlib.Algebra.Order.Monoid.Units
9
-
9
+ import Mathlib.Algebra.Order.Monoid.OrderDual
10
+ import Mathlib.Order.Hom.Basic
10
11
/-!
11
12
# Ordered monoid and group homomorphisms
12
13
@@ -16,18 +17,15 @@ This file defines morphisms between (additive) ordered monoids.
16
17
17
18
* `OrderAddMonoidHom`: Ordered additive monoid homomorphisms.
18
19
* `OrderMonoidHom`: Ordered monoid homomorphisms.
19
- * `OrderMonoidWithZeroHom`: Ordered monoid with zero homomorphisms.
20
20
* `OrderAddMonoidIso`: Ordered additive monoid isomorphisms.
21
21
* `OrderMonoidIso`: Ordered monoid isomorphisms.
22
22
23
23
## Notation
24
24
25
25
* `→+o`: Bundled ordered additive monoid homs. Also use for additive group homs.
26
26
* `→*o`: Bundled ordered monoid homs. Also use for group homs.
27
- * `→*₀o`: Bundled ordered monoid with zero homs. Also use for group with zero homs.
28
27
* `≃+o`: Bundled ordered additive monoid isos. Also use for additive group isos.
29
28
* `≃*o`: Bundled ordered monoid isos. Also use for group isos.
30
- * `≃*₀o`: Bundled ordered monoid with zero isos. Also use for group with zero isos.
31
29
32
30
## Implementation notes
33
31
@@ -54,9 +52,10 @@ making some definitions and lemmas irrelevant.
54
52
55
53
## Tags
56
54
57
- ordered monoid, ordered group, monoid with zero
55
+ ordered monoid, ordered group
58
56
-/
59
57
58
+ assert_not_exists MonoidWithZero
60
59
61
60
open Function
62
61
@@ -181,48 +180,6 @@ instance [EquivLike F α β] [OrderIsoClass F α β] [MulEquivClass F α β] : C
181
180
182
181
end Monoid
183
182
184
- section MonoidWithZero
185
-
186
- variable [Preorder α] [Preorder β] [MulZeroOneClass α] [MulZeroOneClass β]
187
-
188
- /-- `OrderMonoidWithZeroHom α β` is the type of functions `α → β` that preserve
189
- the `MonoidWithZero` structure.
190
-
191
- `OrderMonoidWithZeroHom` is also used for group homomorphisms.
192
-
193
- When possible, instead of parametrizing results over `(f : α →+ β)`,
194
- you should parameterize over
195
- `(F : Type*) [FunLike F M N] [MonoidWithZeroHomClass F M N] [OrderHomClass F M N] (f : F)`. -/
196
- structure OrderMonoidWithZeroHom (α β : Type *) [Preorder α] [Preorder β] [MulZeroOneClass α]
197
- [MulZeroOneClass β] extends α →*₀ β where
198
- /-- An `OrderMonoidWithZeroHom` is a monotone function. -/
199
- monotone' : Monotone toFun
200
-
201
- /-- Infix notation for `OrderMonoidWithZeroHom`. -/
202
- infixr :25 " →*₀o " => OrderMonoidWithZeroHom
203
-
204
- section
205
-
206
- variable [FunLike F α β]
207
-
208
- /-- Turn an element of a type `F`
209
- satisfying `OrderHomClass F α β` and `MonoidWithZeroHomClass F α β`
210
- into an actual `OrderMonoidWithZeroHom`.
211
- This is declared as the default coercion from `F` to `α →+*₀o β`. -/
212
- @[coe]
213
- def OrderMonoidWithZeroHomClass.toOrderMonoidWithZeroHom [OrderHomClass F α β]
214
- [MonoidWithZeroHomClass F α β] (f : F) : α →*₀o β :=
215
- { (f : α →*₀ β) with monotone' := OrderHomClass.monotone f }
216
-
217
- end
218
-
219
- variable [FunLike F α β]
220
-
221
- instance [OrderHomClass F α β] [MonoidWithZeroHomClass F α β] : CoeTC F (α →*₀o β) :=
222
- ⟨OrderMonoidWithZeroHomClass.toOrderMonoidWithZeroHom⟩
223
-
224
- end MonoidWithZero
225
-
226
183
section OrderedZero
227
184
228
185
variable [FunLike F α β]
@@ -769,215 +726,3 @@ def mk' (f : α ≃ β) (hf : ∀ {a b}, f a ≤ f b ↔ a ≤ b) (map_mul : ∀
769
726
end OrderedCommGroup
770
727
771
728
end OrderMonoidIso
772
-
773
- namespace OrderMonoidWithZeroHom
774
-
775
- section Preorder
776
-
777
- variable [Preorder α] [Preorder β] [Preorder γ] [Preorder δ] [MulZeroOneClass α] [MulZeroOneClass β]
778
- [MulZeroOneClass γ] [MulZeroOneClass δ] {f g : α →*₀o β}
779
-
780
- instance : FunLike (α →*₀o β) α β where
781
- coe f := f.toFun
782
- coe_injective' f g h := by
783
- obtain ⟨⟨⟨_, _⟩⟩, _⟩ := f
784
- obtain ⟨⟨⟨_, _⟩⟩, _⟩ := g
785
- congr
786
-
787
- initialize_simps_projections OrderMonoidWithZeroHom (toFun → apply, -toMonoidWithZeroHom)
788
-
789
- instance : MonoidWithZeroHomClass (α →*₀o β) α β where
790
- map_mul f := f.map_mul'
791
- map_one f := f.map_one'
792
- map_zero f := f.map_zero'
793
-
794
- instance : OrderHomClass (α →*₀o β) α β where
795
- map_rel f _ _ h := f.monotone' h
796
-
797
- -- Other lemmas should be accessed through the `FunLike` API
798
- @[ext]
799
- theorem ext (h : ∀ a, f a = g a) : f = g :=
800
- DFunLike.ext f g h
801
-
802
- theorem toFun_eq_coe (f : α →*₀o β) : f.toFun = (f : α → β) :=
803
- rfl
804
-
805
- @[simp]
806
- theorem coe_mk (f : α →*₀ β) (h) : (OrderMonoidWithZeroHom.mk f h : α → β) = f :=
807
- rfl
808
-
809
- @[simp]
810
- theorem mk_coe (f : α →*₀o β) (h) : OrderMonoidWithZeroHom.mk (f : α →*₀ β) h = f := rfl
811
-
812
- /-- Reinterpret an ordered monoid with zero homomorphism as an order monoid homomorphism. -/
813
- def toOrderMonoidHom (f : α →*₀o β) : α →*o β :=
814
- { f with }
815
-
816
- @[simp]
817
- theorem coe_monoidWithZeroHom (f : α →*₀o β) : ⇑(f : α →*₀ β) = f :=
818
- rfl
819
-
820
- @[simp]
821
- theorem coe_orderMonoidHom (f : α →*₀o β) : ⇑(f : α →*o β) = f :=
822
- rfl
823
-
824
- theorem toOrderMonoidHom_injective : Injective (toOrderMonoidHom : _ → α →*o β) := fun f g h =>
825
- ext <| by convert DFunLike.ext_iff.1 h using 0
826
-
827
- theorem toMonoidWithZeroHom_injective : Injective (toMonoidWithZeroHom : _ → α →*₀ β) :=
828
- fun f g h => ext <| by convert DFunLike.ext_iff.1 h using 0
829
-
830
- /-- Copy of an `OrderMonoidWithZeroHom` with a new `toFun` equal to the old one. Useful to fix
831
- definitional equalities. -/
832
- protected def copy (f : α →*₀o β) (f' : α → β) (h : f' = f) : α →*o β :=
833
- { f.toOrderMonoidHom.copy f' h, f.toMonoidWithZeroHom.copy f' h with toFun := f' }
834
-
835
- @[simp]
836
- theorem coe_copy (f : α →*₀o β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f' :=
837
- rfl
838
-
839
- theorem copy_eq (f : α →*₀o β) (f' : α → β) (h : f' = f) : f.copy f' h = f :=
840
- DFunLike.ext' h
841
-
842
- variable (α)
843
-
844
- /-- The identity map as an ordered monoid with zero homomorphism. -/
845
- protected def id : α →*₀o α :=
846
- { MonoidWithZeroHom.id α, OrderHom.id with }
847
-
848
- @[simp, norm_cast]
849
- theorem coe_id : ⇑(OrderMonoidWithZeroHom.id α) = id :=
850
- rfl
851
-
852
- instance : Inhabited (α →*₀o α) :=
853
- ⟨OrderMonoidWithZeroHom.id α⟩
854
-
855
- variable {α}
856
-
857
- /-- Composition of `OrderMonoidWithZeroHom`s as an `OrderMonoidWithZeroHom`. -/
858
- def comp (f : β →*₀o γ) (g : α →*₀o β) : α →*₀o γ :=
859
- { f.toMonoidWithZeroHom.comp (g : α →*₀ β), f.toOrderMonoidHom.comp (g : α →*o β) with }
860
-
861
- @[simp]
862
- theorem coe_comp (f : β →*₀o γ) (g : α →*₀o β) : (f.comp g : α → γ) = f ∘ g :=
863
- rfl
864
-
865
- @[simp]
866
- theorem comp_apply (f : β →*₀o γ) (g : α →*₀o β) (a : α) : (f.comp g) a = f (g a) :=
867
- rfl
868
-
869
- theorem coe_comp_monoidWithZeroHom (f : β →*₀o γ) (g : α →*₀o β) :
870
- (f.comp g : α →*₀ γ) = (f : β →*₀ γ).comp g :=
871
- rfl
872
-
873
- theorem coe_comp_orderMonoidHom (f : β →*₀o γ) (g : α →*₀o β) :
874
- (f.comp g : α →*o γ) = (f : β →*o γ).comp g :=
875
- rfl
876
-
877
- @[simp]
878
- theorem comp_assoc (f : γ →*₀o δ) (g : β →*₀o γ) (h : α →*₀o β) :
879
- (f.comp g).comp h = f.comp (g.comp h) :=
880
- rfl
881
-
882
- @[simp]
883
- theorem comp_id (f : α →*₀o β) : f.comp (OrderMonoidWithZeroHom.id α) = f := rfl
884
-
885
- @[simp]
886
- theorem id_comp (f : α →*₀o β) : (OrderMonoidWithZeroHom.id β).comp f = f := rfl
887
-
888
- @[simp]
889
- theorem cancel_right {g₁ g₂ : β →*₀o γ} {f : α →*₀o β} (hf : Function.Surjective f) :
890
- g₁.comp f = g₂.comp f ↔ g₁ = g₂ :=
891
- ⟨fun h => ext <| hf.forall.2 <| DFunLike.ext_iff.1 h, fun _ => by congr⟩
892
-
893
- @[simp]
894
- theorem cancel_left {g : β →*₀o γ} {f₁ f₂ : α →*₀o β} (hg : Function.Injective g) :
895
- g.comp f₁ = g.comp f₂ ↔ f₁ = f₂ :=
896
- ⟨fun h => ext fun a => hg <| by rw [← comp_apply, h, comp_apply], congr_arg _⟩
897
-
898
- end Preorder
899
-
900
- section Mul
901
-
902
- variable [LinearOrderedCommMonoidWithZero α] [LinearOrderedCommMonoidWithZero β]
903
- [LinearOrderedCommMonoidWithZero γ]
904
-
905
- /-- For two ordered monoid morphisms `f` and `g`, their product is the ordered monoid morphism
906
- sending `a` to `f a * g a`. -/
907
- instance : Mul (α →*₀o β) :=
908
- ⟨fun f g => { (f * g : α →*₀ β) with monotone' := f.monotone'.mul' g.monotone' }⟩
909
-
910
- @[simp]
911
- theorem coe_mul (f g : α →*₀o β) : ⇑(f * g) = f * g :=
912
- rfl
913
-
914
- @[simp]
915
- theorem mul_apply (f g : α →*₀o β) (a : α) : (f * g) a = f a * g a :=
916
- rfl
917
-
918
- theorem mul_comp (g₁ g₂ : β →*₀o γ) (f : α →*₀o β) : (g₁ * g₂).comp f = g₁.comp f * g₂.comp f :=
919
- rfl
920
-
921
- theorem comp_mul (g : β →*₀o γ) (f₁ f₂ : α →*₀o β) : g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂ :=
922
- ext fun _ => map_mul g _ _
923
-
924
- end Mul
925
-
926
- section LinearOrderedCommMonoidWithZero
927
-
928
- variable {hα : Preorder α} {hα' : MulZeroOneClass α} {hβ : Preorder β} {hβ' : MulZeroOneClass β}
929
- {hγ : Preorder γ} {hγ' : MulZeroOneClass γ}
930
-
931
- @[simp]
932
- theorem toMonoidWithZeroHom_eq_coe (f : α →*₀o β) : f.toMonoidWithZeroHom = f := by
933
- rfl
934
-
935
- @[simp]
936
- theorem toMonoidWithZeroHom_mk (f : α →*₀ β) (hf : Monotone f) :
937
- ((OrderMonoidWithZeroHom.mk f hf) : α →*₀ β) = f := by
938
- rfl
939
-
940
- @[simp]
941
- lemma toMonoidWithZeroHom_coe (f : β →*₀o γ) (g : α →*₀o β) :
942
- (f.comp g : α →*₀ γ) = (f : β →*₀ γ).comp g :=
943
- rfl
944
-
945
- @[simp]
946
- theorem toOrderMonoidHom_eq_coe (f : α →*₀o β) : f.toOrderMonoidHom = f :=
947
- rfl
948
-
949
- @[simp]
950
- lemma toOrderMonoidHom_comp (f : β →*₀o γ) (g : α →*₀o β) :
951
- (f.comp g : α →*o γ) = (f : β →*o γ).comp g :=
952
- rfl
953
-
954
- end LinearOrderedCommMonoidWithZero
955
-
956
- end OrderMonoidWithZeroHom
957
-
958
- /-- Any ordered group is isomorphic to the units of itself adjoined with `0`. -/
959
- @[simps!]
960
- def OrderMonoidIso.unitsWithZero {α : Type *} [Group α] [Preorder α] : (WithZero α)ˣ ≃*o α where
961
- toMulEquiv := WithZero.unitsWithZeroEquiv
962
- map_le_map_iff' {a b} := by simp [WithZero.unitsWithZeroEquiv]
963
-
964
- /-- A version of `Equiv.optionCongr` for `WithZero` on `OrderMonoidIso`. -/
965
- @[simps!]
966
- def OrderMonoidIso.withZero {G H : Type *}
967
- [Group G] [PartialOrder G] [Group H] [PartialOrder H] :
968
- (G ≃*o H) ≃ (WithZero G ≃*o WithZero H) where
969
- toFun e := ⟨e.toMulEquiv.withZero, fun {a b} ↦ by cases a <;> cases b <;>
970
- simp [WithZero.zero_le, (WithZero.zero_lt_coe _).not_ge]⟩
971
- invFun e := ⟨MulEquiv.withZero.symm e, fun {a b} ↦ by simp⟩
972
- left_inv _ := by ext; simp
973
- right_inv _ := by ext x; cases x <;> simp
974
-
975
- /-- Any linearly ordered group with zero is isomorphic to adjoining `0` to the units of itself. -/
976
- @[simps!]
977
- def OrderMonoidIso.withZeroUnits {α : Type *} [LinearOrderedCommGroupWithZero α]
978
- [DecidablePred (fun a : α ↦ a = 0 )] :
979
- WithZero αˣ ≃*o α where
980
- toMulEquiv := WithZero.withZeroUnitsEquiv
981
- map_le_map_iff' {a b} := by
982
- cases a <;> cases b <;>
983
- simp
0 commit comments