Skip to content

Rename overloaded sym in apartness #2576

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 8 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Highlights
Bug-fixes
---------

* In `Algebra.Apartness.Structures`, renamed `sym` from `IsApartnessRelation`
to `#-sym` in order to avoid overloaded projection.
`irrefl` and `cotrans` are similarly renamed for the sake of consistency.

Non-backwards compatible changes
--------------------------------

Expand Down
24 changes: 0 additions & 24 deletions src/Algebra/Apartness/Properties/HeytingCommutativeRing.agda
Original file line number Diff line number Diff line change
Expand Up @@ -64,30 +64,6 @@ x#0y#0→xy#0 {x} {y} x#0 y#0 = helper (#⇒invertible x#0) (#⇒invertible y#0)
y⁻¹ * (y - 0#) ≈⟨ y⁻¹*y≈1 ⟩
1# ∎

#-sym : Symmetric _#_
#-sym {x} {y} x#y = invertibleˡ⇒# (- x-y⁻¹ , x-y⁻¹*y-x≈1)
where
open ≈-Reasoning setoid
InvX-Y : Invertible _≈_ 1# _*_ (x - y)
InvX-Y = #⇒invertible x#y

x-y⁻¹ = InvX-Y .proj₁

y-x≈-[x-y] : y - x ≈ - (x - y)
y-x≈-[x-y] = begin
y - x ≈⟨ +-congʳ (-‿involutive y) ⟨
- - y - x ≈⟨ -‿anti-homo-+ x (- y) ⟨
- (x - y) ∎

x-y⁻¹*y-x≈1 : (- x-y⁻¹) * (y - x) ≈ 1#
x-y⁻¹*y-x≈1 = begin
(- x-y⁻¹) * (y - x) ≈⟨ -‿distribˡ-* x-y⁻¹ (y - x) ⟨
- (x-y⁻¹ * (y - x)) ≈⟨ -‿cong (*-congˡ y-x≈-[x-y]) ⟩
- (x-y⁻¹ * - (x - y)) ≈⟨ -‿cong (-‿distribʳ-* x-y⁻¹ (x - y)) ⟨
- - (x-y⁻¹ * (x - y)) ≈⟨ -‿involutive (x-y⁻¹ * ((x - y))) ⟩
x-y⁻¹ * (x - y) ≈⟨ InvX-Y .proj₂ .proj₁ ⟩
1# ∎

#-congʳ : x ≈ y → x # z → y # z
#-congʳ {x} {y} {z} x≈y x#z = helper (#⇒invertible x#z)
where
Expand Down
5 changes: 5 additions & 0 deletions src/Algebra/Apartness/Structures.agda
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ record IsHeytingCommutativeRing : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where

open IsCommutativeRing isCommutativeRing public
open IsApartnessRelation isApartnessRelation public
renaming
( irrefl to #-irrefl
; sym to #-sym
; cotrans to #-cotrans
)

field
#⇒invertible : ∀ {x y} → x # y → Invertible 1# _*_ (x - y)
Expand Down