Skip to content

Commit 8da812c

Browse files
authored
Added Irreflexivity and Asymmetry of WellFounded Relations (#2119)
1 parent 16aadff commit 8da812c

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -3764,6 +3764,11 @@ This is a full list of proofs that have changed form to use irrelevant instance
37643764
* Added new proof to `Induction.WellFounded`
37653765
```agda
37663766
Acc-resp-flip-≈ : _<_ Respectsʳ (flip _≈_) → (Acc _<_) Respects _≈_
3767+
3768+
acc⇒asym : Acc _<_ x → x < y → ¬ (y < x)
3769+
wf⇒asym : WellFounded _<_ → Asymmetric _<_
3770+
wf⇒irrefl : _<_ Respects₂ _≈_ → Symmetric _≈_ →
3771+
WellFounded _<_ → Irreflexive _≈_ _<_
37673772
```
37683773

37693774
* Added new file `Relation.Binary.Reasoning.Base.Apartness`

src/Induction/WellFounded.agda

+20-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88

99
module Induction.WellFounded where
1010

11-
open import Data.Product.Base using (Σ; _,_; proj₁)
11+
open import Data.Product.Base using (Σ; _,_; proj₁; proj₂)
1212
open import Function.Base using (_∘_; flip; _on_)
1313
open import Induction
1414
open import Level using (Level; _⊔_)
1515
open import Relation.Binary.Core using (Rel)
1616
open import Relation.Binary.Definitions
17-
using (Symmetric; _Respectsʳ_; _Respects_)
17+
using (Symmetric; Asymmetric; Irreflexive; _Respects₂_;
18+
_Respectsʳ_; _Respects_)
1819
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)
20+
open import Relation.Binary.Consequences using (asym⇒irr)
1921
open import Relation.Unary
22+
open import Relation.Nullary.Negation.Core using (¬_)
2023

2124
private
2225
variable
@@ -116,6 +119,21 @@ module FixPoint
116119
unfold-wfRec : {x} wfRec P f x ≡ f x λ _ wfRec P f _
117120
unfold-wfRec {x} = f-ext x wfRecBuilder-wfRec
118121

122+
------------------------------------------------------------------------
123+
-- Well-founded relations are asymmetric and irreflexive.
124+
125+
module _ {_<_ : Rel A r} where
126+
acc⇒asym : {x y} Acc _<_ x x < y ¬ (y < x)
127+
acc⇒asym {x} hx =
128+
Some.wfRec (λ x {y} x < y ¬ (y < x)) (λ _ hx x<y y<x hx y<x y<x x<y) _ hx
129+
130+
wf⇒asym : WellFounded _<_ Asymmetric _<_
131+
wf⇒asym wf = acc⇒asym (wf _)
132+
133+
wf⇒irrefl : {_≈_ : Rel A ℓ} _<_ Respects₂ _≈_
134+
Symmetric _≈_ WellFounded _<_ Irreflexive _≈_ _<_
135+
wf⇒irrefl r s wf = asym⇒irr r s (wf⇒asym wf)
136+
119137
------------------------------------------------------------------------
120138
-- It might be useful to establish proofs of Acc or Well-founded using
121139
-- combinators such as the ones below (see, for instance,

0 commit comments

Comments
 (0)