Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit fb22ae3

Browse files
committed
refactor(order/rel_iso): move statements about intervals to data/set/intervals (#8150)
This means that we can talk about `rel_iso` without needing to transitively import `ordered_group`s This PR takes advantage of this to define `order_iso.mul_(left|right)[']` to mirror `equiv.mul_(left|right)[']`.
1 parent 03e2cbd commit fb22ae3

File tree

4 files changed

+76
-36
lines changed

4 files changed

+76
-36
lines changed

src/algebra/ordered_field.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ variable {α : Type*}
3232
section linear_ordered_field
3333
variables [linear_ordered_field α] {a b c d e : α}
3434

35+
section
36+
37+
/-- `equiv.mul_left'` as an order_iso. -/
38+
@[simps {simp_rhs := tt}]
39+
def order_iso.mul_left' (a : α) (ha : 0 < a) : α ≃o α :=
40+
{ map_rel_iff' := λ _ _, mul_le_mul_left ha, ..equiv.mul_left' a ha.ne' }
41+
42+
/-- `equiv.mul_right'` as an order_iso. -/
43+
@[simps {simp_rhs := tt}]
44+
def order_iso.mul_right' (a : α) (ha : 0 < a) : α ≃o α :=
45+
{ map_rel_iff' := λ _ _, mul_le_mul_right ha, ..equiv.mul_right' a ha.ne' }
46+
47+
end
48+
3549
/-!
3650
### Lemmas about pos, nonneg, nonpos, neg
3751
-/

src/algebra/ordered_group.lean

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Johannes Hölzl
55
-/
66
import algebra.ordered_monoid
7+
import order.rel_iso
78

89
/-!
910
# Ordered groups
@@ -564,10 +565,22 @@ alias le_sub_iff_add_le ↔ add_le_of_le_sub_right le_sub_right_of_add_le
564565
lemma div_le_iff_le_mul : a / c ≤ b ↔ a ≤ b * c :=
565566
by rw [← mul_le_mul_iff_right c, div_eq_mul_inv, inv_mul_cancel_right]
566567

568+
/-- `equiv.mul_right` as an order_iso. -/
569+
@[simps {simp_rhs := tt}]
570+
def order_iso.mul_right (a : α) : α ≃o α :=
571+
{ map_rel_iff' := λ _ _, mul_le_mul_iff_right a, ..equiv.mul_right a }
572+
567573
end right
568574

569575
section left
570-
variables [covariant_class α α (*) (≤)] [covariant_class α α (function.swap (*)) (≤)] {a b c : α}
576+
variables [covariant_class α α (*) (≤)]
577+
578+
/-- `equiv.mul_left` as an order_iso. -/
579+
@[simps {simp_rhs := tt}]
580+
def order_iso.mul_left (a : α) : α ≃o α :=
581+
{ map_rel_iff' := λ _ _, mul_le_mul_iff_left a, ..equiv.mul_left a }
582+
583+
variables [covariant_class α α (function.swap (*)) (≤)] {a b c : α}
571584

572585
@[simp, to_additive]
573586
lemma div_le_div_iff_left (a : α) : a / b ≤ a / c ↔ c ≤ b :=

src/data/set/intervals/basic.lean

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Johannes Hölzl, Mario Carneiro, Patrick Massot, Yury Kudryashov, Rémy
55
-/
66
import algebra.ordered_group
77
import data.set.basic
8+
import order.rel_iso
89

910
/-!
1011
# Intervals
@@ -1274,3 +1275,49 @@ end
12741275
end linear_ordered_add_comm_group
12751276

12761277
end set
1278+
1279+
namespace order_iso
1280+
variables {α β : Type*}
1281+
1282+
open set
1283+
1284+
section preorder
1285+
variables [preorder α] [preorder β]
1286+
1287+
@[simp] lemma preimage_Iic (e : α ≃o β) (b : β) : e ⁻¹' (Iic b) = Iic (e.symm b) :=
1288+
by { ext x, simp [← e.le_iff_le] }
1289+
1290+
@[simp] lemma preimage_Ici (e : α ≃o β) (b : β) : e ⁻¹' (Ici b) = Ici (e.symm b) :=
1291+
by { ext x, simp [← e.le_iff_le] }
1292+
1293+
@[simp] lemma preimage_Iio (e : α ≃o β) (b : β) : e ⁻¹' (Iio b) = Iio (e.symm b) :=
1294+
by { ext x, simp [← e.lt_iff_lt] }
1295+
1296+
@[simp] lemma preimage_Ioi (e : α ≃o β) (b : β) : e ⁻¹' (Ioi b) = Ioi (e.symm b) :=
1297+
by { ext x, simp [← e.lt_iff_lt] }
1298+
1299+
@[simp] lemma preimage_Icc (e : α ≃o β) (a b : β) : e ⁻¹' (Icc a b) = Icc (e.symm a) (e.symm b) :=
1300+
by simp [← Ici_inter_Iic]
1301+
1302+
@[simp] lemma preimage_Ico (e : α ≃o β) (a b : β) : e ⁻¹' (Ico a b) = Ico (e.symm a) (e.symm b) :=
1303+
by simp [← Ici_inter_Iio]
1304+
1305+
@[simp] lemma preimage_Ioc (e : α ≃o β) (a b : β) : e ⁻¹' (Ioc a b) = Ioc (e.symm a) (e.symm b) :=
1306+
by simp [← Ioi_inter_Iic]
1307+
1308+
@[simp] lemma preimage_Ioo (e : α ≃o β) (a b : β) : e ⁻¹' (Ioo a b) = Ioo (e.symm a) (e.symm b) :=
1309+
by simp [← Ioi_inter_Iio]
1310+
1311+
end preorder
1312+
1313+
/-- Order isomorphism between `Iic (⊤ : α)` and `α` when `α` has a top element -/
1314+
def Iic_top [order_top α] : set.Iic (⊤ : α) ≃o α :=
1315+
{ map_rel_iff' := λ x y, by refl,
1316+
.. (@equiv.subtype_univ_equiv α (set.Iic (⊤ : α)) (λ x, le_top)), }
1317+
1318+
/-- Order isomorphism between `Ici (⊥ : α)` and `α` when `α` has a bottom element -/
1319+
def Ici_bot [order_bot α] : set.Ici (⊥ : α) ≃o α :=
1320+
{ map_rel_iff' := λ x y, by refl,
1321+
.. (@equiv.subtype_univ_equiv α (set.Ici (⊥ : α)) (λ x, bot_le)) }
1322+
1323+
end order_iso

src/order/rel_iso.lean

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Mario Carneiro
55
-/
66
import logic.embedding
77
import order.rel_classes
8-
import data.set.intervals.basic
8+
import algebra.group.defs
99

1010
open function
1111

@@ -602,30 +602,6 @@ protected lemma strict_mono (e : α ≃o β) : strict_mono e := e.to_order_embed
602602
@[simp] lemma lt_iff_lt (e : α ≃o β) {x y : α} : e x < e y ↔ x < y :=
603603
e.to_order_embedding.lt_iff_lt
604604

605-
@[simp] lemma preimage_Iic (e : α ≃o β) (b : β) : e ⁻¹' (Iic b) = Iic (e.symm b) :=
606-
by { ext x, simp [← e.le_iff_le] }
607-
608-
@[simp] lemma preimage_Ici (e : α ≃o β) (b : β) : e ⁻¹' (Ici b) = Ici (e.symm b) :=
609-
by { ext x, simp [← e.le_iff_le] }
610-
611-
@[simp] lemma preimage_Iio (e : α ≃o β) (b : β) : e ⁻¹' (Iio b) = Iio (e.symm b) :=
612-
by { ext x, simp [← e.lt_iff_lt] }
613-
614-
@[simp] lemma preimage_Ioi (e : α ≃o β) (b : β) : e ⁻¹' (Ioi b) = Ioi (e.symm b) :=
615-
by { ext x, simp [← e.lt_iff_lt] }
616-
617-
@[simp] lemma preimage_Icc (e : α ≃o β) (a b : β) : e ⁻¹' (Icc a b) = Icc (e.symm a) (e.symm b) :=
618-
by simp [← Ici_inter_Iic]
619-
620-
@[simp] lemma preimage_Ico (e : α ≃o β) (a b : β) : e ⁻¹' (Ico a b) = Ico (e.symm a) (e.symm b) :=
621-
by simp [← Ici_inter_Iio]
622-
623-
@[simp] lemma preimage_Ioc (e : α ≃o β) (a b : β) : e ⁻¹' (Ioc a b) = Ioc (e.symm a) (e.symm b) :=
624-
by simp [← Ioi_inter_Iic]
625-
626-
@[simp] lemma preimage_Ioo (e : α ≃o β) (a b : β) : e ⁻¹' (Ioo a b) = Ioo (e.symm a) (e.symm b) :=
627-
by simp [← Ioi_inter_Iio]
628-
629605
/-- To show that `f : α → β`, `g : β → α` make up an order isomorphism of linear orders,
630606
it suffices to prove `cmp a (g b) = cmp (f a) b`. --/
631607
def of_cmp_eq_cmp {α β} [linear_order α] [linear_order β] (f : α → β) (g : β → α)
@@ -741,16 +717,6 @@ lemma order_iso.map_sup [semilattice_sup α] [semilattice_sup β]
741717
f (x ⊔ y) = f x ⊔ f y :=
742718
f.dual.map_inf x y
743719

744-
/-- Order isomorphism between `Iic (⊤ : α)` and `α` when `α` has a top element -/
745-
def order_iso.Iic_top [order_top α] : set.Iic (⊤ : α) ≃o α :=
746-
{ map_rel_iff' := λ x y, by refl,
747-
.. (@equiv.subtype_univ_equiv α (set.Iic (⊤ : α)) (λ x, le_top)), }
748-
749-
/-- Order isomorphism between `Ici (⊥ : α)` and `α` when `α` has a bottom element -/
750-
def order_iso.Ici_bot [order_bot α] : set.Ici (⊥ : α) ≃o α :=
751-
{ map_rel_iff' := λ x y, by refl,
752-
.. (@equiv.subtype_univ_equiv α (set.Ici (⊥ : α)) (λ x, bot_le)) }
753-
754720
section bounded_lattice
755721

756722
variables [bounded_lattice α] [bounded_lattice β] (f : α ≃o β)

0 commit comments

Comments
 (0)