-
Notifications
You must be signed in to change notification settings - Fork 103
The algebraic theory of semigroups #1899
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
Open
lowasser
wants to merge
14
commits into
UniMath:master
Choose a base branch
from
lowasser:universal-algebra-semigroup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bb3579e
Progress
lowasser e95846b
Remove unused imports
lowasser c86f625
Merge branch 'algebra-v3' into universal-algebra-semigroup
lowasser a33fcf7
Progress
lowasser 03acc38
Progress
lowasser 0cdabdd
Update naming scheme
lowasser b216213
Progress
lowasser 03188eb
Progress
lowasser 6d81b2a
Progress
lowasser 749b3c3
Merge branch 'master' into universal-algebra-semigroup
lowasser 06c6573
Merge branch 'master' into universal-algebra-semigroup
lowasser ec754a0
Progress
lowasser fc8429c
Merge branch 'master' into universal-algebra-semigroup
lowasser dcc607c
Merge branch 'master' into universal-algebra-semigroup
lowasser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
231 changes: 231 additions & 0 deletions
231
src/universal-algebra/algebraic-theory-of-semigroups.lagda.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,231 @@ | ||
| # The algebraic theory of semigroups | ||
|
|
||
| ```agda | ||
| module universal-algebra.algebraic-theory-of-semigroups where | ||
| ``` | ||
|
|
||
| <details><summary>Imports</summary> | ||
|
|
||
| ```agda | ||
| open import elementary-number-theory.modular-arithmetic-standard-finite-types | ||
| open import elementary-number-theory.natural-numbers | ||
|
|
||
| open import foundation.binary-homotopies | ||
| open import foundation.dependent-pair-types | ||
| open import foundation.equality-dependent-pair-types | ||
| open import foundation.equivalences | ||
| open import foundation.homotopies | ||
| open import foundation.identity-types | ||
| open import foundation.sets | ||
| open import foundation.subtypes | ||
| open import foundation.universe-levels | ||
|
|
||
| open import group-theory.homomorphisms-semigroups | ||
| open import group-theory.semigroups | ||
|
|
||
| open import lists.tuples | ||
|
|
||
| open import universal-algebra.algebraic-theories | ||
| open import universal-algebra.algebras | ||
| open import universal-algebra.homomorphisms-of-algebras | ||
| open import universal-algebra.models-of-signatures | ||
| open import universal-algebra.signatures | ||
| open import universal-algebra.terms-over-signatures | ||
| ``` | ||
|
|
||
| </details> | ||
|
|
||
| ## Idea | ||
|
|
||
| There is an | ||
| {{#concept "algebraic theory of semigroups" Agda=algebraic-theory-Semigroup}}. | ||
| The type of all such [algebras](universal-algebra.algebras.md) is | ||
| [equivalent](foundation-core.equivalences.md) to the type of | ||
| [semigroups](group-theory.semigroups.md). | ||
|
|
||
| ## Definition | ||
|
|
||
| ```agda | ||
| data operation-Semigroup : UU lzero where | ||
| mul-operation-Semigroup : operation-Semigroup | ||
|
|
||
| signature-Semigroup : signature lzero | ||
| pr1 signature-Semigroup = operation-Semigroup | ||
| pr2 signature-Semigroup mul-operation-Semigroup = 2 | ||
|
|
||
| data law-Semigroup : UU lzero where | ||
| associative-mul-law-Semigroup : law-Semigroup | ||
|
|
||
| algebraic-theory-Semigroup : Algebraic-Theory lzero signature-Semigroup | ||
| pr1 algebraic-theory-Semigroup = law-Semigroup | ||
| pr2 algebraic-theory-Semigroup associative-mul-law-Semigroup = | ||
| let | ||
| var : (i : ℕ) → term signature-Semigroup 3 | ||
| var i = var-term (mod-succ-ℕ 2 i) | ||
| _*_ x y = op-term mul-operation-Semigroup (x ∷ y ∷ empty-tuple) | ||
| in | ||
| ( 3 , | ||
| (var 0 * var 1) * var 2 , | ||
| var 0 * (var 1 * var 2)) | ||
|
|
||
| Algebra-Semigroup : (l : Level) → UU (lsuc l) | ||
| Algebra-Semigroup l = | ||
| Algebra l signature-Semigroup algebraic-theory-Semigroup | ||
| ``` | ||
|
|
||
| ## Properties | ||
|
|
||
| ### The algebra of semigroups is equivalent to the type of semigroups | ||
|
|
||
| ```agda | ||
| module _ | ||
| {l : Level} | ||
| (((set-A , models-A) , satisfies-A) : Algebra-Semigroup l) | ||
| where | ||
|
|
||
| type-Algebra-Semigroup : UU l | ||
| type-Algebra-Semigroup = type-Set set-A | ||
|
|
||
| mul-Algebra-Semigroup : | ||
| type-Algebra-Semigroup → type-Algebra-Semigroup → type-Algebra-Semigroup | ||
| mul-Algebra-Semigroup x y = | ||
| models-A mul-operation-Semigroup (x ∷ y ∷ empty-tuple) | ||
|
|
||
| associative-mul-Algebra-Semigroup : | ||
| (x y z : type-Algebra-Semigroup) → | ||
| mul-Algebra-Semigroup (mul-Algebra-Semigroup x y) z = | ||
| mul-Algebra-Semigroup x (mul-Algebra-Semigroup y z) | ||
| associative-mul-Algebra-Semigroup x y z = | ||
| satisfies-A | ||
| ( associative-mul-law-Semigroup) | ||
| ( component-tuple 3 (z ∷ y ∷ x ∷ empty-tuple)) | ||
|
|
||
| semigroup-Algebra-Semigroup : Semigroup l | ||
| semigroup-Algebra-Semigroup = | ||
| ( set-A , | ||
| mul-Algebra-Semigroup , | ||
| associative-mul-Algebra-Semigroup) | ||
|
|
||
| module _ | ||
| {l : Level} | ||
| (G : Semigroup l) | ||
| where | ||
|
|
||
| is-model-Semigroup : | ||
| is-model-of-signature signature-Semigroup (set-Semigroup G) | ||
| is-model-Semigroup | ||
| mul-operation-Semigroup (x ∷ y ∷ empty-tuple) = | ||
| mul-Semigroup G x y | ||
|
|
||
| model-Semigroup : | ||
| Model-Of-Signature l signature-Semigroup | ||
| model-Semigroup = (set-Semigroup G , is-model-Semigroup) | ||
|
|
||
| is-algebra-model-Semigroup : | ||
| is-algebra-Model-of-Signature | ||
| ( signature-Semigroup) | ||
| ( algebraic-theory-Semigroup) | ||
| ( model-Semigroup) | ||
| is-algebra-model-Semigroup associative-mul-law-Semigroup xs = | ||
| associative-mul-Semigroup G _ _ _ | ||
|
|
||
| algebra-semigroup-Semigroup : Algebra-Semigroup l | ||
| algebra-semigroup-Semigroup = | ||
| ( model-Semigroup , | ||
| is-algebra-model-Semigroup) | ||
|
|
||
| abstract | ||
| is-section-semigroup-Algebra-Semigroup : | ||
| {l : Level} (A : Algebra-Semigroup l) → | ||
| algebra-semigroup-Semigroup (semigroup-Algebra-Semigroup A) = A | ||
| is-section-semigroup-Algebra-Semigroup A = | ||
| eq-type-subtype | ||
| ( is-algebra-prop-Model-Of-Signature | ||
| ( signature-Semigroup) | ||
| ( algebraic-theory-Semigroup)) | ||
| ( eq-pair-eq-fiber | ||
| ( eq-binary-htpy _ _ | ||
| ( λ where | ||
| mul-operation-Semigroup (x ∷ y ∷ empty-tuple) → refl))) | ||
|
|
||
| is-retraction-semigroup-Algebra-Semigroup : | ||
| {l : Level} (G : Semigroup l) → | ||
| semigroup-Algebra-Semigroup (algebra-semigroup-Semigroup G) = G | ||
| is-retraction-semigroup-Algebra-Semigroup G = refl | ||
|
|
||
| is-equiv-semigroup-Algebra-Semigroup : | ||
| {l : Level} → is-equiv (algebra-semigroup-Semigroup {l}) | ||
| is-equiv-semigroup-Algebra-Semigroup = | ||
| is-equiv-is-invertible | ||
| ( semigroup-Algebra-Semigroup) | ||
| ( is-section-semigroup-Algebra-Semigroup) | ||
| ( is-retraction-semigroup-Algebra-Semigroup) | ||
|
|
||
| equiv-semigroup-Algebra-Semigroup : | ||
| {l : Level} → Semigroup l ≃ Algebra-Semigroup l | ||
| equiv-semigroup-Algebra-Semigroup = | ||
| ( algebra-semigroup-Semigroup , | ||
| is-equiv-semigroup-Algebra-Semigroup) | ||
| ``` | ||
|
|
||
| ### Homomorphisms of semigroups are equivalent to homomorphisms of the algebras of semigroups | ||
|
|
||
| ```agda | ||
| hom-Algebra-Semigroup : | ||
| {l1 l2 : Level} → Algebra-Semigroup l1 → Algebra-Semigroup l2 → UU (l1 ⊔ l2) | ||
| hom-Algebra-Semigroup = | ||
| hom-Algebra signature-Semigroup algebraic-theory-Semigroup | ||
|
|
||
| hom-semigroup-hom-Algebra-Semigroup : | ||
| {l1 l2 : Level} (G : Algebra-Semigroup l1) (H : Algebra-Semigroup l2) → | ||
| hom-Algebra-Semigroup G H → | ||
| hom-Semigroup | ||
| ( semigroup-Algebra-Semigroup G) | ||
| ( semigroup-Algebra-Semigroup H) | ||
| hom-semigroup-hom-Algebra-Semigroup G H (map-f , preserves-ops-f) = | ||
| ( map-f , | ||
| preserves-ops-f mul-operation-Semigroup (_ ∷ _ ∷ empty-tuple)) | ||
|
|
||
| module _ | ||
| {l1 l2 : Level} | ||
| (G : Semigroup l1) | ||
| (H : Semigroup l2) | ||
| where | ||
|
|
||
| hom-algebra-semigroup-hom-Semigroup : | ||
| hom-Semigroup G H → | ||
| hom-Algebra-Semigroup | ||
| ( algebra-semigroup-Semigroup G) | ||
| ( algebra-semigroup-Semigroup H) | ||
| hom-algebra-semigroup-hom-Semigroup (map-f , preserves-mul-f) = | ||
| ( map-f , | ||
| λ where | ||
| mul-operation-Semigroup (x ∷ y ∷ empty-tuple) → preserves-mul-f) | ||
|
|
||
| is-equiv-hom-algebra-semigroup-hom-Semigroup : | ||
| is-equiv hom-algebra-semigroup-hom-Semigroup | ||
| is-equiv-hom-algebra-semigroup-hom-Semigroup = | ||
| is-equiv-is-invertible | ||
| ( hom-semigroup-hom-Algebra-Semigroup | ||
| ( algebra-semigroup-Semigroup G) | ||
| ( algebra-semigroup-Semigroup H)) | ||
| ( λ φ → | ||
| eq-htpy-hom-Algebra | ||
| ( signature-Semigroup) | ||
| ( algebraic-theory-Semigroup) | ||
| ( algebra-semigroup-Semigroup G) | ||
| ( algebra-semigroup-Semigroup H) | ||
| ( _) | ||
| ( φ) | ||
| ( refl-htpy)) | ||
| ( λ φ → eq-htpy-hom-Semigroup G H refl-htpy) | ||
|
|
||
| equiv-hom-semigroup-hom-Algebra-Semigroup : | ||
| hom-Semigroup G H ≃ | ||
| hom-Algebra-Semigroup | ||
| ( algebra-semigroup-Semigroup G) | ||
| ( algebra-semigroup-Semigroup H) | ||
| equiv-hom-semigroup-hom-Algebra-Semigroup = | ||
| ( hom-algebra-semigroup-hom-Semigroup , | ||
| is-equiv-hom-algebra-semigroup-hom-Semigroup) | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main thing about this PR is that it attempts to use naming schemas more appropriate to the current patterns in agda-unimath than the preexisting
algebraic-theory-of-groupspage.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that occurs to me, is that when an algebraic theory is the object of definition, then the naming scheme is expected to be
...-Algebraic-TheoryBased on the standard naming scheme, I would expect the algebraic theory of semigroups be called
semigroup-Algebraic-Theoryand other names derived from it, such as:
signature-semigroup-Algebraic-Theorytype-semigroup-Algebraic-Theoryand so on.
I'd be happy to discuss other possibilities too, and hear why you've chosen your scheme before making a final decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My interpretation of the distinction between these naming schemas is that
semigroup-Algebraic-Theoryis meant to parse(disambiguating description)-(result type), andalgebraic-theory-Semigroupis meant to parse(result type)-(Namespace/Object). I think both parsings are relatively common in unimath, though they are rarely so ambiguous. (And reviewing in retrospect -- I could've sworn that the term "namespace" was used to describe functions associated with things we are naming with capital letters, but that doesn't seem actually true; you seem to use it consistently to describe what I'd call "packages.")I admit I'd tend to read
semigroup-Algebraic-Theoryas "the semigroup associated with some particular Algebraic-Theory," though I suppose that's equally nonsensical to the reading ofalgebraic-theory-Semigroupas "the Algebraic-Theory associated with some particular Semigroup."Additionally, the structure of
universal-algebraas currently written doesn't make a signature or an operation part of anAlgebraic-Theory; there is certainly nosignature-Algebraic-Theory. Instead, the signature is a parameter ofAlgebraic-Theory. This makes me substantially less happy to writesignature-semigroup-Algebraic-Theory, so then...what should the signature be called? It could besemigroup-signature, and thensemigroup-operationoroperation-semigroup-signature?I still think the names I have in this PR are more sensical, but I'm more willing to be persuaded after thinking through this comment that at least the thing of type
Algebraic-Theorycould besemigroup-Algebraic-Theory.