-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
205 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-- This module serves as the root of the `OrderedSemigroups` library. | ||
-- Import modules here that should be built as part of the library. | ||
import «OrderedSemigroups».Archimedean | ||
import «OrderedSemigroups».SemigroupToGroup | ||
import «OrderedSemigroups».MonoidToGroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import Mathlib.Algebra.Order.Group.Basic | ||
import OrderedSemigroups.Sign | ||
|
||
universe u | ||
variable {α : Type u} | ||
|
||
def with_one (α : Type u) := α ⊕ Unit | ||
|
||
section Semigroup | ||
variable [Semigroup α] | ||
|
||
instance : Semigroup (with_one α) where | ||
mul x y := | ||
match x, y with | ||
| .inl x, .inl y => .inl (x * y) | ||
| .inl x, .inr _ => .inl x | ||
| .inr _, .inl y => .inl y | ||
| .inr one, .inr _ => .inr one | ||
mul_assoc := by | ||
intro x y z | ||
rcases x with x | _ <;> rcases y with y | _ <;> rcases z with z | _ | ||
<;> try simp [HMul.hMul] | ||
· exact congrArg Sum.inl (mul_assoc x y z) | ||
|
||
instance : Monoid (with_one α) where | ||
one := .inr () | ||
one_mul := by | ||
intro x | ||
cases x | ||
<;> unfold_projs | ||
<;> simp | ||
mul_one := by | ||
intro x | ||
cases x | ||
<;> unfold_projs | ||
<;> simp | ||
|
||
end Semigroup | ||
|
||
section CommSemigroup' | ||
variable [CommSemigroup' α] | ||
|
||
instance : CommMonoid (with_one α) where | ||
mul_comm := by | ||
intro x y | ||
cases x <;> cases y | ||
<;> unfold_projs | ||
<;> simp [mul_comm] | ||
· apply congrArg | ||
rename_i x y | ||
have := mul_comm x y | ||
unfold_projs at this | ||
simpa | ||
|
||
end CommSemigroup' | ||
|
||
section LinearOrderedCancelSemigroup | ||
variable [LinearOrderedCancelCommSemigroup α] | ||
|
||
instance : OrderedCommMonoid (with_one α) where | ||
le := by | ||
intro x y | ||
rcases x with x | one | ||
<;> rcases y with y | one | ||
· exact x ≤ y | ||
· exact x*x ≤ x | ||
· exact y*y ≥ y | ||
· exact True | ||
le_refl := by | ||
intro x | ||
rcases x with x | one | ||
<;> simp | ||
le_trans := by | ||
intro x y z x_le_y y_le_z | ||
rcases x with x | one | ||
<;> rcases y with y | one | ||
<;> rcases z with z | one | ||
<;> simp at * | ||
· exact Preorder.le_trans x y z x_le_y y_le_z | ||
· rw [←not_pos_iff] | ||
exact le_not_pos_not_pos (not_pos_iff.mpr y_le_z) x_le_y | ||
· exact not_pos_le_not_neg (not_pos_iff.mpr x_le_y) (not_neg_iff.mpr y_le_z) | ||
· trivial | ||
· rw [←not_neg_iff] | ||
exact ge_not_neg_not_neg (not_neg_iff.mpr x_le_y) y_le_z | ||
· trivial | ||
le_antisymm := by | ||
intro x y x_le_y y_le_x | ||
rcases x with x | one | ||
<;> rcases y with y | one | ||
<;> simp at * | ||
· rw [PartialOrder.le_antisymm x y x_le_y y_le_x] | ||
· sorry | ||
· sorry | ||
mul_le_mul_left := sorry | ||
|
||
|
||
|
||
|
||
end LinearOrderedCancelSemigroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters