Files
agdaproofs/Sets/Cardinality/Finite/Lemmas.agda
2020-04-18 17:47:27 +01:00

24 lines
827 B
Agda
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{-# OPTIONS --safe --warning=error --without-K #-}
open import Functions.Definition
open import LogicalFormulae
open import Numbers.Naturals.Definition
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')