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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ New modules
Algebra.Module.Bundles.Raw
```

* Bundled morphisms between algebraic structures:
```
Algebra.Morphism.Bundles
```

* Prime factorisation of natural numbers.
```
Data.Nat.Primality.Factorisation
Expand Down
178 changes: 178 additions & 0 deletions src/Algebra/Morphism/Bundles.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
------------------------------------------------------------------------
-- The Agda standard library
--
-- Bundled definitions of homomorphisms between algebras
------------------------------------------------------------------------

{-# OPTIONS --cubical-compatible --safe #-}

module Algebra.Morphism.Bundles where

open import Algebra.Bundles -- using (Magma)
open import Algebra.Morphism.Structures -- using (IsMagmaHomomorphism)
open import Level using (Level; suc; _⊔_)
open import Relation.Binary.Morphism using (IsRelHomomorphism)
open import Relation.Binary.Morphism.Bundles using (SetoidHomomorphism)

private
variable
ℓ a ℓa b ℓb : Level


------------------------------------------------------------------------
-- Morphisms between Magmas
------------------------------------------------------------------------

record MagmaHomomorphism (A : Magma a ℓa) (B : Magma b ℓb) : Set (a ⊔ b ⊔ ℓa ⊔ ℓb) where
private
module A = Magma A
module B = Magma B

field
⟦_⟧ : A.Carrier → B.Carrier

isMagmaHomomorphism : IsMagmaHomomorphism A.rawMagma B.rawMagma ⟦_⟧

open IsMagmaHomomorphism isMagmaHomomorphism public

setoidHomomorphism : SetoidHomomorphism A.setoid B.setoid
setoidHomomorphism = record { isRelHomomorphism = isRelHomomorphism }

------------------------------------------------------------------------
-- Morphisms between Monoids
------------------------------------------------------------------------

record MonoidHomomorphism (A : Monoid a ℓa) (B : Monoid b ℓb) : Set (a ⊔ b ⊔ ℓa ⊔ ℓb) where
private
module A = Monoid A
module B = Monoid B

field
⟦_⟧ : A.Carrier → B.Carrier

isMonoidHomomorphism : IsMonoidHomomorphism A.rawMonoid B.rawMonoid ⟦_⟧

open IsMonoidHomomorphism isMonoidHomomorphism public

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

open MagmaHomomorphism magmaHomomorphism public

------------------------------------------------------------------------
-- Morphisms between Groups
------------------------------------------------------------------------

record GroupHomomorphism (A : Group a ℓa) (B : Group b ℓb) : Set (a ⊔ b ⊔ ℓa ⊔ ℓb) where
private
module A = Group A
module B = Group B

field
⟦_⟧ : A.Carrier → B.Carrier

isGroupHomomorphism : IsGroupHomomorphism A.rawGroup B.rawGroup ⟦_⟧

open IsGroupHomomorphism isGroupHomomorphism public

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

open MonoidHomomorphism monoidHomomorphism public

------------------------------------------------------------------------
-- Morphisms between NearSemirings
------------------------------------------------------------------------

record NearSemiringHomomorphism (A : NearSemiring a ℓa) (B : NearSemiring b ℓb) : Set (a ⊔ b ⊔ ℓa ⊔ ℓb) where
private
module A = NearSemiring A
module B = NearSemiring B

field
⟦_⟧ : A.Carrier → B.Carrier

isNearSemiringHomomorphism : IsNearSemiringHomomorphism A.rawNearSemiring B.rawNearSemiring ⟦_⟧

open IsNearSemiringHomomorphism isNearSemiringHomomorphism public

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

open MonoidHomomorphism +-monoidHomomorphism public

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

------------------------------------------------------------------------
-- Morphisms between Semirings
------------------------------------------------------------------------

record SemiringHomomorphism (A : Semiring a ℓa) (B : Semiring b ℓb) : Set (a ⊔ b ⊔ ℓa ⊔ ℓb) where
private
module A = Semiring A
module B = Semiring B

field
⟦_⟧ : A.Carrier → B.Carrier

isSemiringHomomorphism : IsSemiringHomomorphism A.rawSemiring B.rawSemiring ⟦_⟧

open IsSemiringHomomorphism isSemiringHomomorphism public

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

open MonoidHomomorphism *-monoidHomomorphism public

------------------------------------------------------------------------
-- Morphisms between RingWithoutOnes
------------------------------------------------------------------------
{-

Problem: bundle RingWithoutOne doesn't re-export its underlying RawRingWithoutOne!

record RingWithoutOneHomomorphism (A : RingWithoutOne a ℓa) (B : RingWithoutOne b ℓb) : Set (a ⊔ b ⊔ ℓa ⊔ ℓb) where
private
module A = RingWithoutOne A
module B = RingWithoutOne B

field
⟦_⟧ : A.Carrier → B.Carrier
isRingWithoutOneHomomorphism : IsRingWithoutOneHomomorphism A.rawRingWithoutOne B.rawRingWithoutOne ⟦_⟧

open IsRingWithoutOneHomomorphism isRingWithoutOneHomomorphism public

+-groupHomomorphism : GroupHomomorphism A.+-group B.+-group
+-groupHomomorphism = record { isGroupHomomorphism = +-isGroupHomomorphism }

open GroupHomomorphism +-groupHomomorphism public

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

open MonoidHomomorphism *-monoidHomomorphism public
-}
------------------------------------------------------------------------
-- Morphisms between Rings
------------------------------------------------------------------------

record RingHomomorphism (A : Ring a ℓa) (B : Ring b ℓb) : Set (a ⊔ b ⊔ ℓa ⊔ ℓb) where
private
module A = Ring A
module B = Ring B

field
⟦_⟧ : A.Carrier → B.Carrier
isRingHomomorphism : IsRingHomomorphism A.rawRing B.rawRing ⟦_⟧

open IsRingHomomorphism isRingHomomorphism public

+-groupHomomorphism : GroupHomomorphism A.+-group B.+-group
+-groupHomomorphism = record { isGroupHomomorphism = +-isGroupHomomorphism }

open GroupHomomorphism +-groupHomomorphism public

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