Skip to content

Commit

Permalink
Show that with_one is an ordered commutative monoid
Browse files Browse the repository at this point in the history
  • Loading branch information
ericluap committed Oct 17, 2024
1 parent 36d83d3 commit acb3cc3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 8 deletions.
27 changes: 19 additions & 8 deletions OrderedSemigroups/SemigroupToMonoid.lean
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ end CommSemigroup'
section LinearOrderedCancelSemigroup
variable [LinearOrderedCancelCommSemigroup α]

instance : OrderedCommMonoid (with_one α) where
instance (not_one : ∀x : α, ¬is_one x): OrderedCommMonoid (with_one α) where
le := by
intro x y
rcases x with x | one
<;> rcases y with y | one
rcases x with x | _
<;> rcases y with y | _
· exact x ≤ y
· exact x*x ≤ x
· exact y*y ≥ y
· exact True
le_refl := by
intro x
rcases x with x | one
rcases x with x | _
<;> simp
le_trans := by
intro x y z x_le_y y_le_z
Expand All @@ -90,10 +90,21 @@ instance : OrderedCommMonoid (with_one α) where
<;> 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

· exact not_one x (one_right_one_forall (PartialOrder.le_antisymm (x*x) x x_le_y y_le_x))
· exact not_one y (one_right_one_forall (PartialOrder.le_antisymm (y*y) y y_le_x x_le_y))
mul_le_mul_left := by
intro x y x_le_y z
rcases x with x | one
<;> rcases y with y | one
<;> rcases z with z | one
<;> unfold_projs
<;> simp at *
· exact mul_le_mul_left' x_le_y z
· trivial
· exact not_pos_right (not_pos_iff.mpr x_le_y) z
· exact x_le_y
· exact not_neg_right (not_neg_iff.mpr x_le_y) z
· trivial



Expand Down
25 changes: 25 additions & 0 deletions OrderedSemigroups/Sign.lean
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,29 @@ theorem not_pos_le_not_neg {a b : α} (not_pos : ¬is_positive a) (not_neg : ¬i
· exact (one_lt_pos one_a pos_b).le
· exact (one_unique one_a one_b).le

theorem not_positive {a : α} (not_pos : ¬is_positive a) : ∀x : α, a * x ≤ x := by
intro x
obtain neg_a | one_a := not_pos_or not_pos
· exact le_of_lt (neg_a x)
· exact le_of_eq (one_a x)

theorem not_pos_right {a : α} (not_pos : ¬is_positive a) : ∀x : α, x * a ≤ x := by
intro x
obtain neg_a | one_a := not_pos_or not_pos
· exact le_of_lt (neg_right neg_a x)
· exact le_of_eq (one_right one_a x)


theorem not_negative {a : α} (not_neg : ¬is_negative a) : ∀x : α, a * x ≥ x := by
intro x
obtain pos_a | one_a := not_neg_or not_neg
· exact le_of_lt (pos_a x)
· exact Eq.ge (one_a x)

theorem not_neg_right {a : α} (not_neg : ¬is_negative a) : ∀x : α, x * a ≥ x := by
intro x
obtain pos_a | one_a := not_neg_or not_neg
· exact le_of_lt (pos_right pos_a x)
· exact le_of_eq (one_right one_a x).symm

end LinearOrderedCancelSemigroup

0 comments on commit acb3cc3

Please sign in to comment.