Skip to content
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 ] Exchange components of Relation.Binary.Definitions._Respects₂_ #2515

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Bug-fixes
Non-backwards compatible changes
--------------------------------

* In `Function.Related.TypeIsomorphisms`, the unprimed versions are more level polymorphic; and the primed versions retain `Level` homogeneous types for the `Semiring` axioms to hold.

* In `Data.List.Relation.Binary.Sublist.Propositional.Properties` the implicit module parameters `a` and `A` have been replaced with `variable`s. This should be a backwards compatible change for the overwhelming majority of uses, and would only be non-backwards compatible if you were explicitly supplying these implicit parameters for some reason when importing the module. Explicitly supplying the implicit parameters for functions exported from the module should not be affected.
* In `Function.Related.TypeIsomorphisms`, the unprimed versions are more level polymorphic; and the primed versions retain `Level` homogeneous types for the `Semiring` axioms to hold.
* In `Relation.Binary.Definitions`, the left/right order of the components of `_Respects₂_` have been swapped [issue #2471](https://github.com/agda/agda-stdlib/issues/2471).

Minor improvements
------------------
Expand Down
8 changes: 4 additions & 4 deletions src/Algebra/Properties/Magma/Divisibility.agda
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ open import Algebra.Definitions.RawMagma rawMagma public
∣-respˡ-≈ x≈z (q , qx≈y) = q , trans (∙-congˡ (sym x≈z)) qx≈y

∣-resp-≈ : _∣_ Respects₂ _≈_
∣-resp-≈ = ∣-respʳ-≈ , ∣-respˡ-≈
∣-resp-≈ = ∣-respˡ-≈ , ∣-respʳ-≈

x∣yx : ∀ x y → x ∣ y ∙ x
x∣yx x y = y , refl
Expand All @@ -51,7 +51,7 @@ xy≈z⇒y∣z x y xy≈z = ∣-respʳ-≈ xy≈z (x∣yx y x)
∤-respʳ-≈ x≈y z∤x z∣y = contradiction (∣-respʳ-≈ (sym x≈y) z∣y) z∤x

∤-resp-≈ : _∤_ Respects₂ _≈_
∤-resp-≈ = ∤-respʳ-≈ , ∤-respˡ-≈
∤-resp-≈ = ∤-respˡ-≈ , ∤-respʳ-≈

------------------------------------------------------------------------
-- Properties of mutual divisibility _∣∣_
Expand All @@ -66,7 +66,7 @@ xy≈z⇒y∣z x y xy≈z = ∣-respʳ-≈ xy≈z (x∣yx y x)
∣∣-respʳ-≈ y≈z (x∣y , y∣x) = ∣-respʳ-≈ y≈z x∣y , ∣-respˡ-≈ y≈z y∣x

∣∣-resp-≈ : _∣∣_ Respects₂ _≈_
∣∣-resp-≈ = ∣∣-respʳ-≈ , ∣∣-respˡ-≈
∣∣-resp-≈ = ∣∣-respˡ-≈ , ∣∣-respʳ-≈

------------------------------------------------------------------------
-- Properties of mutual non-divisibility _∤∤_
Expand All @@ -81,7 +81,7 @@ xy≈z⇒y∣z x y xy≈z = ∣-respʳ-≈ xy≈z (x∣yx y x)
∤∤-respʳ-≈ x≈y z∤∤x z∣∣y = contradiction (∣∣-respʳ-≈ (sym x≈y) z∣∣y) z∤∤x

∤∤-resp-≈ : _∤∤_ Respects₂ _≈_
∤∤-resp-≈ = ∤∤-respʳ-≈ , ∤∤-respˡ-≈
∤∤-resp-≈ = ∤∤-respˡ-≈ , ∤∤-respʳ-≈


------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Bool/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ false <? true = yes f<t
true <? _ = no (λ())

<-resp₂-≡ : _<_ Respects₂ _≡_
<-resp₂-≡ = subst (_ <_) , subst (_< _)
<-resp₂-≡ = subst (_< _) , subst (_ <_)

<-irrelevant : Irrelevant _<_
<-irrelevant f<t f<t = refl
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Char/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ _<?_ = On.decidable toℕ ℕ._<_ ℕ._<?_
{ isEquivalence = ≡.isEquivalence
; irrefl = <-irrefl
; trans = λ {a} {b} {c} → <-trans {a} {b} {c}
; <-resp-≈ = (λ {c} → ≡.subst (c <_))
, (λ {c} → ≡.subst (_< c))
; <-resp-≈ = (λ {c} → ≡.subst (_< c))
, (λ {c} → ≡.subst (c <_))
}

<-isStrictTotalOrder : IsStrictTotalOrder _≡_ _<_
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Fin/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ m <? n = suc (toℕ m) ℕ.≤? toℕ n
<-respʳ-≡ refl x≤y = x≤y

<-resp₂-≡ : (_<_ {n}) Respects₂ _≡_
<-resp₂-≡ = <-respʳ-≡ , <-respˡ-≡
<-resp₂-≡ = <-respˡ-≡ , <-respʳ-≡

<-irrelevant : Irrelevant (_<_ {m} {n})
<-irrelevant = ℕ.<-irrelevant
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Integer/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ _<?_ : Decidable _<_
{ isEquivalence = isEquivalence
; irrefl = <-irrefl
; trans = <-trans
; <-resp-≈ = subst (_ <_) , subst (_< _)
; <-resp-≈ = subst (_< _) , subst (_ <_)
}

<-isStrictTotalOrder : IsStrictTotalOrder _≡_ _<_
Expand Down
32 changes: 16 additions & 16 deletions src/Data/List/Relation/Binary/Lex.agda
Original file line number Diff line number Diff line change
Expand Up @@ -68,36 +68,36 @@ module _ {a ℓ₁ ℓ₂} {A : Set a} {P : Set}

transitive : IsEquivalence _≈_ → _≺_ Respects₂ _≈_ → Transitive _≺_ →
Transitive _<_
transitive eq resp tr = trans
transitive eq resp@(respˡ , respʳ) tr = trans
where
trans : Transitive (Lex P _≈_ _≺_)
trans (base p) (base _) = base p
trans (base y) halt = halt
trans halt (this y≺z) = halt
trans halt (next y≈z ys<zs) = halt
trans (this x≺y) (this y≺z) = this (tr x≺y y≺z)
trans (this x≺y) (next y≈z ys<zs) = this (proj₁ resp y≈z x≺y)
trans (this x≺y) (next y≈z ys<zs) = this (respʳ y≈z x≺y)
trans (next x≈y xs<ys) (this y≺z) =
this (proj₂ resp (IsEquivalence.sym eq x≈y) y≺z)
this (respˡ (IsEquivalence.sym eq x≈y) y≺z)
trans (next x≈y xs<ys) (next y≈z ys<zs) =
next (IsEquivalence.trans eq x≈y y≈z) (trans xs<ys ys<zs)

respects₂ : IsEquivalence _≈_ → _≺_ Respects₂ _≈_ → _<_ Respects₂ _≋_
respects₂ eq (resp₁ , resp₂) = resp¹ , resp²
respects₂ eq (respˡ , respʳ) = respₗ , respᵣ
where
open IsEquivalence eq using (sym; trans)
resp¹ : ∀ {xs} → Lex P _≈_ _≺_ xs Respects _≋_
resp¹ [] xs<[] = xs<[]
resp¹ (_ ∷ _) halt = halt
resp¹ (x≈y ∷ _) (this z≺x) = this (resp₁ x≈y z≺x)
resp¹ (x≈y ∷ xs≋ys) (next z≈x zs<xs) =
next (trans z≈x x≈y) (resp¹ xs≋ys zs<xs)

resp² : ∀ {ys} → flip (Lex P _≈_ _≺_) ys Respects _≋_
resp² [] []<ys = []<ys
resp² (x≈z ∷ _) (this x≺y) = this (resp₂ x≈z x≺y)
resp² (x≈z ∷ xs≋zs) (next x≈y xs<ys) =
next (trans (sym x≈z) x≈y) (resp² xs≋zs xs<ys)
respᵣ : ∀ {xs} → Lex P _≈_ _≺_ xs Respects _≋_
respᵣ [] xs<[] = xs<[]
respᵣ (_ ∷ _) halt = halt
respᵣ (x≈y ∷ _) (this z≺x) = this (respʳ x≈y z≺x)
respᵣ (x≈y ∷ xs≋ys) (next z≈x zs<xs) =
next (trans z≈x x≈y) (respᵣ xs≋ys zs<xs)

respₗ : ∀ {ys} → flip (Lex P _≈_ _≺_) ys Respects _≋_
respₗ [] []<ys = []<ys
respₗ (x≈z ∷ _) (this x≺y) = this (respˡ x≈z x≺y)
respₗ (x≈z ∷ xs≋zs) (next x≈y xs<ys) =
next (trans (sym x≈z) x≈y) (respₗ xs≋zs xs<ys)


[]<[]-⇔ : P ⇔ [] < []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ Any-resp-↭ resp (trans p₁ p₂) pxs = Any-resp-↭ resp p₂

AllPairs-resp-↭ : Symmetric R → R Respects₂ _≈_ → (AllPairs R) Respects _↭_
AllPairs-resp-↭ sym resp (refl xs≋ys) pxs = AllPairs-resp-≋ resp xs≋ys pxs
AllPairs-resp-↭ sym resp (prep x≈y p) (∼ ∷ pxs) =
All-resp-↭ (proj₁ resp) p (All.map (proj₂ resp x≈y) ∼) ∷
AllPairs-resp-↭ sym resp@(rˡ , rʳ) (prep x≈y p) (∼ ∷ pxs) =
All-resp-↭ p (All.map ( x≈y) ∼) ∷
AllPairs-resp-↭ sym resp p pxs
AllPairs-resp-↭ sym resp@( , ) (swap eq₁ eq₂ p) ((∼₁ ∷ ∼₂) ∷ ∼₃ ∷ pxs) =
(sym ( eq₂ (rˡ eq ∼₁)) ∷ All-resp-↭ rʳ p (All.map (rˡ eq₂) ∼₃)) ∷
AllPairs-resp-↭ sym resp@( , ) (swap eq₁ eq₂ p) ((∼₁ ∷ ∼₂) ∷ ∼₃ ∷ pxs) =
(sym ( eq₁ (rʳ eq ∼₁)) ∷ All-resp-↭ rʳ p (All.map (rˡ eq₂) ∼₃)) ∷
All-resp-↭ rʳ p (All.map (rˡ eq₁) ∼₂) ∷
AllPairs-resp-↭ sym resp p pxs
AllPairs-resp-↭ sym resp (trans p₁ p₂) pxs =
Expand Down
4 changes: 2 additions & 2 deletions src/Data/List/Relation/Binary/Pointwise.agda
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ Any-resp-Pointwise resp (x∼y ∷ xs) (there pxs) =
AllPairs-resp-Pointwise : R Respects₂ S →
(AllPairs R) Respects (Pointwise S)
AllPairs-resp-Pointwise _ [] [] = []
AllPairs-resp-Pointwise resp@(respₗ , respᵣ) (x∼y ∷ xs) (px ∷ pxs) =
All-resp-Pointwise respₗ xs (All.map (respᵣ x∼y) px) ∷
AllPairs-resp-Pointwise resp@(respˡ , respʳ) (x∼y ∷ xs) (px ∷ pxs) =
All-resp-Pointwise respʳ xs (All.map (respˡ x∼y) px) ∷
(AllPairs-resp-Pointwise resp xs pxs)

------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Data/List/Relation/Binary/Pointwise/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ respˡ resp [] [] = []
respˡ resp (x≈y ∷ xs≈ys) (x∼z ∷ xs∼zs) = resp x≈y x∼z ∷ respˡ resp xs≈ys xs∼zs

respects₂ : R Respects₂ S → (Pointwise R) Respects₂ (Pointwise S)
respects₂ ( , ) = respʳ rʳ , respˡ rˡ
respects₂ ( , ) = respˡ rˡ , respʳ rʳ

decidable : Decidable R → Decidable (Pointwise R)
decidable _ [] [] = yes []
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Nat/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ _>?_ = flip _<?_
<-irrelevant = ≤-irrelevant

<-resp₂-≡ : _<_ Respects₂ _≡_
<-resp₂-≡ = subst (_ <_) , subst (_< _)
<-resp₂-≡ = subst (_< _) , subst (_ <_)

------------------------------------------------------------------------
-- Bundles
Expand Down
10 changes: 5 additions & 5 deletions src/Data/Product/Relation/Binary/Lex/Strict.agda
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ module _ {_≈₁_ : Rel A ℓ₁} {_<₁_ : Rel A ℓ₂} {_<₂_ : Rel B ℓ

×-transitive : IsEquivalence _≈₁_ → _<₁_ Respects₂ _≈₁_ → Transitive _<₁_ →
Transitive _<₂_ → Transitive _<ₗₑₓ_
×-transitive eq₁ resp₁ trans₁ trans₂ = trans
×-transitive eq₁ resp₁@(respˡ , respʳ) trans₁ trans₂ = trans
where
module Eq₁ = IsEquivalence eq₁

trans : Transitive _<ₗₑₓ_
trans (inj₁ x₁<y₁) (inj₁ y₁<z₁) = inj₁ (trans₁ x₁<y₁ y₁<z₁)
trans (inj₁ x₁<y₁) (inj₂ y≈≤z) =
inj₁ (proj₁ resp₁ (proj₁ y≈≤z) x₁<y₁)
inj₁ (respʳ (proj₁ y≈≤z) x₁<y₁)
trans (inj₂ x≈≤y) (inj₁ y₁<z₁) =
inj₁ (proj₂ resp₁ (Eq₁.sym $ proj₁ x≈≤y) y₁<z₁)
inj₁ (respˡ (Eq₁.sym $ proj₁ x≈≤y) y₁<z₁)
trans (inj₂ x≈≤y) (inj₂ y≈≤z) =
inj₂ ( Eq₁.trans (proj₁ x≈≤y) (proj₁ y≈≤z)
, trans₂ (proj₂ x≈≤y) (proj₂ y≈≤z))
Expand Down Expand Up @@ -157,8 +157,8 @@ module _ {_≈₁_ : Rel A ℓ₁} {_<₁_ : Rel A ℓ₂}
×-respects₂ : IsEquivalence _≈₁_ →
_<₁_ Respects₂ _≈₁_ → _<₂_ Respects₂ _≈₂_ →
_<ₗₑₓ_ Respects₂ _≋_
×-respects₂ eq₁ resp₁ resp₂ = ×-respectsʳ trans (proj₁ resp₁) (proj₁ resp₂)
, ×-respectsˡ sym trans (proj₂ resp₁) (proj₂ resp₂)
×-respects₂ eq₁ resp₁ resp₂ = ×-respectsˡ sym trans (proj₁ resp₁) (proj₁ resp₂)
, ×-respectsʳ trans (proj₂ resp₁) (proj₂ resp₂)
where open IsEquivalence eq₁

×-compare : Symmetric _≈₁_ →
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Rational/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ _>?_ = flip _<?_
<-respˡ-≡ = subst (_< _)

<-resp-≡ : _<_ Respects₂ _≡_
<-resp-≡ = <-respʳ-≡ , <-respˡ-≡
<-resp-≡ = <-respˡ-≡ , <-respʳ-≡

------------------------------------------------------------------------
-- Structures
Expand Down
6 changes: 3 additions & 3 deletions src/Data/Rational/Unnormalised/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ drop-*≤* (*≤* pq≤qp) = pq≤qp
≤-respʳ-≃ x≈y z≤x = ≤-trans z≤x (≤-reflexive x≈y)

≤-resp₂-≃ : _≤_ Respects₂ _≃_
≤-resp₂-≃ = ≤-respʳ-≃ , ≤-respˡ-≃
≤-resp₂-≃ = ≤-respˡ-≃ , ≤-respʳ-≃

infix 4 _≤?_ _≥?_

Expand Down Expand Up @@ -532,7 +532,7 @@ _>?_ = flip _<?_
$ neg-mono-< (<-respʳ-≃ (-‿cong q≃r) (neg-mono-< q<p))

<-resp-≃ : _<_ Respects₂ _≃_
<-resp-≃ = <-respʳ-≃ , <-respˡ-≃
<-resp-≃ = <-respˡ-≃ , <-respʳ-≃

------------------------------------------------------------------------
-- Structures
Expand All @@ -542,7 +542,7 @@ _>?_ = flip _<?_
{ isEquivalence = isEquivalence
; irrefl = <-irrefl-≡
; trans = <-trans
; <-resp-≈ = subst (_ <_) , subst (_< _)
; <-resp-≈ = subst (_< _) , subst (_ <_)
}

<-isStrictPartialOrder : IsStrictPartialOrder _≃_ _<_
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Sum/Relation/Binary/LeftOrder.agda
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module _ {a₁ a₂} {A₁ : Set a₁} {A₂ : Set a₂}

⊎-<-respects₂ : ∼₁ Respects₂ ≈₁ → ∼₂ Respects₂ ≈₂ →
(∼₁ ⊎-< ∼₂) Respects₂ (Pointwise ≈₁ ≈₂)
⊎-<-respects₂ (r₁ , l₁) (r₂ , l₂) = ⊎-<-respectsʳ r₁ r₂ , ⊎-<-respectsˡ l₁ l
⊎-<-respects₂ (l₁ , r₁) (l₂ , r₂) = ⊎-<-respectsˡ l₁ l₂ , ⊎-<-respectsʳ r₁ r

⊎-<-trichotomous : Trichotomous ≈₁ ∼₁ → Trichotomous ≈₂ ∼₂ →
Trichotomous (Pointwise ≈₁ ≈₂) (∼₁ ⊎-< ∼₂)
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Sum/Relation/Binary/Pointwise.agda
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ drop-inj₂ (inj₂ x) = x

⊎-respects₂ : R Respects₂ ≈₁ → S Respects₂ ≈₂ →
(Pointwise R S) Respects₂ (Pointwise ≈₁ ≈₂)
⊎-respects₂ (r₁ , l₁) (r₂ , l₂) = ⊎-respectsʳ r₁ r₂ , ⊎-respectsˡ l₁ l
⊎-respects₂ (l₁ , r₁) (l₂ , r₂) = ⊎-respectsˡ l₁ l₂ , ⊎-respectsʳ r₁ r

------------------------------------------------------------------------
-- Structures
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Vec/Relation/Binary/Lex/Core.agda
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module _ {P : Set} {_≈_ : Rel A ℓ₁} {_≺_ : Rel A ℓ₂} where
∷<∷-⇔ = mk⇔ [ flip this refl , uncurry next ] toSum

module _ (≈-equiv : IsPartialEquivalence _≈_)
((≺-respʳ-≈ , ≺-respˡ-≈) : _≺_ Respects₂ _≈_)
((≺-respˡ-≈ , ≺-respʳ-≈) : _≺_ Respects₂ _≈_)
(≺-trans : Transitive _≺_)
(open IsPartialEquivalence ≈-equiv)
where
Expand Down Expand Up @@ -131,7 +131,7 @@ module _ {P : Set} {_≈_ : Rel A ℓ₁} {_≺_ : Rel A ℓ₂} where
respectsʳ resp (x≈y ∷ xs≋ys) (next x≈z xs<zs) = next (trans x≈z x≈y) (respectsʳ resp xs≋ys xs<zs)

respects₂ : _≺_ Respects₂ _≈_ → ∀ {n} → (_<ₗₑₓ_ {n} {n}) Respects₂ _≋_
respects₂ (≺-resp-≈ʳ , ≺-resp-≈ˡ) = respectsʳ ≺-resp-≈ʳ , respectsˡ ≺-resp-≈ˡ
respects₂ (≺-resp-≈ˡ , ≺-resp-≈ʳ) = respectsˡ ≺-resp-≈ˡ , respectsʳ ≺-resp-≈ʳ

module _ (P? : Dec P) (_≈?_ : Decidable _≈_) (_≺?_ : Decidable _≺_) where

Expand Down
10 changes: 5 additions & 5 deletions src/Relation/Binary/Consequences.agda
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module _ {_∼_ : Rel A ℓ} (R : Rel A p) where
subst⇒respʳ subst {x} y′∼y Pxy′ = subst (R x) y′∼y Pxy′

subst⇒resp₂ : Substitutive _∼_ p → R Respects₂ _∼_
subst⇒resp₂ subst = subst⇒respʳ subst , subst⇒respˡ subst
subst⇒resp₂ subst = subst⇒respˡ subst , subst⇒respʳ subst

module _ {_∼_ : Rel A ℓ} {P : Pred A p} where

Expand Down Expand Up @@ -74,7 +74,7 @@ module _ {_≈_ : Rel A ℓ₁} {_≤_ : Rel A ℓ₂} where

total⇒refl : _≤_ Respects₂ _≈_ → Symmetric _≈_ →
Total _≤_ → _≈_ ⇒ _≤_
total⇒refl (respʳ , respˡ) sym total {x} {y} x≈y with total x y
total⇒refl (respˡ , respʳ) sym total {x} {y} x≈y with total x y
... | inj₁ x∼y = x∼y
... | inj₂ y∼x = respʳ x≈y (respˡ (sym x≈y) y∼x)

Expand Down Expand Up @@ -125,7 +125,7 @@ module _ {_≈_ : Rel A ℓ₁} {_<_ : Rel A ℓ₂} where

asym⇒irr : _<_ Respects₂ _≈_ → Symmetric _≈_ →
Asymmetric _<_ → Irreflexive _≈_ _<_
asym⇒irr (respʳ , respˡ) sym asym {x} {y} x≈y x<y =
asym⇒irr (respˡ , respʳ) sym asym {x} {y} x≈y x<y =
asym x<y (respʳ (sym x≈y) (respˡ x≈y x<y))

tri⇒asym : Trichotomous _≈_ _<_ → Asymmetric _<_
Expand Down Expand Up @@ -172,8 +172,8 @@ module _ {_≈_ : Rel A ℓ₁} {_<_ : Rel A ℓ₂} where
Transitive _<_ → Trichotomous _≈_ _<_ →
_<_ Respects₂ _≈_
trans∧tri⇒resp sym ≈-tr <-tr tri =
trans∧tri⇒respʳ sym ≈-tr <-tr tri ,
trans∧tri⇒respˡ ≈-tr <-tr tri
trans∧tri⇒respˡ ≈-tr <-tr tri ,
trans∧tri⇒respʳ sym ≈-tr <-tr tri

------------------------------------------------------------------------
-- Without Loss of Generality
Expand Down
4 changes: 2 additions & 2 deletions src/Relation/Binary/Construct/Add/Infimum/Strict.agda
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module _ {r} {_≤_ : Rel A r} where
<₋-respʳ-≡ = subst (_ <₋_)

<₋-resp-≡ : _<₋_ Respects₂ _≡_
<₋-resp-≡ = <₋-respʳ-≡ , <₋-respˡ-≡
<₋-resp-≡ = <₋-respˡ-≡ , <₋-respʳ-≡

------------------------------------------------------------------------
-- Relational properties + setoid equality
Expand Down Expand Up @@ -127,7 +127,7 @@ module _ {e} {_≈_ : Rel A e} where
<₋-respʳ-≈₋ <-respʳ-≈ [ p ] [ q ] = [ <-respʳ-≈ p q ]

<₋-resp-≈₋ : _<_ Respects₂ _≈_ → _<₋_ Respects₂ _≈₋_
<₋-resp-≈₋ = map <₋-respʳ-≈₋ <₋-respˡ-≈₋
<₋-resp-≈₋ = map <₋-respˡ-≈₋ <₋-respʳ-≈₋

------------------------------------------------------------------------
-- Structures + propositional equality
Expand Down
4 changes: 2 additions & 2 deletions src/Relation/Binary/Construct/Add/Supremum/Strict.agda
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module _ {r} {_≤_ : Rel A r} where
<⁺-respʳ-≡ = subst (_ <⁺_)

<⁺-resp-≡ : _<⁺_ Respects₂ _≡_
<⁺-resp-≡ = <⁺-respʳ-≡ , <⁺-respˡ-≡
<⁺-resp-≡ = <⁺-respˡ-≡ , <⁺-respʳ-≡

------------------------------------------------------------------------
-- Relational properties + setoid equality
Expand Down Expand Up @@ -128,7 +128,7 @@ module _ {e} {_≈_ : Rel A e} where
<⁺-respʳ-≈⁺ <-respʳ-≈ ⊤⁺≈⊤⁺ q = q

<⁺-resp-≈⁺ : _<_ Respects₂ _≈_ → _<⁺_ Respects₂ _≈⁺_
<⁺-resp-≈⁺ = map <⁺-respʳ-≈⁺ <⁺-respˡ-≈⁺
<⁺-resp-≈⁺ = map <⁺-respˡ-≈⁺ <⁺-respʳ-≈⁺

------------------------------------------------------------------------
-- Structures + propositional equality
Expand Down
2 changes: 1 addition & 1 deletion src/Relation/Binary/Construct/Composition.agda
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module _ {≈ : Rel C ℓ} (L : REL A B ℓ₁) (R : REL B C ℓ₂) where
module _ {≈ : Rel A ℓ} (L : REL A B ℓ₁) (R : REL B A ℓ₂) where

respects₂ : L Respectsˡ ≈ → R Respectsʳ ≈ → (L ; R) Respects₂ ≈
respects₂ Lˡ Rʳ = respectsʳ L R , respectsˡ L R
respects₂ Lˡ Rʳ = respectsˡ L R , respectsʳ L R

module _ {≈ : REL A B ℓ} (L : REL A B ℓ₁) (R : Rel B ℓ₂) where

Expand Down
2 changes: 1 addition & 1 deletion src/Relation/Binary/Construct/Intersection.agda
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module _ (≈ : Rel A ℓ₁) (L : Rel A ℓ₂) (R : Rel A ℓ₃) where
respectsʳ L-resp R-resp x≈y = map (L-resp x≈y) (R-resp x≈y)

respects₂ : L Respects₂ ≈ → R Respects₂ ≈ → (L ∩ R) Respects₂ ≈
respects₂ ( , ) ( , ) = respectsʳ Lʳ Rʳ , respectsˡ Lˡ Rˡ
respects₂ ( , ) ( , ) = respectsˡ Lˡ Rˡ , respectsʳ Lʳ Rʳ

antisymmetric : Antisymmetric ≈ L ⊎ Antisymmetric ≈ R → Antisymmetric ≈ (L ∩ R)
antisymmetric (inj₁ L-antisym) (Lxy , _) (Lyx , _) = L-antisym Lxy Lyx
Expand Down
2 changes: 1 addition & 1 deletion src/Relation/Binary/Construct/NaturalOrder/Left.agda
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ respˡ magma {x} {y} {z} y≈z y≤x = begin
where open module M = IsMagma magma; open ≈-Reasoning M.setoid

resp₂ : IsMagma _∙_ → _≤_ Respects₂ _≈_
resp₂ magma = respʳ magma , respˡ magma
resp₂ magma = respˡ magma , respʳ magma

dec : Decidable _≈_ → Decidable _≤_
dec _≟_ x y = x ≟ (x ∙ y)
Expand Down
2 changes: 1 addition & 1 deletion src/Relation/Binary/Construct/NaturalOrder/Right.agda
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ respˡ magma {x} {y} {z} y≈z y≤x = begin
where open module M = IsMagma magma; open ≈-Reasoning M.setoid

resp₂ : IsMagma _∙_ → _≤_ Respects₂ _≈_
resp₂ magma = respʳ magma , respˡ magma
resp₂ magma = respˡ magma , respʳ magma

dec : Decidable _≈_ → Decidable _≤_
dec _≟_ x y = x ≟ (y ∙ x)
Expand Down
Loading
Loading