Skip to content

Commit 7cda0de

Browse files
committed
[ refactor ] do not add irrefl as a parameter to Triple
1 parent 5eb0248 commit 7cda0de

File tree

9 files changed

+46
-21
lines changed

9 files changed

+46
-21
lines changed

src/Data/Integer/Properties.agda

+5-3
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,17 @@ n≮n {n} = <-irrefl refl
330330
module ≤-Reasoning where
331331
open import Relation.Binary.Reasoning.Base.Triple
332332
≤-isPreorder
333-
<-irrefl
334333
<-trans
335334
(resp₂ _<_)
336335
<⇒≤
337336
<-≤-trans
338337
≤-<-trans
338+
as Reasoning
339339
public
340-
hiding (step-≈; step-≈˘)
340+
hiding (begin-irrefl; step-≈; step-≈˘)
341+
342+
infix 1 begin-irrefl_
343+
begin-irrefl_ = Reasoning.begin-irrefl <-irrefl
341344

342345
------------------------------------------------------------------------
343346
-- Properties of Positive/NonPositive/Negative/NonNegative and _≤_/_<_
@@ -2601,4 +2604,3 @@ Please use *-cancelˡ-<-nonNeg instead."
26012604
"Warning: *-cancelʳ-<-non-neg was deprecated in v1.5.
26022605
Please use *-cancelʳ-<-nonNeg instead."
26032606
#-}
2604-

src/Data/List/Relation/Unary/Any/Properties.agda

-2
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ Any-×⁻ pq with Prod.map₂ (Prod.map₂ find) (find pq)
254254
≡⟨ P.cong₂ _,_ (lose∘find p) (lose∘find q) ⟩
255255

256256
(p , q) ∎
257-
where
258-
259257

260258
to∘from : pq Any-×⁺ {xs = xs} (Any-×⁻ pq) ≡ pq
261259
to∘from pq

src/Data/Nat/Properties.agda

+5-2
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,17 @@ m<n⇒m≤1+n (s≤s (s≤s m<n)) = s≤s (m<n⇒m≤1+n (s≤s m<n))
421421
module ≤-Reasoning where
422422
open import Relation.Binary.Reasoning.Base.Triple
423423
≤-isPreorder
424-
<-irrefl
425424
<-trans
426425
(resp₂ _<_)
427426
<⇒≤
428427
<-transˡ
429428
<-transʳ
429+
as Reasoning
430430
public
431-
hiding (step-≈; step-≈˘)
431+
hiding (begin-irrefl; step-≈; step-≈˘)
432+
433+
infix 1 begin-irrefl_
434+
begin-irrefl_ = Reasoning.begin-irrefl <-irrefl
432435

433436
open ≤-Reasoning
434437

src/Data/Rational/Properties.agda

