Skip to content

Add bundled homomorphisms #2383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fe3fea0
Bundle `Algebra.Morphism`s
jamesmckinna May 7, 2024
a33cff6
more bundles!
jamesmckinna May 8, 2024
ca14ed9
`RingWithoutOne` now exports a `RawRingWithoutOne` field
jamesmckinna May 15, 2024
a5f8c0e
disambiguation error when trying to add `RingWithoutOneHomomorphism` …
jamesmckinna May 15, 2024
7d9649c
FIXED: disambiguation error when trying to add `RingWithoutOneHomomor…
jamesmckinna May 15, 2024
a4a1549
add `rawKleeneAlgebra`
jamesmckinna May 16, 2024
32682ce
add `KleeneAlgebra`, `Quasigroup`, and `Lopp` homomorphisms
jamesmckinna May 16, 2024
59474ac
add bundled `Identity` homomorphisms
jamesmckinna May 16, 2024
6c8459f
avoid name clash: remove `open`ing of sub-homomorphism bundles
jamesmckinna May 16, 2024
df9b2da
add bundled `Composition` of homomorphisms
jamesmckinna May 16, 2024
6c44f5b
more exported sub-bundles
jamesmckinna May 16, 2024
150daaa
removed redundant anonymous `module`s
jamesmckinna May 16, 2024
454d8ed
removed redundant anonymous `module`s
jamesmckinna May 16, 2024
04fa1f4
add `isNearSemiring` to `IsRingWithoutOne` plus knock-on re-exports
jamesmckinna May 17, 2024
71e8e2e
add `nearSemiring` to `RingWithoutOne` plus knock-on re-exports
jamesmckinna May 17, 2024
8e1c8a1
add `rawNearSemiring` to `RingWithoutOne` plus knock-on re-exports
jamesmckinna May 17, 2024
da9b808
lots more exported sub-structures and sub-bundles
jamesmckinna May 17, 2024
6d1c1c1
fix bug: restrict exports
jamesmckinna May 17, 2024
88aa9f6
lots more exported sub-structures and sub-bundles
jamesmckinna May 17, 2024
deff25f
Merge branch 'master' into bundled-homomorphisms
jamesmckinna May 31, 2024
6c31fde
refactor: `RawX` parameterisation
jamesmckinna Jun 12, 2024
38fb861
knock-on: `Identity` takes a full `Bundle`
jamesmckinna Jun 12, 2024
08624e5
tighten imports
jamesmckinna Jun 12, 2024
52ab68a
knock-on: `Composition` takes full `Bundle`s
jamesmckinna Jun 12, 2024
3409e84
`CHANGELOG`
jamesmckinna Jun 12, 2024
2677916
Merge branch 'master' into bundled-homomorphisms
jamesmckinna Jun 12, 2024
dfb67c9
`fix-whitespace`
jamesmckinna Jun 12, 2024
1e8c3d3
Merge branch 'master' into bundled-homomorphisms
jamesmckinna Jun 13, 2024
bd66103
fix `CHANGELOG`
jamesmckinna Jul 28, 2024
4da68d5
Merge branch 'agda:master' into bundled-homomorphisms
jamesmckinna Jul 28, 2024
8fa69d9
update `CHANGELOG`
jamesmckinna Jul 28, 2024
4c2cec5
Merge branch 'master' into bundled-homomorphisms
jamesmckinna Aug 5, 2024
b325a03
Merge branch 'master' into bundled-homomorphisms
MatthewDaggitt Aug 14, 2024
0a1cc14
Merge branch 'master' into bundled-homomorphisms
jamesmckinna Aug 14, 2024
47308cc
Merge branch 'master' into bundled-homomorphisms
jamesmckinna Sep 3, 2024
86e0e37
Merge branch 'master' into bundled-homomorphisms
jamesmckinna Sep 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,55 @@ Additions to existing modules
rawModule : RawModule R c ℓ
```

