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

41 lines
1.5 KiB
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 --guardedness #-}
open import Functions.Definition
open import Functions.Lemmas
open import LogicalFormulae
open import Numbers.Naturals.Definition
open import Numbers.Naturals.Order
open import Sets.FinSet.Definition
open import Sets.FinSet.Lemmas
open import Sets.Cardinality.Infinite.Definition
open import Sets.Cardinality.Finite.Lemmas
open import Numbers.Reals.Definition
open import Numbers.Rationals.Definition
open import Numbers.Integers.Definition
open import Sets.Cardinality.Infinite.Lemmas
open import Setoids.Setoids
module Sets.Cardinality.Infinite.Examples where
IsInfinite : InfiniteSet
IsInfinite n f bij = pigeonhole (le 0 refl) badInj
where
inv : FinSet n
inv = Invertible.inverse (bijectionImpliesInvertible bij)
invInj : Injection inv
invInj = Bijection.inj (invertibleImpliesBijection (inverseIsInvertible (bijectionImpliesInvertible bij)))
bumpUp : FinSet n FinSet (succ n)
bumpUp = intoSmaller (le 0 refl)
bumpUpInj : Injection bumpUp
bumpUpInj = intoSmallerInj (le 0 refl)
nextInj : Injection (toNat {succ n})
nextInj = finsetInjectInto {succ n}
bad : FinSet (succ n) FinSet n
bad a = (inv (toNat a))
badInj : Injection bad
badInj = injComp nextInj invInj
IsInfinite : DedekindInfiniteSet
DedekindInfiniteSet.inj IsInfinite n = injectionR (injectionQ (nonneg n))
DedekindInfiniteSet.isInjection IsInfinite {x} {y} pr = nonnegInjective (injectionQInjective (injectionRInjective pr))