+5-2
Original file line numberDiff line numberDiff line change
@@ -433,14 +433,17 @@ p <? q = Dec.map′ *<* drop-*<* ((↥ p ℤ.* ↧ q) ℤ.<? (↥ q ℤ.* ↧ p)
433433
module ≤-Reasoning where
434434
open import Relation.Binary.Reasoning.Base.Triple
435435
≤-isPreorder
436-
<-irrefl
437436
<-trans
438437
(resp₂ _<_)
439438
<⇒≤
440439
<-≤-trans
441440
≤-<-trans
441+
as Reasoning
442442
public
443-
hiding (step-≈; step-≈˘)
443+
hiding (begin-irrefl; step-≈; step-≈˘)
444+
445+
infix 1 begin-irrefl_
446+
begin-irrefl_ = Reasoning.begin-irrefl <-irrefl
444447

445448
------------------------------------------------------------------------
446449
-- Properties of _/_

src/Data/Rational/Unnormalised/Properties.agda

+5-1
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,17 @@ p <? q = Dec.map′ *<* drop-*<* (↥ p ℤ.* ↧ q ℤ.<? ↥ q ℤ.* ↧ p)
393393
module ≤-Reasoning where
394394
open import Relation.Binary.Reasoning.Base.Triple
395395
≤-isPreorder
396-
<-irrefl
397396
<-trans
398397
<-resp-≃
399398
<⇒≤
400399
<-≤-trans
401400
≤-<-trans
401+
as Reasoning
402402
public
403+
hiding (begin-irrefl)
404+
405+
infix 1 begin-irrefl_
406+
begin-irrefl_ = Reasoning.begin-irrefl <-irrefl
403407

404408
------------------------------------------------------------------------
405409
-- Properties of ↥_/↧_

src/Data/Tree/AVL/Indexed/Relation/Unary/Any/Properties.agda

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ open StrictTotalOrder sto renaming (Carrier to Key); open Eq using (_≉_; sym;
3030

3131
import Relation.Binary.Reasoning.StrictPartialOrder as <-Reasoning
3232

33-
3433
private
3534
variable
3635
v p q : Level

src/Relation/Binary/Reasoning/Base/Triple.agda

+14-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ open import Relation.Binary
1515
module Relation.Binary.Reasoning.Base.Triple {a ℓ₁ ℓ₂ ℓ₃} {A : Set a}
1616
{_≈_ : Rel A ℓ₁} {_≤_ : Rel A ℓ₂} {_<_ : Rel A ℓ₃}
1717
(isPreorder : IsPreorder _≈_ _≤_)
18-
(<-irrefl : Irreflexive _≈_ _<_)
1918
(<-trans : Transitive _<_) (<-resp-≈ : _<_ Respects₂ _≈_) (<⇒≤ : _<_ ⇒ _≤_)
2019
(<-≤-trans : Trans _<_ _≤_ _<_) (≤-<-trans : Trans _≤_ _<_ _<_)
2120
where
@@ -25,7 +24,7 @@ open import Function.Base using (case_of_; id)
2524
open import Level using (Level; _⊔_; Lift; lift)
2625
open import Relation.Binary.PropositionalEquality.Core
2726
using (_≡_; refl; sym)
28-
open import Relation.Nullary using (Dec; yes; no)
27+
open import Relation.Nullary using (Dec; yes; no; ¬_)
2928
open import Relation.Nullary.Decidable using (True; toWitness)
3029
open import Relation.Nullary.Negation using (contradiction)
3130

@@ -78,7 +77,7 @@ extractEquality (isEquality x≈y) = x≈y
7877
-- See `Relation.Binary.Reasoning.Base.Partial` for the design decisions
7978
-- behind these combinators.
8079

81-
infix 1 begin_ begin-strict_ begin-irrefl_ begin-equality_
80+
infix 1 begin_ begin-strict_ begin-equality_
8281
infixr 2 step-< step-≤ step-≈ step-≈˘ step-≡ step-≡˘ _≡⟨⟩_
8382
infix 3 _∎
8483

@@ -92,12 +91,21 @@ begin (equals x≈y) = ≤-reflexive x≈y
9291
begin-strict_ : {x y} (r : x IsRelatedTo y) {s : True (IsStrict? r)} x < y
9392
begin-strict_ r {s} = extractStrict (toWitness s)
9493

95-
begin-irrefl_ : {x} (r : x IsRelatedTo x) {s : True (IsStrict? r)} {a} {A : Set a} A
96-
begin-irrefl_ r {s} = contradiction (extractStrict (toWitness s)) (<-irrefl Eq.refl)
97-
9894
begin-equality_ : {x y} (r : x IsRelatedTo y) {s : True (IsEquality? r)} x ≈ y
9995
begin-equality_ r {s} = extractEquality (toWitness s)
10096

97+
98+
begin-irrefl : Irreflexive _≈_ _<_
99+
{x} (r : x IsRelatedTo x) {s : True (IsStrict? r)}
100+
{a} {A : Set a} A
101+
begin-irrefl <-irrefl {x} r {s} = contradiction x<x x≮x where
102+
103+
x<x : x < x
104+
x<x = extractStrict (toWitness s)
105+
106+
x≮x : ¬ (x < x)
107+
x≮x = <-irrefl Eq.refl
108+
101109
-- Step with the strict relation
102110

103111
step-< : (x : A) {y z} y IsRelatedTo z x < y x IsRelatedTo z

src/Relation/Binary/Reasoning/PartialOrder.agda

+7-3
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,26 @@ module Relation.Binary.Reasoning.PartialOrder
4545
{p₁ p₂ p₃} (P : Poset p₁ p₂ p₃) where
4646

4747
open Poset P
48-
import Relation.Binary.Construct.NonStrictToStrict _≈_ _≤_ as Strict
48+
open import Relation.Binary.Construct.NonStrictToStrict _≈_ _≤_
49+
as Strict
50+
using (_<_)
4951

5052
------------------------------------------------------------------------
5153
-- Re-export contents of base module
5254

5355
open import Relation.Binary.Reasoning.Base.Triple
5456
isPreorder
55-
Strict.<-irrefl
5657
(Strict.<-trans isPartialOrder)
5758
(Strict.<-resp-≈ isEquivalence ≤-resp-≈)
5859
Strict.<⇒≤
5960
(Strict.<-≤-trans Eq.sym trans antisym ≤-respʳ-≈)
6061
(Strict.≤-<-trans trans antisym ≤-respˡ-≈)
62+
as Reasoning
6163
public
64+
hiding (begin-irrefl)
6265

63-
66+
infix 1 begin-irrefl_
67+
begin-irrefl_ = Reasoning.begin-irrefl Strict.irrefl
6468

6569
------------------------------------------------------------------------
6670
-- DEPRECATED NAMES

src/Relation/Binary/Reasoning/StrictPartialOrder.agda

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ import Relation.Binary.Construct.StrictToNonStrict _≈_ _<_ as NonStrict
5353

5454
open import Relation.Binary.Reasoning.Base.Triple
5555
(NonStrict.isPreorder₂ isStrictPartialOrder)
56-
irrefl
5756
trans
5857
<-resp-≈
5958
NonStrict.<⇒≤
6059
(NonStrict.<-≤-trans trans <-respʳ-≈)
6160
(NonStrict.≤-<-trans Eq.sym trans <-respˡ-≈)
61+
as Reasoning
6262
public
63+
hiding (begin-irrefl)
64+
65+
infix 1 begin-irrefl_
66+
begin-irrefl_ = Reasoning.begin-irrefl irrefl

0 commit comments

Comments
 (0)