| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Induction over Subset |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
module Data.Fin.Subset.Induction where |
| 10 |
|
| 11 |
open import Data.Nat.Base using (ℕ) |
| 12 |
open import Data.Nat.Induction using (<-wellFounded) |
| 13 |
open import Data.Fin.Subset using (Subset; ∁; _⊂_; _⊃_; ∣_∣) |
| 14 |
open import Data.Fin.Subset.Properties using (p⊂q⇒∣p∣<∣q∣; p⊂q⇒∁p⊃∁q) |
| 15 |
open import Induction using (RecStruct) |
| 16 |
open import Induction.WellFounded as WF |
| 17 |
open import Level using (Level) |
| 18 |
import Relation.Binary.Construct.On as On using (wellFounded) |
| 19 |
|
| 20 |
private |
| 21 |
variable |
| 22 |
ℓ : Level |
| 23 |
n : ℕ |
| 24 |
|
| 25 |
------------------------------------------------------------------------ |
| 26 |
-- Re-export accessability |
| 27 |
|
| 28 |
open WF public using (Acc; acc) |
| 29 |
|
| 30 |
------------------------------------------------------------------------ |
| 31 |
-- Complete induction based on _⊂_ |
| 32 |
|
| 33 |
⊂-Rec : RecStruct (Subset n) ℓ ℓ |
| 34 |
⊂-Rec = WfRec _⊂_ |
| 35 |
|
| 36 |
⊂-wellFounded : WellFounded {A = Subset n} _⊂_ |
| 37 |
⊂-wellFounded = Subrelation.wellFounded p⊂q⇒∣p∣<∣q∣ |
| 38 |
(On.wellFounded ∣_∣ <-wellFounded) |
| 39 |
|
| 40 |
------------------------------------------------------------------------ |
| 41 |
-- Complete induction based on _⊃_ |
| 42 |
|
| 43 |
⊃-Rec : RecStruct (Subset n) ℓ ℓ |
| 44 |
⊃-Rec = WfRec _⊃_ |
| 45 |
|
| 46 |
⊃-wellFounded : WellFounded {A = Subset n} _⊃_ |
| 47 |
⊃-wellFounded = Subrelation.wellFounded p⊂q⇒∁p⊃∁q |
| 48 |
(On.wellFounded ∁ ⊂-wellFounded) |