Skip to content

Commit d3f6db5

Browse files
feat: port Algebra.Order.Monoid.Basic (#872)
mathlib3 SHA: 9b2660e1b25419042c8da10bf411aa3c67f14383 Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
1 parent 439961d commit d3f6db5

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import Mathlib.Algebra.Opposites
3535
import Mathlib.Algebra.Order.Group
3636
import Mathlib.Algebra.Order.Group.Defs
3737
import Mathlib.Algebra.Order.Hom.Basic
38+
import Mathlib.Algebra.Order.Monoid.Basic
3839
import Mathlib.Algebra.Order.Monoid.Cancel.Defs
3940
import Mathlib.Algebra.Order.Monoid.Canonical.Defs
4041
import Mathlib.Algebra.Order.Monoid.Defs
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/-
2+
Copyright (c) 2016 Jeremy Avigad. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl
5+
-/
6+
import Mathlib.Algebra.Order.Monoid.Defs
7+
import Mathlib.Algebra.Group.InjSurj
8+
import Mathlib.Order.Hom.Basic
9+
10+
/-!
11+
# Ordered monoids
12+
13+
This file develops some additional material on ordered monoids.
14+
-/
15+
16+
17+
open Function
18+
19+
universe u
20+
21+
variable {α : Type u} {β : Type _}
22+
23+
/-- Pullback an `OrderedCommMonoid` under an injective map.
24+
See note [reducible non-instances]. -/
25+
@[reducible,
26+
to_additive "Pullback an `OrderedAddCommMonoid` under an injective map."]
27+
def Function.Injective.orderedCommMonoid [OrderedCommMonoid α] {β : Type _} [One β] [Mul β]
28+
[Pow β ℕ] (f : β → α) (hf : Function.Injective f) (one : f 1 = 1)
29+
(mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) :
30+
OrderedCommMonoid β :=
31+
{ PartialOrder.lift f hf,
32+
hf.commMonoid f one mul npow with
33+
mul_le_mul_left := fun a b ab c =>
34+
show f (c * a) ≤ f (c * b) by
35+
rw [mul, mul]
36+
apply mul_le_mul_left'
37+
exact ab }
38+
#align function.injective.ordered_comm_monoid Function.Injective.orderedCommMonoid
39+
40+
/-- Pullback a `LinearOrderedCommMonoid` under an injective map.
41+
See note [reducible non-instances]. -/
42+
@[reducible,
43+
to_additive "Pullback an `ordered_add_comm_monoid` under an injective map."]
44+
def Function.Injective.linearOrderedCommMonoid [LinearOrderedCommMonoid α] {β : Type _} [One β]
45+
[Mul β] [Pow β ℕ] [HasSup β] [HasInf β] (f : β → α) (hf : Function.Injective f) (one : f 1 = 1)
46+
(mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
47+
(hsup : ∀ x y, f (x ⊔ y) = max (f x) (f y)) (hinf : ∀ x y, f (x ⊓ y) = min (f x) (f y)) :
48+
LinearOrderedCommMonoid β :=
49+
{ hf.orderedCommMonoid f one mul npow, LinearOrder.lift f hf hsup hinf with }
50+
#align function.injective.linear_ordered_comm_monoid Function.Injective.linearOrderedCommMonoid
51+
52+
-- TODO find a better home for the next two constructions.
53+
/-- The order embedding sending `b` to `a * b`, for some fixed `a`.
54+
See also `order_iso.mul_left` when working in an ordered group. -/
55+
@[to_additive
56+
"The order embedding sending `b` to `a + b`, for some fixed `a`.
57+
See also `order_iso.add_left` when working in an additive ordered group.",
58+
simps]
59+
def OrderEmbedding.mulLeft {α : Type _} [Mul α] [LinearOrder α]
60+
[CovariantClass α α (· * ·) (· < ·)] (m : α) : α ↪o α :=
61+
OrderEmbedding.ofStrictMono (fun n => m * n) fun _ _ w => mul_lt_mul_left' w m
62+
#align order_embedding.mul_left OrderEmbedding.mulLeft
63+
64+
/-- The order embedding sending `b` to `b * a`, for some fixed `a`.
65+
See also `order_iso.mul_right` when working in an ordered group. -/
66+
@[to_additive
67+
"The order embedding sending `b` to `b + a`, for some fixed `a`.
68+
See also `order_iso.add_right` when working in an additive ordered group.",
69+
simps]
70+
def OrderEmbedding.mulRight {α : Type _} [Mul α] [LinearOrder α]
71+
[CovariantClass α α (swap (· * ·)) (· < ·)] (m : α) : α ↪o α :=
72+
OrderEmbedding.ofStrictMono (fun n => n * m) fun _ _ w => mul_lt_mul_right' w m
73+
#align order_embedding.mul_right OrderEmbedding.mulRight

0 commit comments

Comments
 (0)