Cleanup finset and modulo (#92)

This commit is contained in:
Patrick Stevens
2020-01-01 10:14:55 +00:00
committed by GitHub
parent b6ef9b46f2
commit 019a9d9a07
66 changed files with 1154 additions and 1431 deletions

View File

@@ -0,0 +1,18 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import LogicalFormulae
open import Numbers.Naturals.Naturals
open import Numbers.Naturals.Definition
open import Numbers.Naturals.Order
open import Sets.FinSet.Definition
module Sets.Cardinality.Finite.Definition where
record FiniteSet {a : _} (A : Set a) : Set a where
field
size :
mapping : FinSet size A
bij : Bijection mapping

View File

@@ -0,0 +1,26 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import LogicalFormulae
open import Numbers.Naturals.Naturals
open import Numbers.Naturals.Definition
open import Numbers.Naturals.Order
open import Sets.FinSet.Definition
open import Sets.FinSet.Lemmas
module Sets.Cardinality.Finite.Lemmas where
finsetInjectInto : {n : } Injection (toNat {n})
finsetInjectInto {zero} {()}
finsetInjectInto {succ n} = ans
where
ans : {n : } {x y : FinSet (succ n)} (toNat x toNat y) x y
ans {zero} {fzero} {fzero} _ = refl
ans {zero} {fzero} {fsucc ()}
ans {zero} {fsucc ()} {y}
ans {succ n} {fzero} {fzero} pr = refl
ans {succ n} {fzero} {fsucc y} ()
ans {succ n} {fsucc x} {fzero} ()
ans {succ n} {fsucc x} {fsucc y} pr with succInjective pr
... | pr' = applyEquality fsucc (ans {n} {x} {y} pr')