-
Notifications
You must be signed in to change notification settings - Fork 246
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
[ refactor ] (Re)define (Is)TightApartness
and (Is)HeytingCommutativeRing
/(Is)HeytingField
#2588
Open
jamesmckinna
wants to merge
16
commits into
agda:master
Choose a base branch
from
jamesmckinna:refactor-heyting
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
16 commits
Select commit
Hold shift + click to select a range
d171042
refactor: fix #2587
jamesmckinna d07718c
refactor: properties of `HeytingField`, not `HeytingCommutativeRing`
jamesmckinna 7f2f4af
refactor: give `DecSetoid`s the structure of `(Is)TightApartnessRelat…
jamesmckinna 408433d
fix: unsaved commits
jamesmckinna 92f8248
refactor: move property `x-0≈x` to `Algebra.Properties.AbelianGroup`,…
jamesmckinna 55a7384
refactor: deprecate and tighten `import`s
jamesmckinna 3786f55
fix: `CHANGELOG` plus tidying up
jamesmckinna 5da81d0
Merge branch 'master' into refactor-heyting
jamesmckinna 31b51a6
refactor: resolve merge of #2576
jamesmckinna f891093
refactor: another attempt to resolve merge of #2576
jamesmckinna a8d6284
refactor: re-export from `Relation.Binary.Properties.(Dec)Setoid`
jamesmckinna 1f9a4c1
refactor: tighten re-export from `Relation.Binary.Properties.DecSetoid`
jamesmckinna 48bef4a
refactor: re-export from `apartnessRelation` from `HeytingCommutative…
jamesmckinna cdc57d2
fix: better `CHANGELOG`?
jamesmckinna fb2da3e
fix: one last re-export?
jamesmckinna 8dcb5b6
Merge branch 'agda:master' into refactor-heyting
jamesmckinna 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 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 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 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 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,85 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Properties of Heyting Fields | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
open import Algebra.Apartness.Bundles using (HeytingField) | ||
|
||
module Algebra.Apartness.Properties.HeytingField | ||
{c ℓ₁ ℓ₂} (HF : HeytingField c ℓ₁ ℓ₂) where | ||
|
||
open import Function.Base using (_∘_) | ||
open import Data.Product.Base using (_,_; proj₁; proj₂) | ||
open import Algebra.Bundles using (CommutativeRing) | ||
|
||
open HeytingField HF | ||
open CommutativeRing commutativeRing using (ring; *-commutativeMonoid) | ||
|
||
open import Algebra.Definitions _≈_ | ||
using (Invertible; LeftInvertible; RightInvertible) | ||
open import Algebra.Properties.CommutativeMonoid *-commutativeMonoid | ||
using (invertibleˡ⇒invertible; invertibleʳ⇒invertible) | ||
open import Algebra.Properties.Ring ring | ||
using (x-0#≈x; -‿distribˡ-*; -‿distribʳ-*; -‿anti-homo-+; -‿involutive) | ||
open import Relation.Binary.Definitions using (Symmetric) | ||
import Relation.Binary.Reasoning.Setoid as ≈-Reasoning | ||
|
||
private | ||
variable | ||
x y z : Carrier | ||
|
||
|
||
invertibleˡ⇒# : LeftInvertible 1# _*_ (x - y) → x # y | ||
invertibleˡ⇒# = invertible⇒# ∘ invertibleˡ⇒invertible | ||
|
||
invertibleʳ⇒# : RightInvertible 1# _*_ (x - y) → x # y | ||
invertibleʳ⇒# = invertible⇒# ∘ invertibleʳ⇒invertible | ||
|
||
1#0 : 1# # 0# | ||
1#0 = invertibleˡ⇒# (1# , 1*[x-0]≈x) | ||
where | ||
1*[x-0]≈x : 1# * (x - 0#) ≈ x | ||
1*[x-0]≈x {x} = trans (*-identityˡ (x - 0#)) (x-0#≈x x) | ||
|
||
x#0y#0→xy#0 : x # 0# → y # 0# → x * y # 0# | ||
x#0y#0→xy#0 {x} {y} x#0 y#0 = helper (#⇒invertible x#0) (#⇒invertible y#0) | ||
jamesmckinna marked this conversation as resolved.
Show resolved
Hide resolved
|
||
where | ||
open ≈-Reasoning setoid | ||
|
||
helper : Invertible 1# _*_ (x - 0#) → Invertible 1# _*_ (y - 0#) → x * y # 0# | ||
helper (x⁻¹ , x⁻¹*x≈1 , x*x⁻¹≈1) (y⁻¹ , y⁻¹*y≈1 , y*y⁻¹≈1) | ||
= invertibleˡ⇒# (y⁻¹ * x⁻¹ , y⁻¹*x⁻¹*x*y≈1) | ||
where | ||
|
||
y⁻¹*x⁻¹*x*y≈1 : y⁻¹ * x⁻¹ * (x * y - 0#) ≈ 1# | ||
y⁻¹*x⁻¹*x*y≈1 = begin | ||
y⁻¹ * x⁻¹ * (x * y - 0#) ≈⟨ *-congˡ (x-0#≈x (x * y)) ⟩ | ||
y⁻¹ * x⁻¹ * (x * y) ≈⟨ *-assoc y⁻¹ x⁻¹ (x * y) ⟩ | ||
y⁻¹ * (x⁻¹ * (x * y)) ≈⟨ *-congˡ (*-assoc x⁻¹ x y) ⟨ | ||
y⁻¹ * ((x⁻¹ * x) * y) ≈⟨ *-congˡ (*-congʳ (*-congˡ (x-0#≈x x))) ⟨ | ||
y⁻¹ * ((x⁻¹ * (x - 0#)) * y) ≈⟨ *-congˡ (*-congʳ x⁻¹*x≈1) ⟩ | ||
y⁻¹ * (1# * y) ≈⟨ *-congˡ (*-identityˡ y) ⟩ | ||
y⁻¹ * y ≈⟨ *-congˡ (x-0#≈x y) ⟨ | ||
y⁻¹ * (y - 0#) ≈⟨ y⁻¹*y≈1 ⟩ | ||
1# ∎ | ||
|
||
#-congʳ : x ≈ y → x # z → y # z | ||
#-congʳ {x} {y} {z} x≈y = helper ∘ #⇒invertible | ||
where | ||
open ≈-Reasoning setoid | ||
|
||
helper : Invertible 1# _*_ (x - z) → y # z | ||
helper (x-z⁻¹ , x-z⁻¹*x-z≈1# , x-z*x-z⁻¹≈1#) | ||
= invertibleˡ⇒# (x-z⁻¹ , x-z⁻¹*y-z≈1) | ||
where | ||
x-z⁻¹*y-z≈1 : x-z⁻¹ * (y - z) ≈ 1# | ||
x-z⁻¹*y-z≈1 = begin | ||
x-z⁻¹ * (y - z) ≈⟨ *-congˡ (+-congʳ x≈y) ⟨ | ||
x-z⁻¹ * (x - z) ≈⟨ x-z⁻¹*x-z≈1# ⟩ | ||
1# ∎ | ||
|
||
#-congˡ : y ≈ z → x # y → x # z | ||
#-congˡ y≈z = #-sym ∘ #-congʳ y≈z ∘ #-sym |
This file contains 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 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
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.
I know this is a draft, but in the final version it would be good to explain broadly what the refactorings actually are here?
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.
See latest commits, hopefully enough, but not too much, detail now!