-
Notifications
You must be signed in to change notification settings - Fork 250
[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
41
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
41 commits
Select commit
Hold shift + click to select a range
4828f10
Adds reasonig combinator for semigroup
jmougeot 93c9976
Adds reasonig combinator for semigroup
jmougeot e885711
Adds reasonig combinator for semigroup
jmougeot 3c38b3c
Adds reasonig combinator for semigroup
jmougeot cd399f7
Add some more missing reasoning combinators
jmougeot 3f79f75
add module Extends
jmougeot 6b9e442
rename SemiGroup to Semigroup
jmougeot a3a3181
fix-whitespace
jmougeot f8c8533
Update CHANGELOG.md
jmougeot 19ec1eb
New names
jmougeot 52eaa44
improve syntx
jmougeot ee3ac5d
fix-whitespace
jmougeot 5d47f4c
Name changes
jmougeot f4c1245
Names change
jmougeot 9f0a376
Space
jmougeot 3a8d81f
Proof of assoc with PUshes and Pulles
jmougeot 1c13577
Proof of assoc with PUshes and Pulles
jmougeot 79311ae
white space
jmougeot cc934ca
Update src/Algebra/Properties/Semigroup/Reasoning.agda
jmougeot 17a8964
Reasoning to Semigroup and explicit variables
jmougeot 899099c
Update CHANGELOG.md
jmougeot 4129eed
Add reasonining combinators for monoids
jmougeot 0ab87a6
chore: move imports around in Algebra.Definitions
jmougeot 8eb8a69
Syntax modification
jmougeot fbf8920
rebase
jmougeot eb543a8
update semigroup
jmougeot b742f6f
One line proof
jmougeot 08d797c
move importation
jmougeot 490a28c
fix-whitespace
jmougeot a34b4b5
Add reasonining combinators for monoids
jmougeot 41696ed
chore: move imports around in Algebra.Definitions
jmougeot ff966fe
Syntax modification
jmougeot 3cbb91b
rebase
jmougeot 29b22d6
move importation
jmougeot 7cd4230
fix-whitespace
jmougeot acb6467
explicit varaibles
jmougeot 4b38e08
used of semigroup propreties
jmougeot 64d12ad
update
jmougeot b0179f5
Update CHANGELOG.md
JacquesCarette dab0763
merge and proof refactoring
jmougeot 7185d5f
Changelog update
jmougeot 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
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 (uv≈w⇒xu∙v≈xw inv b) (identityʳ b) | ||
|
||
cancelˡ : ∀ b → a ∙ (c ∙ b) ≈ b | ||
cancelˡ b = trans (uv≈w⇒u∙vx≈wx inv b) (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) | ||
|
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.