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

Commit 6109558

Browse files
jcommelinkim-em
andcommitted
chore(category_theory/*): provide aliases quiver.hom.le and has_le.le.hom (#7677)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent a85fbda commit 6109558

File tree

20 files changed

+58
-70
lines changed

20 files changed

+58
-70
lines changed

src/algebra/category/Module/limits.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ variables (f : Π i j, i ≤ j → G i →ₗ[R] G j) [module.directed_system G
147147
@[simps]
148148
def direct_limit_diagram : ι ⥤ Module R :=
149149
{ obj := λ i, Module.of R (G i),
150-
map := λ i j hij, f i j (le_of_hom hij),
150+
map := λ i j hij, f i j hij.le,
151151
map_id' := λ i, by { ext x, apply module.directed_system.map_self },
152152
map_comp' := λ i j k hij hjk,
153153
begin

src/category_theory/category/default.lean

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ Because we do not allow the morphisms of a category to live in `Prop`,
260260
unfortunately we need to use `plift` and `ulift` when defining the morphisms.
261261
262262
As convenience functions, we provide `hom_of_le` and `le_of_hom` to wrap and unwrap inequalities.
263+
We also provide aliases `has_le.le.hom` and `quiver.hom.le` to use with dot notation.
263264
-/
264265
namespace preorder
265266

@@ -291,19 +292,21 @@ Express an inequality as a morphism in the corresponding preorder category.
291292
-/
292293
def hom_of_le {U V : α} (h : U ≤ V) : U ⟶ V := ulift.up (plift.up h)
293294

294-
@[simp] lemma hom_of_le_refl {U : α} : hom_of_le (le_refl U) = 𝟙 U := rfl
295+
alias hom_of_le ← has_le.le.hom
296+
297+
@[simp] lemma hom_of_le_refl {U : α} : (le_refl U).hom = 𝟙 U := rfl
295298
@[simp] lemma hom_of_le_comp {U V W : α} (h : U ≤ V) (k : V ≤ W) :
296-
hom_of_le hhom_of_le k = hom_of_le (h.trans k) := rfl
299+
h.homk.hom = (h.trans k).hom := rfl
297300

298301
/--
299302
Extract the underlying inequality from a morphism in a preorder category.
300303
-/
301304
lemma le_of_hom {U V : α} (h : U ⟶ V) : U ≤ V := h.down.down
302305

303-
@[simp] lemma le_of_hom_hom_of_le {a b : α} (h : a ≤ b) :
304-
le_of_hom (hom_of_le h) = h := rfl
305-
@[simp] lemma hom_of_le_le_of_hom {a b : α} (h : a b) :
306-
hom_of_le (le_of_hom h) = h :=
306+
alias le_of_hom ← quiver.hom.le
307+
308+
@[simp] lemma le_of_hom_hom_of_le {a b : α} (h : a b) : h.hom.le = h := rfl
309+
@[simp] lemma hom_of_le_le_of_hom {a b : α} (h : a ⟶ b) : h.le.hom = h :=
307310
by { cases h, cases h, refl, }
308311

309312
end category_theory

src/category_theory/category/pairwise.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def cocone_is_colimit : is_colimit (cocone U) :=
143143
begin
144144
apply complete_lattice.Sup_le,
145145
rintros _ ⟨j, rfl⟩,
146-
exact le_of_hom (s.ι.app (single j))
146+
exact (s.ι.app (single j)).le
147147
end }
148148

149149
end

src/category_theory/equivalence.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,8 @@ def equivalence.to_order_iso (e : α ≌ β) : α ≃o β :=
563563
left_inv := λ a, (e.unit_iso.app a).to_eq.symm,
564564
right_inv := λ b, (e.counit_iso.app b).to_eq,
565565
map_rel_iff' := λ a a',
566-
⟨λ h, le_of_hom
567-
((equivalence.unit e).app a ≫ e.inverse.map (hom_of_le h) ≫ (equivalence.unit_inv e).app a'),
568-
λ (h : a ≤ a'), le_of_hom (e.functor.map (hom_of_le h))⟩, }
566+
⟨λ h, ((equivalence.unit e).app a ≫ e.inverse.map h.hom ≫ (equivalence.unit_inv e).app a').le,
567+
λ (h : a ≤ a'), (e.functor.map h.hom).le⟩, }
569568

570569
-- `@[simps]` on `equivalence.to_order_iso` produces lemmas that fail the `simp_nf` linter,
571570
-- so we provide them by hand:

src/category_theory/functor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ end
106106

107107
@[mono] lemma monotone {α β : Type*} [preorder α] [preorder β] (F : α ⥤ β) :
108108
monotone F.obj :=
109-
λ a b h, le_of_hom (F.map (hom_of_le h))
109+
λ a b h, (F.map h.hom).le
110110

111111
end functor
112112

src/category_theory/isomorphism.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ end functor
390390
section partial_order
391391
variables {α β : Type*} [partial_order α] [partial_order β]
392392

393-
lemma iso.to_eq {X Y : α} (f : X ≅ Y) : X = Y :=
394-
le_antisymm (le_of_hom f.hom) (le_of_hom f.inv)
393+
lemma iso.to_eq {X Y : α} (f : X ≅ Y) : X = Y := le_antisymm f.hom.le f.inv.le
395394

396395
end partial_order
397396

src/category_theory/limits/lattice.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def limit_cone [complete_lattice α] (F : J ⥤ α) : limit_cone F :=
4747
{ app := λ j, hom_of_le (complete_lattice.Inf_le _ _ (set.mem_range_self _)) } },
4848
is_limit :=
4949
{ lift := λ s, hom_of_le (complete_lattice.le_Inf _ _
50-
begin rintros _ ⟨j, rfl⟩, exact le_of_hom (s.π.app j), end) } }
50+
begin rintros _ ⟨j, rfl⟩, exact (s.π.app j).le, end) } }
5151

5252
/--
5353
The colimit cocone over any functor into a complete lattice.
@@ -59,7 +59,7 @@ def colimit_cocone [complete_lattice α] (F : J ⥤ α) : colimit_cocone F :=
5959
{ app := λ j, hom_of_le (complete_lattice.le_Sup _ _ (set.mem_range_self _)) } },
6060
is_colimit :=
6161
{ desc := λ s, hom_of_le (complete_lattice.Sup_le _ _
62-
begin rintros _ ⟨j, rfl⟩, exact le_of_hom (s.ι.app j), end) } }
62+
begin rintros _ ⟨j, rfl⟩, exact (s.ι.app j).le, end) } }
6363

6464
-- It would be nice to only use the `Inf` half of the complete lattice, but
6565
-- this seems not to have been described separately.

src/category_theory/opposites.lean

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,18 +419,16 @@ universes v
419419
variables {α : Type v} [preorder α]
420420

421421
/-- Construct a morphism in the opposite of a preorder category from an inequality. -/
422-
def op_hom_of_le {U V : αᵒᵖ} (h : unop V ≤ unop U) : U ⟶ V :=
423-
quiver.hom.op (hom_of_le h)
422+
def op_hom_of_le {U V : αᵒᵖ} (h : unop V ≤ unop U) : U ⟶ V := h.hom.op
424423

425-
lemma le_of_op_hom {U V : αᵒᵖ} (h : U ⟶ V) : unop V ≤ unop U :=
426-
le_of_hom (h.unop)
424+
lemma le_of_op_hom {U V : αᵒᵖ} (h : U ⟶ V) : unop V ≤ unop U := h.unop.le
427425

428426
namespace functor
429427

430428
variables (C)
431429
variables (D : Type u₂) [category.{v₂} D]
432430

433-
/--
431+
/--
434432
The equivalence of functor categories induced by `op` and `unop`.
435433
-/
436434
@[simps]

src/category_theory/sites/spaces.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def grothendieck_topology : grothendieck_topology (opens T) :=
4545
top_mem' := λ X x hx, ⟨_, 𝟙 _, trivial, hx⟩,
4646
pullback_stable' := λ X Y S f hf y hy,
4747
begin
48-
rcases hf y (le_of_hom f hy) with ⟨U, g, hg, hU⟩,
48+
rcases hf y (f.le hy) with ⟨U, g, hg, hU⟩,
4949
refine ⟨U ⊓ Y, hom_of_le inf_le_right, _, hU, hy⟩,
5050
apply S.downward_closed hg (hom_of_le inf_le_left),
5151
end,
@@ -60,10 +60,10 @@ def grothendieck_topology : grothendieck_topology (opens T) :=
6060
def pretopology : pretopology (opens T) :=
6161
{ coverings := λ X R, ∀ x ∈ X, ∃ U (f : U ⟶ X), R f ∧ x ∈ U,
6262
has_isos := λ X Y f i x hx,
63-
by exactI ⟨_, _, presieve.singleton_self _, le_of_hom (inv f) hx⟩,
63+
by exactI ⟨_, _, presieve.singleton_self _, (inv f).le hx⟩,
6464
pullbacks := λ X Y f S hS x hx,
6565
begin
66-
rcases hS _ (le_of_hom f hx) with ⟨U, g, hg, hU⟩,
66+
rcases hS _ (f.le hx) with ⟨U, g, hg, hU⟩,
6767
refine ⟨_, _, presieve.pullback_arrows.mk _ _ hg, _⟩,
6868
have : U ⊓ Y ≤ pullback g f,
6969
refine le_of_hom (pullback.lift (hom_of_le inf_le_left) (hom_of_le inf_le_right) rfl),

src/category_theory/skeletal.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ variables {C} {D}
152152
def map (F : C ⥤ D) : thin_skeleton C ⥤ thin_skeleton D :=
153153
{ obj := quotient.map F.obj $ λ X₁ X₂ ⟨hX⟩, ⟨F.map_iso hX⟩,
154154
map := λ X Y, quotient.rec_on_subsingleton₂ X Y $
155-
λ x y k, hom_of_le ((le_of_hom k).elim (λ t, ⟨F.map t⟩)) }
155+
λ x y k, hom_of_le (k.le.elim (λ t, ⟨F.map t⟩)) }
156156

157157
lemma comp_to_thin_skeleton (F : C ⥤ D) : F ⋙ to_thin_skeleton D = to_thin_skeleton C ⋙ map F :=
158158
rfl
@@ -172,11 +172,11 @@ def map₂ (F : C ⥤ D ⥤ E) :
172172
(λ X₁ X₂ ⟨hX⟩ Y₁ Y₂ ⟨hY⟩, ⟨(F.obj X₁).map_iso hY ≪≫ (F.map_iso hX).app Y₂⟩) x y,
173173
map := λ y₁ y₂, quotient.rec_on_subsingleton x $
174174
λ X, quotient.rec_on_subsingleton₂ y₁ y₂ $
175-
λ Y₁ Y₂ hY, hom_of_le ((le_of_hom hY).elim (λ g, ⟨(F.obj X).map g⟩)) },
175+
λ Y₁ Y₂ hY, hom_of_le (hY.le.elim (λ g, ⟨(F.obj X).map g⟩)) },
176176
map := λ x₁ x₂, quotient.rec_on_subsingleton₂ x₁ x₂ $
177177
λ X₁ X₂ f,
178178
{ app := λ y, quotient.rec_on_subsingleton y
179-
(λ Y, hom_of_le ((le_of_hom f).elim (λ f', ⟨(F.map f').app Y⟩))) } }
179+
(λ Y, hom_of_le (f.le.elim (λ f', ⟨(F.map f').app Y⟩))) } }
180180

181181
variables (C)
182182

@@ -192,7 +192,7 @@ noncomputable def from_thin_skeleton : thin_skeleton C ⥤ C :=
192192
map := λ x y, quotient.rec_on_subsingleton₂ x y $
193193
λ X Y f,
194194
(nonempty.some (quotient.mk_out X)).hom
195-
(le_of_hom f).some
195+
f.le.some
196196
≫ (nonempty.some (quotient.mk_out Y)).inv }
197197

198198
noncomputable instance from_thin_skeleton_equivalence : is_equivalence (from_thin_skeleton C) :=
@@ -218,7 +218,7 @@ instance thin_skeleton_partial_order : partial_order (thin_skeleton C) :=
218218
..category_theory.thin_skeleton.preorder C }
219219

220220
lemma skeletal : skeletal (thin_skeleton C) :=
221-
λ X Y, quotient.induction_on₂ X Y $ λ x y h, h.elim $ λ i, (le_of_hom i.1).antisymm (le_of_hom i.2)
221+
λ X Y, quotient.induction_on₂ X Y $ λ x y h, h.elim $ λ i, i.1.le.antisymm i.2.le
222222

223223
lemma map_comp_eq (F : E ⥤ D) (G : D ⥤ C) : map (F ⋙ G) = map F ⋙ map G :=
224224
functor.eq_of_iso skeletal $

0 commit comments

Comments
 (0)