* In `Algebra.Morphism.Construct.Composition`:
```
magmaHomomorphism : MagmaHomomorphism M₁ M₂ →
MagmaHomomorphism M₂ M₃ →
MagmaHomomorphism M₁ M₃
monoidHomomorphism : MonoidHomomorphism M₁ M₂ →
MagmaHomomorphism M₂ M₃ →
MagmaHomomorphism M₁ M₃
groupHomomorphism : GroupHomomorphism M₁ M₂ →
MagmaHomomorphism M₂ M₃ →
MagmaHomomorphism M₁ M₃
nearSemiringHomomorphism : NearSemiringHomomorphism M₁ M₂ →
NearSemiringHomomorphism M₂ M₃ →
NearSemiringHomomorphism M₁ M₃
semiringHomomorphism : SemiringHomomorphism M₁ M₂ →
SemiringHomomorphism M₂ M₃ →
SemiringHomomorphism M₁ M₃
kleeneAlgebraHomomorphism : KleeneAlgebraHomomorphism M₁ M₂ →
KleeneAlgebraHomomorphism M₂ M₃ →
KleeneAlgebraHomomorphism M₁ M₃
ringWithoutOneHomomorphism : RingWithoutOneHomomorphism M₁ M₂ →
RingWithoutOneHomomorphism M₂ M₃ →
RingWithoutOneHomomorphism M₁ M₃
ringHomomorphism : RingHomomorphism M₁ M₂ →
RingHomomorphism M₂ M₃ →
RingHomomorphism M₁ M₃
quasigroupHomomorphism : QuasigroupHomomorphism M₁ M₂ →
QuasigroupHomomorphism M₂ M₃ →
QuasigroupHomomorphism M₁ M₃
loopHomomorphism : LoopHomomorphism M₁ M₂ →
LoopHomomorphism M₂ M₃ →
LoopHomomorphism M₁ M₃
```

* In `Algebra.Morphism.Construct.Identity`:
```
magmaHomomorphism : MagmaHomomorphism M M
monoidHomomorphism : MonoidHomomorphism M M
groupHomomorphism : GroupHomomorphism M M
nearSemiringHomomorphism : NearSemiringHomomorphism M M
semiringHomomorphism : SemiringHomomorphism M M
kleeneAlgebraHomomorphism : KleeneAlgebraHomomorphism M M
nearSemiringHomomorphism : NearSemiringHomomorphism M M
ringWithoutOneHomomorphism : RingWithoutOneHomomorphism M M
ringHomomorphism : RingHomomorphism M M
quasigroupHomomorphism : QuasigroupHomomorphism M M
loopHomomorphism : LoopHomomorphism M M
```

