module Order.Instances.Discrete where
open Functor
open Poset
open _⊣_
open _=>_
Discrete orders🔗
Every set can be turned into a poset by defining to be
: ∀ {ℓ} → Set ℓ → Poset ℓ ℓ
Disc .Ob = ⌞ A ⌟
Disc A ._≤_ = _≡_
Disc A .≤-thin = A .is-tr _ _
Disc A .≤-refl = refl
Disc A .≤-trans = _∙_
Disc A .≤-antisym p _ = p Disc A
We can do that same thing using the inductive identity type.
: ∀ {ℓ} → Set ℓ → Poset ℓ ℓ
Discᵢ .Ob = ⌞ A ⌟
Discᵢ A ._≤_ = _≡ᵢ_
Discᵢ A .≤-thin = hlevel 1
Discᵢ A .≤-refl = reflᵢ
Discᵢ A .≤-trans = _∙ᵢ_
Discᵢ A .≤-antisym reflᵢ _ = refl Discᵢ A
This extends to a functor from into the category of posets.
: ∀ {ℓ} → Functor (Sets ℓ) (Posets ℓ ℓ)
DiscF .F₀ = Disc
DiscF .F₁ f .hom = f
DiscF .F₁ f .pres-≤ = ap f
DiscF .F-id = trivial!
DiscF .F-∘ f g = trivial! DiscF
Furthermore, this functor is a left adjoint to the forgetful functor into
: ∀ {ℓ} → DiscF {ℓ} ⊣ Posets↪Sets
DiscF⊣Forget .unit .η A x = x
DiscF⊣Forget .unit .is-natural _ _ _ = refl
DiscF⊣Forget .counit .η P .hom x = x
DiscF⊣Forget .counit .η P .pres-≤ = Poset.≤-refl' P
DiscF⊣Forget .counit .is-natural P Q f = trivial!
DiscF⊣Forget .zig = trivial!
DiscF⊣Forget .zag = refl DiscF⊣Forget
Least upper bounds🔗
If has a least upper bound in the discrete poset on then must be a constant family.
disc-is-lub→const: ∀ {ℓ iℓ} {Ix : Type iℓ} {A : Set ℓ}
→ {f : Ix → ∣ A ∣} {x : ∣ A ∣}
→ is-lub (Disc A) f x
→ ∀ i → f i ≡ x
= is-lub.fam≤lub x-lub i
disc-is-lub→const x-lub i
disc-lub→const: ∀ {ℓ iℓ} {Ix : Type iℓ} {A : Set ℓ}
→ {f : Ix → ∣ A ∣}
→ Lub (Disc A) f
→ ∀ i j → f i ≡ f j
=
disc-lub→const x-lub i j .fam≤lub x-lub i ∙ sym (Lub.fam≤lub x-lub j) Lub