-
Notifications
You must be signed in to change notification settings - Fork 248
[Add] Consequences of identity for monoids
#2692
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
jmougeot
wants to merge
52
commits into
agda:master
Choose a base branch
from
jmougeot:monoid-reasoning
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
52 commits
Select commit
Hold shift + click to select a range
0fc076f
Adds reasonig combinator for semigroup
jmougeot 3399c61
Adds reasonig combinator for semigroup
jmougeot 90fe273
Adds reasonig combinator for semigroup
jmougeot ef3282f
Adds reasonig combinator for semigroup
jmougeot 63e88cc
Add some more missing reasoning combinators
jmougeot bb7ce15
add module Extends
jmougeot 885d7a0
rename SemiGroup to Semigroup
jmougeot ad54a5b
fix-whitespace
jmougeot 2b511c2
Update CHANGELOG.md
jmougeot 8151123
New names
jmougeot 2361b40
improve syntx
jmougeot 503c693
fix-whitespace
jmougeot 0d5c9ed
Name changes
jmougeot 1a67eb9
Names change
jmougeot 002cfad
Space
jmougeot a47bcc5
Proof of assoc with PUshes and Pulles
jmougeot ca9f576
Proof of assoc with PUshes and Pulles
jmougeot e07f81b
white space
jmougeot 86b06e0
Update src/Algebra/Properties/Semigroup/Reasoning.agda
jmougeot 7b72ff2
Reasoning to Semigroup and explicit variables
jmougeot 13b5f0e
fix bug
jmougeot f58aceb
space
jmougeot f8ab744
Add reasonining combinators for monoids
jmougeot 4cb6076
chore: move imports around in Algebra.Definitions
jmougeot 6d6a494
Syntax modification
jmougeot 0a36d34
rebase
jmougeot c0ea255
update semigroup
jmougeot b874357
One line proof
jmougeot 6381e8d
move importation
jmougeot ec1030c
fix-whitespace
jmougeot 74607d5
Update src/Algebra/Properties/Semigroup.agda
jmougeot e3b2550
Update CHANGELOG.md
jmougeot e63afbd
Update src/Algebra/Properties/Semigroup.agda
jmougeot b2bfa03
Update src/Algebra/Properties/Semigroup.agda
jmougeot 14224b9
Update src/Algebra/Properties/Semigroup.agda
jmougeot 76b6637
Update src/Algebra/Properties/Semigroup.agda
jmougeot 06af327
Update src/Algebra/Properties/Semigroup.agda
jmougeot a22f97d
variables
jmougeot c9487ef
Add reasonining combinators for monoids
jmougeot f0e0101
chore: move imports around in Algebra.Definitions
jmougeot 9926a29
Syntax modification
jmougeot 11a54eb
rebase
jmougeot f1335e6
update semigroup
jmougeot 821fdf3
One line proof
jmougeot f964914
move importation
jmougeot 08688ea
fix-whitespace
jmougeot 9711485
test
jmougeot a8aa378
explicit varaibles
jmougeot 1c788a0
used of semigroup propreties
jmougeot bbf6645
update
jmougeot 1260c29
Update CHANGELOG.md
JacquesCarette 1ae1e27
Update CHANGELOG.md
JacquesCarette 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Equational reasoning for monoids | ||
-- (Utilities for identity and cancellation reasoning, extending semigroup reasoning) | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
open import Algebra.Bundles using (Monoid) | ||
open import Function using (_∘_) | ||
|
||
module Algebra.Properties.Monoid {o ℓ} (M : Monoid o ℓ) where | ||
|
||
open Monoid M | ||
using (Carrier; _∙_; _≈_; setoid; isMagma; semigroup; ε; sym; identityˡ | ||
; identityʳ ; ∙-cong; refl; assoc; ∙-congˡ; ∙-congʳ; trans) | ||
open import Relation.Binary.Reasoning.Setoid setoid | ||
|
||
open import Algebra.Properties.Semigroup semigroup public | ||
|
||
private | ||
variable | ||
a b c d : Carrier | ||
|
||
id-unique : ∀ a → (∀ b → b ∙ a ≈ b) → a ≈ ε | ||
id-unique a b∙a≈b = trans (sym (identityˡ a)) (b∙a≈b ε) | ||
|
||
id-comm : ∀ a → a ∙ ε ≈ ε ∙ a | ||
id-comm a = trans (identityʳ a) (sym (identityˡ a)) | ||
|
||
id-comm-sym : ∀ a → ε ∙ a ≈ a ∙ ε | ||
id-comm-sym = sym ∘ id-comm | ||
|
||
module _ (a≈ε : a ≈ ε) where | ||
elimʳ : ∀ b → b ∙ a ≈ b | ||
elimʳ = trans (∙-congˡ a≈ε) ∘ identityʳ | ||
|
||
elimˡ : ∀ b → a ∙ b ≈ b | ||
elimˡ = trans (∙-congʳ a≈ε) ∘ identityˡ | ||
|
||
introʳ : ∀ b → b ≈ b ∙ a | ||
introʳ = sym ∘ elimʳ | ||
|
||
introˡ : ∀ b → b ≈ a ∙ b | ||
introˡ = sym ∘ elimˡ | ||
|
||
introcenter : ∀ c → b ∙ c ≈ b ∙ (a ∙ c) | ||
introcenter c = trans (∙-congˡ (sym (identityˡ c))) (∙-congˡ (∙-congʳ (sym a≈ε))) | ||
|
||
module _ (inv : a ∙ c ≈ ε) where | ||
|
||
cancelʳ : ∀ b → (b ∙ a) ∙ c ≈ b | ||
cancelʳ b = trans (assoc b a c) (trans (∙-congˡ inv) (identityʳ b)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm quite sure this can be done in 2 steps via one of the Semigroup combinators. Same for on the left. |
||
|
||
cancelˡ : ∀ b → a ∙ (c ∙ b) ≈ b | ||
cancelˡ b = trans (sym (assoc a c b)) (trans (∙-congʳ inv) (identityˡ b)) | ||
|
||
insertˡ : ∀ b → b ≈ a ∙ (c ∙ b) | ||
insertˡ = sym ∘ cancelˡ | ||
|
||
insertʳ : ∀ b → b ≈ (b ∙ a) ∙ c | ||
insertʳ = sym ∘ cancelʳ | ||
|
||
cancelInner : ∀ b d → (b ∙ a) ∙ (c ∙ d) ≈ b ∙ d | ||
cancelInner b d = trans (uv≈w⇒xu∙vy≈x∙wy inv b d) (∙-congˡ (identityˡ d)) | ||
|
||
insertInner : ∀ b d → b ∙ d ≈ (b ∙ a) ∙ (c ∙ d) | ||
insertInner = λ b d → sym (cancelInner b d) | ||
|
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
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.
Uh oh!
There was an error while loading. Please reload this page.