* In `Algebra.Morphism.Structures`
```agda
module SuccessorSetMorphisms (N₁ : RawSuccessorSet a ℓ₁) (N₂ : RawSuccessorSet b ℓ₂) where
Expand Down
17 changes: 0 additions & 17 deletions src/Algebra/Morphism/Bundles.agda
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ record MonoidHomomorphism (A : Monoid a ℓa) (B : Monoid b ℓb) : Set (a ⊔ b
magmaHomomorphism : MagmaHomomorphism A.magma B.magma
magmaHomomorphism = record { isMagmaHomomorphism = isMagmaHomomorphism }

open MagmaHomomorphism magmaHomomorphism public

------------------------------------------------------------------------
-- Morphisms between Groups
------------------------------------------------------------------------
Expand All @@ -78,8 +76,6 @@ record GroupHomomorphism (A : Group a ℓa) (B : Group b ℓb) : Set (a ⊔ b
monoidHomomorphism : MonoidHomomorphism A.monoid B.monoid
monoidHomomorphism = record { isMonoidHomomorphism = isMonoidHomomorphism }

open MonoidHomomorphism monoidHomomorphism public

------------------------------------------------------------------------
-- Morphisms between NearSemirings
------------------------------------------------------------------------
Expand All @@ -99,8 +95,6 @@ record NearSemiringHomomorphism (A : NearSemiring a ℓa) (B : NearSemiring b
+-monoidHomomorphism : MonoidHomomorphism A.+-monoid B.+-monoid
+-monoidHomomorphism = record { isMonoidHomomorphism = +-isMonoidHomomorphism }

open MonoidHomomorphism +-monoidHomomorphism public

*-magmaHomomorphism : MagmaHomomorphism A.*-magma B.*-magma
*-magmaHomomorphism = record { isMagmaHomomorphism = *-isMagmaHomomorphism }

Expand All @@ -123,8 +117,6 @@ record SemiringHomomorphism (A : Semiring a ℓa) (B : Semiring b ℓb) : Set (a
*-monoidHomomorphism : MonoidHomomorphism A.*-monoid B.*-monoid
*-monoidHomomorphism = record { isMonoidHomomorphism = *-isMonoidHomomorphism }

open MonoidHomomorphism *-monoidHomomorphism public

------------------------------------------------------------------------
-- Morphisms between KleeneAlgebras
------------------------------------------------------------------------
Expand Down Expand Up @@ -164,14 +156,9 @@ record RingWithoutOneHomomorphism (A : RingWithoutOne a ℓa) (B : RingWithoutOn
+-groupHomomorphism : GroupHomomorphism A.+-group B.+-group
+-groupHomomorphism = record { isGroupHomomorphism = +-isGroupHomomorphism }

open GroupHomomorphism +-groupHomomorphism public

*-magmaHomomorphism : MagmaHomomorphism A.*-magma B.*-magma
*-magmaHomomorphism = record { isMagmaHomomorphism = *-isMagmaHomomorphism }

open MagmaHomomorphism *-magmaHomomorphism public
hiding (setoidHomomorphism)

------------------------------------------------------------------------
-- Morphisms between Rings
------------------------------------------------------------------------
Expand All @@ -190,8 +177,6 @@ record RingHomomorphism (A : Ring a ℓa) (B : Ring b ℓb) : Set (a ⊔ b ⊔
+-groupHomomorphism : GroupHomomorphism A.+-group B.+-group
+-groupHomomorphism = record { isGroupHomomorphism = +-isGroupHomomorphism }

open GroupHomomorphism +-groupHomomorphism public

*-monoidHomomorphism : MonoidHomomorphism A.*-monoid B.*-monoid
*-monoidHomomorphism = record { isMonoidHomomorphism = *-isMonoidHomomorphism }

Expand All @@ -213,8 +198,6 @@ record QuasigroupHomomorphism (A : Quasigroup a ℓa) (B : Quasigroup b ℓb) :
magmaHomomorphism : MagmaHomomorphism A.magma B.magma
magmaHomomorphism = record { isMagmaHomomorphism = ∙-isMagmaHomomorphism }

open MagmaHomomorphism magmaHomomorphism public

------------------------------------------------------------------------
-- Morphisms between Loops
------------------------------------------------------------------------
Expand Down
166 changes: 166 additions & 0 deletions src/Algebra/Morphism/Construct/Composition.agda
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
module Algebra.Morphism.Construct.Composition where

open import Algebra.Bundles
open import Algebra.Morphism.Bundles
open import Algebra.Morphism.Structures
open import Function.Base using (_∘_)
import Function.Construct.Composition as Func
Expand Down Expand Up @@ -423,3 +424,168 @@ module _ {K₁ : RawKleeneAlgebra a ℓ₁}
; surjective = Func.surjective (_≈_ K₁) (_≈_ K₂) (_≈_ K₃) F.surjective G.surjective
} where module F = IsKleeneAlgebraIsomorphism f-iso; module G = IsKleeneAlgebraIsomorphism g-iso

-----------------------------------------------------------------------
-- Bundled morphisms between algebras
------------------------------------------------------------------------

-- Magma

module _ {M₁ : Magma a ℓ₁}
{M₂ : Magma b ℓ₂}
{M₃ : Magma c ℓ₃}
(h : MagmaHomomorphism M₁ M₂)
(k : MagmaHomomorphism M₂ M₃)
where

private
module H = MagmaHomomorphism h
module K = MagmaHomomorphism k

magmaHomomorphism : MagmaHomomorphism M₁ M₃
magmaHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isMagmaHomomorphism = isMagmaHomomorphism (Magma.trans M₃) H.isMagmaHomomorphism K.isMagmaHomomorphism }

-- Monoid

module _ {M₁ : Monoid a ℓ₁}
{M₂ : Monoid b ℓ₂}
{M₃ : Monoid c ℓ₃}
(h : MonoidHomomorphism M₁ M₂)
(k : MonoidHomomorphism M₂ M₃)
where

private
module H = MonoidHomomorphism h
module K = MonoidHomomorphism k

monoidHomomorphism : MonoidHomomorphism M₁ M₃
monoidHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isMonoidHomomorphism = isMonoidHomomorphism (Monoid.trans M₃) H.isMonoidHomomorphism K.isMonoidHomomorphism }

-- Group

module _ {M₁ : Group a ℓ₁}
{M₂ : Group b ℓ₂}
{M₃ : Group c ℓ₃}
(h : GroupHomomorphism M₁ M₂)
(k : GroupHomomorphism M₂ M₃)
where

private
module H = GroupHomomorphism h
module K = GroupHomomorphism k

groupHomomorphism : GroupHomomorphism M₁ M₃
groupHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isGroupHomomorphism = isGroupHomomorphism (Group.trans M₃) H.isGroupHomomorphism K.isGroupHomomorphism }

-- NearSemiring

module _ {M₁ : NearSemiring a ℓ₁}
{M₂ : NearSemiring b ℓ₂}
{M₃ : NearSemiring c ℓ₃}
(h : NearSemiringHomomorphism M₁ M₂)
(k : NearSemiringHomomorphism M₂ M₃)
where

private
module H = NearSemiringHomomorphism h
module K = NearSemiringHomomorphism k

nearSemiringHomomorphism : NearSemiringHomomorphism M₁ M₃
nearSemiringHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isNearSemiringHomomorphism = isNearSemiringHomomorphism (NearSemiring.trans M₃) H.isNearSemiringHomomorphism K.isNearSemiringHomomorphism }

-- Semiring

module _ {M₁ : Semiring a ℓ₁}
{M₂ : Semiring b ℓ₂}
{M₃ : Semiring c ℓ₃}
(h : SemiringHomomorphism M₁ M₂)
(k : SemiringHomomorphism M₂ M₃)
where

private
module H = SemiringHomomorphism h
module K = SemiringHomomorphism k

semiringHomomorphism : SemiringHomomorphism M₁ M₃
semiringHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isSemiringHomomorphism = isSemiringHomomorphism (Semiring.trans M₃) H.isSemiringHomomorphism K.isSemiringHomomorphism }

-- RingWithoutOne

module _ {M₁ : RingWithoutOne a ℓ₁}
{M₂ : RingWithoutOne b ℓ₂}
{M₃ : RingWithoutOne c ℓ₃}
(h : RingWithoutOneHomomorphism M₁ M₂)
(k : RingWithoutOneHomomorphism M₂ M₃)
where

private
module H = RingWithoutOneHomomorphism h
module K = RingWithoutOneHomomorphism k

ringWithoutOneHomomorphism : RingWithoutOneHomomorphism M₁ M₃
ringWithoutOneHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isRingWithoutOneHomomorphism = isRingWithoutOneHomomorphism (RingWithoutOne.trans M₃) H.isRingWithoutOneHomomorphism K.isRingWithoutOneHomomorphism }

-- Ring

module _ {M₁ : Ring a ℓ₁}
{M₂ : Ring b ℓ₂}
{M₃ : Ring c ℓ₃}
(h : RingHomomorphism M₁ M₂)
(k : RingHomomorphism M₂ M₃)
where

private
module H = RingHomomorphism h
module K = RingHomomorphism k

ringHomomorphism : RingHomomorphism M₁ M₃
ringHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isRingHomomorphism = isRingHomomorphism (Ring.trans M₃) H.isRingHomomorphism K.isRingHomomorphism }

-- Quasigroup

module _ {M₁ : Quasigroup a ℓ₁}
{M₂ : Quasigroup b ℓ₂}
{M₃ : Quasigroup c ℓ₃}
(h : QuasigroupHomomorphism M₁ M₂)
(k : QuasigroupHomomorphism M₂ M₃)
where

private
module H = QuasigroupHomomorphism h
module K = QuasigroupHomomorphism k

quasigroupHomomorphism : QuasigroupHomomorphism M₁ M₃
quasigroupHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isQuasigroupHomomorphism = isQuasigroupHomomorphism (Quasigroup.trans M₃) H.isQuasigroupHomomorphism K.isQuasigroupHomomorphism }

-- Loop

module _ {M₁ : Loop a ℓ₁}
{M₂ : Loop b ℓ₂}
{M₃ : Loop c ℓ₃}
(h : LoopHomomorphism M₁ M₂)
(k : LoopHomomorphism M₂ M₃)
where

private
module H = LoopHomomorphism h
module K = LoopHomomorphism k

loopHomomorphism : LoopHomomorphism M₁ M₃
loopHomomorphism = record
{ ⟦_⟧ = K.⟦_⟧ ∘ H.⟦_⟧
; isLoopHomomorphism = isLoopHomomorphism (Loop.trans M₃) H.isLoopHomomorphism K.isLoopHomomorphism }
Loading