Debian Codegraph @

src/Algebra/Lattice/Morphism/Construct/Composition.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- The composition of morphisms between algebraic lattice structures.
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --safe --cubical-compatible #-}
8
9 module Algebra.Lattice.Morphism.Construct.Composition where
10
11 open import Algebra.Lattice.Bundles using (RawLattice)
12 open import Algebra.Lattice.Morphism.Structures
13 using (IsLatticeHomomorphism; IsLatticeIsomorphism; IsLatticeMonomorphism)
14 open import Function.Base using (_∘_)
15 import Function.Construct.Composition as Func
16 open import Level using (Level)
17 open import Relation.Binary.Morphism.Construct.Composition
18 using (isRelHomomorphism)
19 open import Relation.Binary.Definitions using (Transitive)
20
21 private
22 variable
23 a b c ℓ₁ ℓ₂ ℓ₃ : Level
24
25 ------------------------------------------------------------------------
26 -- Lattices
27
28 module _ {L₁ : RawLattice a ℓ₁}
29 {L₂ : RawLattice b ℓ₂}
30 {L₃ : RawLattice c ℓ₃}
31 (open RawLattice)
32 (≈₃-trans : Transitive (_≈_ L₃))
33 {f : Carrier L₁ → Carrier L₂}
34 {g : Carrier L₂ → Carrier L₃}
35 where
36
37 isLatticeHomomorphism
38 : IsLatticeHomomorphism L₁ L₂ f
39 → IsLatticeHomomorphism L₂ L₃ g
40 → IsLatticeHomomorphism L₁ L₃ (g ∘ f)
41 isLatticeHomomorphism f-homo g-homo = record
42 { isRelHomomorphism = isRelHomomorphism F.isRelHomomorphism G.isRelHomomorphism
43 ; ∧-homo = λ x y → ≈₃-trans (G.⟦⟧-cong (F.∧-homo x y)) (G.∧-homo (f x) (f y))
44 ; ∨-homo = λ x y → ≈₃-trans (G.⟦⟧-cong (F.∨-homo x y)) (G.∨-homo (f x) (f y))
45 } where module F = IsLatticeHomomorphism f-homo; module G = IsLatticeHomomorphism g-homo
46
47 isLatticeMonomorphism
48 : IsLatticeMonomorphism L₁ L₂ f
49 → IsLatticeMonomorphism L₂ L₃ g
50 → IsLatticeMonomorphism L₁ L₃ (g ∘ f)
51 isLatticeMonomorphism f-mono g-mono = record
52 { isLatticeHomomorphism = isLatticeHomomorphism F.isLatticeHomomorphism G.isLatticeHomomorphism
53 ; injective = F.injective ∘ G.injective
54 } where module F = IsLatticeMonomorphism f-mono; module G = IsLatticeMonomorphism g-mono
55
56 isLatticeIsomorphism
57 : IsLatticeIsomorphism L₁ L₂ f
58 → IsLatticeIsomorphism L₂ L₃ g
59 → IsLatticeIsomorphism L₁ L₃ (g ∘ f)
60 isLatticeIsomorphism f-iso g-iso = record
61 { isLatticeMonomorphism = isLatticeMonomorphism F.isLatticeMonomorphism G.isLatticeMonomorphism
62 ; surjective = Func.surjective _ _ (_≈_ L₃) F.surjective G.surjective
63 } where module F = IsLatticeIsomorphism f-iso; module G = IsLatticeIsomorphism g-iso