|
| 1 | +------------------------------------------------------------------------ |
| 2 | +-- The Agda standard library |
| 3 | +-- |
| 4 | +-- Notions of finiteness for setoids |
| 5 | +------------------------------------------------------------------------ |
| 6 | + |
| 7 | +{-# OPTIONS --safe --cubical-compatible #-} |
| 8 | + |
| 9 | +module Relation.Nullary.Finite.Setoid where |
| 10 | + |
| 11 | +open import Data.Fin.Base using (Fin) |
| 12 | +open import Data.Nat.Base using (ℕ) |
| 13 | +open import Data.Product.Base as × |
| 14 | +open import Data.Sum.Base as ⊎ using (_⊎_; inj₁; inj₂) |
| 15 | +open import Data.Unit using (⊤; tt) |
| 16 | +open import Function |
| 17 | +open import Level renaming (suc to lsuc) |
| 18 | +open import Relation.Binary using (Rel; Setoid; IsEquivalence) |
| 19 | +import Relation.Binary.Reasoning.Setoid as SetR |
| 20 | +import Relation.Binary.Construct.On as On |
| 21 | +open import Relation.Binary.PropositionalEquality as ≡ using (_≡_) |
| 22 | + |
| 23 | +private |
| 24 | + variable |
| 25 | + c ℓ c′ ℓ′ : Level |
| 26 | + |
| 27 | +record StrictlyFinite (X : Setoid c ℓ) : Set (c ⊔ ℓ) where |
| 28 | + field |
| 29 | + size : ℕ |
| 30 | + inv : Inverse X (≡.setoid (Fin size)) |
| 31 | + |
| 32 | +record Subfinite (X : Setoid c ℓ) : Set (c ⊔ ℓ) where |
| 33 | + field |
| 34 | + size : ℕ |
| 35 | + inj : Injection X (≡.setoid (Fin size)) |
| 36 | + |
| 37 | +record FinitelyEnumerable (X : Setoid c ℓ) : Set (c ⊔ ℓ) where |
| 38 | + field |
| 39 | + size : ℕ |
| 40 | + srj : Surjection (≡.setoid (Fin size)) X |
| 41 | + |
| 42 | +record SubFinitelyEnumerable (X : Setoid c ℓ) c′ ℓ′ |
| 43 | + : Set (c ⊔ ℓ ⊔ lsuc (c′ ⊔ ℓ′)) where |
| 44 | + field |
| 45 | + Apex : Setoid c′ ℓ′ |
| 46 | + finitelyEnumerable : FinitelyEnumerable Apex |
| 47 | + inj : Injection X Apex |
| 48 | + |
| 49 | + open FinitelyEnumerable finitelyEnumerable public |
| 50 | + |
| 51 | +record SubfinitelyEnumerable (X : Setoid c ℓ) c′ ℓ′ |
| 52 | + : Set (c ⊔ ℓ ⊔ lsuc (c′ ⊔ ℓ′)) where |
| 53 | + field |
| 54 | + Apex : Setoid c′ ℓ′ |
| 55 | + subfinite : Subfinite Apex |
| 56 | + srj : Surjection Apex X |
| 57 | + |
| 58 | + open Subfinite subfinite public |
0 commit comments