Imports
import Mathlib.Tactic

Analysis I, Section 8.1: Countability

I have attempted to make the translation as faithful a paraphrasing as possible of the original text. When there is a choice between a more idiomatic Lean solution and a more faithful translation, I have generally chosen the latter. In particular, there will be places where the Lean code could be "golfed" to be more elegant and idiomatic, but I have consciously avoided doing so.

Main constructions and results of this section:

  • Custom notions for "equal cardinality", "countable", and "at most countable". Note that Mathlib's Countable typeclass corresponds to what we call "at most countable" in this text.

  • Countability of the integers and rationals.

Note that as the Chapter 3 set theory has been deprecated, we will not re-use relevant constructions from that theory here, replacing them with Mathlib counterparts instead.

namespace Chapter8

The definition of equal cardinality. For simplicity we restrict attention to the Type 0 universe. This is analogous to Chapter3.SetTheory.Set.EqualCard, but we are not using the latter since the Chapter 3 set theory is deprecated.

abbrev EqualCard (X Y : Type) : Prop := f : X Y, Function.Bijective f

Relation with Mathlib's Equiv concept

theorem EqualCard.iff {X Y : Type} : EqualCard X Y Nonempty (X Y) := X:TypeY:TypeEqualCard X Y Nonempty (X Y) X:TypeY:Type(∃ f, Function.Bijective f) Nonempty (X Y); X:TypeY:Type(∃ f, Function.Bijective f) Nonempty (X Y)X:TypeY:TypeNonempty (X Y) f, Function.Bijective f X:TypeY:Type(∃ f, Function.Bijective f) Nonempty (X Y) X:TypeY:Typef:X Yhf:Function.Bijective fNonempty (X Y); All goals completed! 🐙 X:TypeY:Typee:X Y f, Function.Bijective f; All goals completed! 🐙

Equivalence with Mathlib's Cardinal.­mk concept

theorem EqualCard.iff' {X Y : Type} : EqualCard X Y Cardinal.mk X = Cardinal.mk Y := X:TypeY:TypeEqualCard X Y Cardinal.mk X = Cardinal.mk Y All goals completed! 🐙
theorem declaration uses `sorry`EqualCard.refl (X : Type) : EqualCard X X := sorrytheorem declaration uses `sorry`EqualCard.symm {X Y : Type} (hXY : EqualCard X Y) : EqualCard Y X := X:TypeY:TypehXY:EqualCard X YEqualCard Y X All goals completed! 🐙theorem declaration uses `sorry`EqualCard.trans {X Y Z : Type} (hXY : EqualCard X Y) (hYZ : EqualCard Y Z) : EqualCard X Z := X:TypeY:TypeZ:TypehXY:EqualCard X YhYZ:EqualCard Y ZEqualCard X Z All goals completed! 🐙instance EqualCard.instSetoid : Setoid Type := EqualCard, refl, symm, trans theorem EqualCard.univ (X : Type) : EqualCard (.univ : Set X) X := Subtype.val, Subtype.val_injective, X:TypeFunction.Surjective Subtype.val X:Typeb✝:X a, a = b✝; All goals completed! 🐙 abbrev CountablyInfinite (X : Type) : Prop := EqualCard X abbrev AtMostCountable (X : Type) : Prop := CountablyInfinite X Finite Xtheorem CountablyInfinite.equiv {X Y: Type} (hXY : EqualCard X Y) : CountablyInfinite X CountablyInfinite Y := hXY.symm.trans, hXY.trans theorem Finite.equiv {X Y: Type} (hXY : EqualCard X Y) : Finite X Finite Y := X:TypeY:TypehXY:EqualCard X YFinite X Finite Y X:TypeY:Typef:X Yhf:Function.Bijective fFinite X Finite Y; All goals completed! 🐙theorem AtMostCountable.equiv {X Y: Type} (hXY : EqualCard X Y) : AtMostCountable X AtMostCountable Y := X:TypeY:TypehXY:EqualCard X YAtMostCountable X AtMostCountable Y All goals completed! 🐙

Equivalence with Mathlib's Denumerable concept (cf. Remark 8.1.2)

theorem CountablyInfinite.iff (X : Type) : CountablyInfinite X Nonempty (Denumerable X) := X:TypeCountablyInfinite X Nonempty (Denumerable X) X:TypeNonempty (X ) Nonempty (Denumerable X); X:TypeNonempty (X ) Nonempty (Denumerable X)X:TypeNonempty (Denumerable X) Nonempty (X ) X:TypeNonempty (X ) Nonempty (Denumerable X) X:Typee:X Nonempty (Denumerable X); All goals completed! 🐙 X:Typeh:Denumerable XNonempty (X ); All goals completed! 🐙

Equivalence with Mathlib's Countable typeclass

theorem CountablyInfinite.iff' (X : Type) : CountablyInfinite X Countable X Infinite X := X:TypeCountablyInfinite X Countable X Infinite X All goals completed! 🐙
theorem CountablyInfinite.toCountable {X : Type} (hX: CountablyInfinite X) : Countable X := X:TypehX:CountablyInfinite XCountable X All goals completed! 🐙theorem CountablyInfinite.toInfinite {X : Type} (hX: CountablyInfinite X) : Infinite X := X:TypehX:CountablyInfinite XInfinite X All goals completed! 🐙theorem AtMostCountable.iff (X : Type) : AtMostCountable X Countable X := X:TypeAtMostCountable X Countable X X:Typeh1:CountablyInfinite X Countable X Infinite XAtMostCountable X Countable X X:Typeh1:CountablyInfinite X Countable X Infinite Xh2:Finite X Infinite XAtMostCountable X Countable X X:Typeh1:CountablyInfinite X Countable X Infinite Xh2:Finite X Infinite Xh3:Finite X Countable XAtMostCountable X Countable X All goals completed! 🐙theorem CountablyInfinite.iff_image_inj {A:Type} (X: Set A) : CountablyInfinite X f : A, X = f '' .univ := A:TypeX:Set ACountablyInfinite X f, X = f '' Set.univ A:TypeX:Set ACountablyInfinite X f, X = f '' Set.univA:TypeX:Set A(∃ f, X = f '' Set.univ) CountablyInfinite X A:TypeX:Set ACountablyInfinite X f, X = f '' Set.univ A:TypeX:Set Ag:X hg:Function.Bijective g f, X = f '' Set.univ A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f g f, X = f '' Set.univ A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gFunction.Injective (Subtype.val f)A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gX = { toFun := Subtype.val f, inj' := ?mp.refine_1 } '' Set.univ A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gFunction.Injective (Subtype.val f) intro x A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx:y:(Subtype.val f) x = (Subtype.val f) y x = y A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx:y:hxy:(Subtype.val f) x = (Subtype.val f) yx = y; A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx:y:hxy:(Subtype.val f) x = (Subtype.val f) yf x = f y; All goals completed! 🐙 A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:Ax✝ X x✝ { toFun := Subtype.val f, inj' := } '' Set.univ; A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:Ax✝ X y, (f y) = x✝; A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:Ax✝ X y, (f y) = x✝A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:A(∃ y, (f y) = x✝) x✝ X A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:Ax✝ X y, (f y) = x✝ A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:Ahx:x✝ X y, (f y) = x✝; A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:Ahx:x✝ X(f (g x✝, hx)) = x✝; All goals completed! 🐙 A:TypeX:Set Ag:X hg:Function.Bijective gf: Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gw✝:(f w✝) X; All goals completed! 🐙 A:TypeX:Set Af: Ahf:X = f '' Set.univCountablyInfinite X A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun f) fCountablyInfinite X A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun f) fFunction.Bijective (Function.invFun f Subtype.val); A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun f) fFunction.Injective (Function.invFun f Subtype.val)A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun f) fFunction.Surjective (Function.invFun f Subtype.val) A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun f) fFunction.Injective (Function.invFun f Subtype.val) A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun f) fx:Ahx:x Xy:Ahy:y Xh:(Function.invFun f Subtype.val) x, hx = (Function.invFun f Subtype.val) y, hyx, hx = y, hy; All goals completed! 🐙 A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun f) fn: a, (Function.invFun f Subtype.val) a = n; use f n, A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun f) fn:f n X All goals completed! 🐙 ; All goals completed! 🐙/-- Examples 8.1.3 -/ declaration uses `sorry`example : CountablyInfinite := CountablyInfinite All goals completed! 🐙declaration uses `sorry`example : CountablyInfinite (.univ \ {0}: Set ) := CountablyInfinite (Set.univ \ {0}) All goals completed! 🐙declaration uses `sorry`example : CountablyInfinite ((fun n: 2*n) '' .univ) := CountablyInfinite ((fun n 2 * n) '' Set.univ) All goals completed! 🐙

Proposition 8.1.4 (Well ordering principle / Exercise 8.1.2

theorem declaration uses `sorry`Nat.exists_unique_min {X : Set } (hX : X.Nonempty) : ∃! m X, n X, m n := X:Set hX:X.Nonempty∃! m, m X n X, m n All goals completed! 🐙
def declaration uses `sorry`Int.exists_unique_min : Decidable ( (X : Set ) (hX : X.Nonempty), ∃! m X, n X, m n) := Decidable (∀ (X : Set ), X.Nonempty ∃! m, m X n X, m n) -- the first line of this construction should be either `apply isTrue` or `apply isFalse`. All goals completed! 🐙def declaration uses `sorry`NNRat.exists_unique_min : Decidable ( (X : Set NNRat) (hX : X.Nonempty), ∃! m X, n X, m n) := Decidable (∀ (X : Set ℚ≥0), X.Nonempty ∃! m, m X n X, m n) -- the first line of this construction should be either `apply isTrue` or `apply isFalse`. All goals completed! 🐙open Classical in noncomputable abbrev Nat.min (X : Set ) : := if hX : X.Nonempty then (exists_unique_min hX).exists.choose else 0theorem Nat.min_spec {X : Set } (hX : X.Nonempty) : min X X n X, min X n := X:Set hX:X.Nonemptymin X X n X, min X n X:Set hX:X.Nonempty.choose X n X, .choose n; All goals completed! 🐙theorem Nat.min_eq {X : Set } (hX : X.Nonempty) {a:} (ha : a X n X, a n) : min X = a := (exists_unique_min hX).unique (min_spec hX) ha@[simp] theorem Nat.min_empty : min = 0 := min = 0 All goals completed! 🐙declaration uses `sorry`example : Nat.min ((fun n 2*n) '' (.Ici 1)) = 2 := Nat.min ((fun n 2 * n) '' Set.Ici 1) = 2 All goals completed! 🐙theorem declaration uses `sorry`Nat.min_eq_sInf {X : Set } (hX : X.Nonempty) : min X = sInf X := X:Set hX:X.Nonemptymin X = sInf X All goals completed! 🐙

Equivalence with Mathlib's Nat.­find method

open Classical intheorem Nat.min_eq_find {X : Set } (hX : X.Nonempty) : min X = Nat.find hX := X:Set hX:X.Nonemptymin X = Nat.find hX X:Set hX:X.NonemptyNat.find hX = min X; X:Set hX:X.Nonemptymin X X n < min X, n X; X:Set hX:X.Nonemptythis:min X X n X, min X nmin X X n < min X, n X; All goals completed! 🐙

Proposition 8.1.5

theorem declaration uses `sorry`Nat.monotone_enum_of_infinite (X : Set ) [Infinite X] : ∃! f : X, Function.Bijective f StrictMono f := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f -- This proof is written to follow the structure of the original text. X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) t∃! f, Function.Bijective f StrictMono f X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}∃! f, Function.Bijective f StrictMono f have ha_infinite (n:) : Infinite { x X | (m:) (h:m < n), x a m } := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f All goals completed! 🐙 X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonempty∃! f, Function.Bijective f StrictMono f have ha_mono : StrictMono a := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f All goals completed! 🐙 have ha_injective : Function.Injective a := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f All goals completed! 🐙 have haX (n:) : a n X := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f All goals completed! 🐙 X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, ∃! f, Function.Bijective f StrictMono f have hf_injective : Function.Injective f := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f intro x X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, x:y:f x = f y x = y X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, x:y:hxy:f x = f yx = y; X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, x:y:hxy:a x = a yx = y; All goals completed! 🐙 have hf_surjective : Function.Surjective f := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fx:hx:x X a, f a = x, hx; X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fx:hx:x X a_1, a a_1 = x; X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fx:hx:x Xthis:¬ a_1, a a_1 = xFalse have h1 (n:) : x { x X | (m:) (h:m < n), x a m } := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f All goals completed! 🐙 have h2 (n:) : x a n := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fx:hx:x Xthis:¬ a_1, a a_1 = xh1: (n : ), x {x | x X m < n, x a m}n:x min {x | x X m < n, x a m}; All goals completed! 🐙 have h3 (n:) : a n n := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f All goals completed! 🐙 X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fx:hx:x Xthis:¬ a_1, a a_1 = xh1: (n : ), x {x | x X m < n, x a m}h2: (n : ), x a nh3: (n : ), a n nh4: (n : ), x nFalse All goals completed! 🐙 X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective f (y : X), Function.Bijective y StrictMono y y = f intro g X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gg = f; X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:g fFalse replace : { n | g n f n }.Nonempty := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n} = g = f X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n} = (x : ), g x = f x; All goals completed! 🐙 X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n}.Nonemptym: := min {n | g n f n}False X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n}.Nonemptym: := min {n | g n f n}hm:g m f mFalse have hm' {n:} (hn: n < m) : g n = f n := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n}.Nonemptym: := min {n | g n f n}hm:g m f mn:hn:n < mhgfn:¬g n = f nFalse; linarith [(min_spec this).2 n (X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n}.Nonemptym: := min {n | g n f n}hm:g m f mn:hn:n < mhgfn:¬g n = f nn {n | g n f n} All goals completed! 🐙)] have hgm : g m = min { x X | (n:) (h:n < m), x a n } := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f All goals completed! 🐙 X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n}.Nonemptym: := min {n | g n f n}hm:g m f mhm': {n : }, n < m g n = f nhgm:(g m) = a mFalse; X:Set inst✝:Infinite Xa: := fun t Nat.strongRec (fun n a min {x | x X (m : ) (h : m < n), x a m h}) tha: (n : ), a n = min {x | x X m < n, x a m}ha_infinite: (n : ), Infinite {x | x X m < n, x a m}ha_nonempty: (n : ), {x | x X m < n, x a m}.Nonemptyha_mono:StrictMono aha_injective:Function.Injective ahaX: (n : ), a n Xf: X := fun n a n, hf_injective:Function.Injective fhf_surjective:Function.Surjective fg: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n}.Nonemptym: := min {n | g n f n}hm': {n : }, n < m g n = f nhgm:(g m) = a mhm:Trueg m = f m; All goals completed! 🐙
theorem Nat.countable_of_infinite (X : Set ) [Infinite X] : CountablyInfinite X := X:Set inst✝:Infinite XCountablyInfinite X X:Set inst✝:Infinite Xthis: x, Function.Bijective x StrictMono xCountablyInfinite X All goals completed! 🐙

Corollary 8.1.6

theorem Nat.atMostCountable_subset (X: Set ) : AtMostCountable X := X:Set AtMostCountable X X:Set h✝:Finite XAtMostCountable XX:Set h✝:Infinite XAtMostCountable X X:Set h✝:Finite XAtMostCountable X All goals completed! 🐙 All goals completed! 🐙

Corollary 8.1.7

theorem declaration uses `sorry`AtMostCountable.subset {X: Type} (hX : AtMostCountable X) (Y: Set X) : AtMostCountable Y := X:TypehX:AtMostCountable XY:Set XAtMostCountable Y -- This proof is written to follow the structure of the original text. X:TypeY:Set Xf:X hf:Function.Bijective fAtMostCountable YX:TypeY:Set XhX:Finite XAtMostCountable Y X:TypeY:Set Xf:X hf:Function.Bijective fAtMostCountable Y let f' : Y f '' Y := fun y f y, X:TypeY:Set Xf:X hf:Function.Bijective fy:Yf y f '' Y All goals completed! 🐙 have hf' : Function.Bijective f' := X:TypehX:AtMostCountable XY:Set XAtMostCountable Y All goals completed! 🐙 X:TypeY:Set Xf:X hf:Function.Bijective ff':Y (f '' Y) := fun y f y, hf':Function.Bijective f'AtMostCountable (f '' Y); All goals completed! 🐙 All goals completed! 🐙
theorem AtMostCountable.subset' {A: Type} {X Y: Set A} (hX: AtMostCountable X) (hY: Y X) : AtMostCountable Y := A:TypeX:Set AY:Set AhX:AtMostCountable XhY:Y XAtMostCountable Y A:TypeX:Set AY:Set AhX:AtMostCountable XhY:Y XFunction.Injective fun y y, A:TypeX:Set AY:Set AhX:AtMostCountable XhY:Y XFunction.Surjective fun y y, A:TypeX:Set AY:Set AhX:AtMostCountable XhY:Y XFunction.Injective fun y y, intro _, _ , _ A:TypeX:Set AY:Set AhX:AtMostCountable XhY:Y Xval✝¹:Aproperty✝³:val✝¹ Xproperty✝²:val✝¹, property✝³ {x | x Y}val✝:Aproperty✝¹:val✝ Xproperty✝:val✝, property✝¹ {x | x Y}(fun y y, ) val✝¹, property✝³, property✝² = (fun y y, ) val✝, property✝¹, property✝ val✝¹, property✝³, property✝² = val✝, property✝¹, property✝ A:TypeX:Set AY:Set AhX:AtMostCountable XhY:Y Xval✝¹:Aproperty✝³:val✝¹ Xproperty✝²:val✝¹, property✝³ {x | x Y}val✝:Aproperty✝¹:val✝ Xproperty✝:val✝, property✝¹ {x | x Y}a✝:(fun y y, ) val✝¹, property✝³, property✝² = (fun y y, ) val✝, property✝¹, property✝val✝¹, property✝³, property✝² = val✝, property✝¹, property✝; All goals completed! 🐙 A:TypeX:Set AY:Set AhX:AtMostCountable XhY:Y Xy:Ahy:y Y a, (fun y y, ) a = y, hy; use y, hY hy , A:TypeX:Set AY:Set AhX:AtMostCountable XhY:Y Xy:Ahy:y Yy, {x | x Y} All goals completed! 🐙

Proposition 8.1.8 / Exercise 8.1.4

theorem declaration uses `sorry`AtMostCountable.image_nat (Y: Type) (f: Y) : AtMostCountable (f '' .univ) := Y:Typef: YAtMostCountable (f '' Set.univ) All goals completed! 🐙

Corollary 8.1.9 / Exercise 8.1.5

theorem declaration uses `sorry`AtMostCountable.image {X:Type} (hX: CountablyInfinite X) {Y: Type} (f: X Y) : AtMostCountable (f '' .univ) := X:TypehX:CountablyInfinite XY:Typef:X YAtMostCountable (f '' Set.univ) All goals completed! 🐙

Proposition 8.1.10 / Exercise 8.1.7

theorem declaration uses `sorry`CountablyInfinite.union {A:Type} {X Y: Set A} (hX: CountablyInfinite X) (hY: CountablyInfinite Y) : CountablyInfinite (X Y: Set A) := A:TypeX:Set AY:Set AhX:CountablyInfinite XhY:CountablyInfinite YCountablyInfinite (X Y) All goals completed! 🐙

Corollary 8.1.11 -

theorem Int.countablyInfinite : CountablyInfinite := CountablyInfinite -- This proof is written to follow the structure of the original text. have h1 : CountablyInfinite {n: | n 0} := CountablyInfinite f, {n | n 0} = f '' Set.univ use (·: ), Function.Injective fun x x intro _ a₁✝:a₂✝:(fun x x) a₁✝ = (fun x x) a₂✝ a₁✝ = a₂✝ a₁✝:a₂✝:a✝:(fun x x) a₁✝ = (fun x x) a₂✝a₁✝ = a₂✝; All goals completed! 🐙 n:n {n | n 0} n { toFun := fun x x, inj' := } '' Set.univ; n:0 n y, y = n; refine ?_, n:(∃ y, y = n) 0 n All goals completed! 🐙 n:0 n y, y = n n:h:0 n y, y = n; n:h:0 nn.toNat = n; All goals completed! 🐙 have h2 : CountablyInfinite {n: | n 0} := CountablyInfinite h1:CountablyInfinite {n | n 0} f, {n | n 0} = f '' Set.univ use (-·: ), h1:CountablyInfinite {n | n 0}Function.Injective fun x -x intro _ h1:CountablyInfinite {n | n 0}a₁✝:a₂✝:(fun x -x) a₁✝ = (fun x -x) a₂✝ a₁✝ = a₂✝ h1:CountablyInfinite {n | n 0}a₁✝:a₂✝:a✝:(fun x -x) a₁✝ = (fun x -x) a₂✝a₁✝ = a₂✝; All goals completed! 🐙 h1:CountablyInfinite {n | n 0}n:n {n | n 0} n { toFun := fun x -x, inj' := } '' Set.univ; h1:CountablyInfinite {n | n 0}n:n 0 y, -y = n; refine ?_, h1:CountablyInfinite {n | n 0}n:(∃ y, -y = n) n 0 All goals completed! 🐙 h1:CountablyInfinite {n | n 0}n:h:n 0 y, -y = n; h1:CountablyInfinite {n | n 0}n:h:n 0-(-n).toNat = n; All goals completed! 🐙 have : CountablyInfinite (.univ : Set ) := CountablyInfinite h1:CountablyInfinite {n | n 0}h2:CountablyInfinite {n | n 0}Set.univ = {n | n 0} {n | n 0}; h1:CountablyInfinite {n | n 0}h2:CountablyInfinite {n | n 0}x✝:x✝ Set.univ x✝ {n | n 0} {n | n 0}; h1:CountablyInfinite {n | n 0}h2:CountablyInfinite {n | n 0}x✝:0 x✝ x✝ 0; All goals completed! 🐙 rwa [CountablyInfinite.equiv (.univ _)h1:CountablyInfinite {n | n 0}h2:CountablyInfinite {n | n 0}this:CountablyInfinite Set.univCountablyInfinite Set.univ

Lemma 8.1.12

theorem declaration uses `sorry`CountablyInfinite.lower_diag : CountablyInfinite { n : × | n.2 n.1 } := CountablyInfinite {n | n.2 n.1} -- This proof is written to follow the structure of the original text. A:Set ( × ) := {n | n.2 n.1}CountablyInfinite {n | n.2 n.1} A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mCountablyInfinite {n | n.2 n.1} have ha : StrictMono a := CountablyInfinite {n | n.2 n.1} All goals completed! 🐙 A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mCountablyInfinite {n | n.2 n.1} have hf : Function.Injective f := CountablyInfinite {n | n.2 n.1} A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:(n, m) An':m':hnm':(n', m') Ah:f (n, m), hnm = f (n', m'), hnm'(n, m), hnm = (n', m'), hnm' A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'n = n' m = m' A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n < n'n = n' m = m'A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nm':hnm':m' nh:a n + m = a n + m'n = n m = m'A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n' < nn = n' m = m' A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n < n'n = n' m = m' have : a n' + m' > a n + m := CountablyInfinite {n | n.2 n.1} calc _ a n' := A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n < n'a n' + m' a n' All goals completed! 🐙 _ a (n+1) := ha.monotone (A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n < n'n + 1 n' All goals completed! 🐙) _ = a n + (n + 1) := Finset.sum_range_succ id _ _ > a n + m := A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n < n'a n + (n + 1) > a n + m All goals completed! 🐙 All goals completed! 🐙 A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nm':hnm':m' nh:a n + m = a n + m'n = n m = m' All goals completed! 🐙 have : a n + m > a n' + m' := CountablyInfinite {n | n.2 n.1} calc _ a n := A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n' < na n + m a n All goals completed! 🐙 _ a (n'+1) := ha.monotone (A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n' < nn' + 1 n All goals completed! 🐙) _ = a n' + (n' + 1) := Finset.sum_range_succ id _ _ > a n' + m' := A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n' < na n' + (n' + 1) > a n' + m' All goals completed! 🐙 All goals completed! 🐙 let f' : A f '' .univ := fun p f p, A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective fp:Af p f '' Set.univ All goals completed! 🐙 have hf' : Function.Bijective f' := CountablyInfinite {n | n.2 n.1} A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, Function.Injective f'A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, Function.Surjective f' A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, Function.Injective f' intro p A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, p:Aq:Af' p = f' q p = q A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, p:Aq:Ahpq:f' p = f' qp = q; A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, p:Aq:Ahpq:f p = f qp = q; All goals completed! 🐙 A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, l:hl:l f '' Set.univ a, f' a = l, hl; A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, l:hl✝:l f '' Set.univhl: a b, (b_1 : (a, b) A), f (a, b), b_1 = l a, f' a = l, hl A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, n:m:q:(n, m) Ahl:f (n, m), q f '' Set.univ a, f' a = f (n, m), q, hl; All goals completed! 🐙 have : AtMostCountable A := CountablyInfinite {n | n.2 n.1} A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, hf':Function.Bijective f'AtMostCountable (f '' Set.univ); All goals completed! 🐙 have hfin : ¬ Finite A := CountablyInfinite {n | n.2 n.1} All goals completed! 🐙 A:Set ( × ) := {n | n.2 n.1}a: := fun n m Finset.range (n + 1), mha:StrictMono af:A := fun x match x with | (n, m), property => a n + mhf:Function.Injective ff':A (f '' Set.univ) := fun p f p, hf':Function.Bijective f'this:CountablyInfinite A Finite Ahfin:¬Finite ACountablyInfinite {n | n.2 n.1}; All goals completed! 🐙

Corollary 8.1.13

theorem CountablyInfinite.prod_nat : CountablyInfinite ( × ) := CountablyInfinite ( × ) have upper_diag : CountablyInfinite { n : × | n.1 n.2 } := CountablyInfinite ( × ) refine (equiv fun (n, m), _ (m, n), x✝:{n | n.2 n.1}n:m:property✝:(n, m) {n | n.2 n.1}(m, n) {n | n.1 n.2} All goals completed! 🐙 , ?_, ?_ ).mp lower_diag Function.Injective fun x match x with | (n, m), property => (m, n), intro (_, _), _ fst✝¹:snd✝¹:property✝¹:(fst✝¹, snd✝¹) {n | n.2 n.1}fst✝:snd✝:property✝:(fst✝, snd✝) {n | n.2 n.1}(fun x match x with | (n, m), property => (m, n), ) (fst✝¹, snd✝¹), property✝¹ = (fun x match x with | (n, m), property => (m, n), ) (fst✝, snd✝), property✝ (fst✝¹, snd✝¹), property✝¹ = (fst✝, snd✝), property✝ fst✝¹:snd✝¹:property✝¹:(fst✝¹, snd✝¹) {n | n.2 n.1}fst✝:snd✝:property✝:(fst✝, snd✝) {n | n.2 n.1}a✝:(fun x match x with | (n, m), property => (m, n), ) (fst✝¹, snd✝¹), property✝¹ = (fun x match x with | (n, m), property => (m, n), ) (fst✝, snd✝), property✝(fst✝¹, snd✝¹), property✝¹ = (fst✝, snd✝), property✝; All goals completed! 🐙 n:m:property✝:(n, m) {n | n.1 n.2} a, (fun x match x with | (n, m), property => (m, n), ) a = (n, m), property✝; use (m, n), n:m:property✝:(n, m) {n | n.1 n.2}(m, n) {n | n.2 n.1} All goals completed! 🐙 have : CountablyInfinite (.univ : Set ( × )) := CountablyInfinite ( × ) upper_diag:CountablyInfinite {n | n.1 n.2}Set.univ = {n | n.2 n.1} {n | n.1 n.2}; upper_diag:CountablyInfinite {n | n.1 n.2}n:m:(n, m) Set.univ (n, m) {n | n.2 n.1} {n | n.1 n.2}; upper_diag:CountablyInfinite {n | n.1 n.2}n:m:m n n m; All goals completed! 🐙 All goals completed! 🐙

Corollary 8.1.14 / Exercise 8.1.8

theorem declaration uses `sorry`CountablyInfinite.prod {X Y:Type} (hX: CountablyInfinite X) (hY: CountablyInfinite Y) : CountablyInfinite (X × Y) := X:TypeY:TypehX:CountablyInfinite XhY:CountablyInfinite YCountablyInfinite (X × Y) All goals completed! 🐙

Corollary 8.1.15

theorem declaration uses `sorry`Rat.countablyInfinite : CountablyInfinite := CountablyInfinite -- This proof is written to follow the structure of the original text. have : CountablyInfinite { n: | n 0 } := CountablyInfinite All goals completed! 🐙 this:CountablyInfinite ( × {n | n 0})CountablyInfinite this:CountablyInfinite ( × {n | n 0})f: × {n | n 0} := fun x match x with | (a, b) => a / bCountablyInfinite f: × {n | n 0} := fun x match x with | (a, b) => a / bthis:AtMostCountable (f '' Set.univ)CountablyInfinite have h : f '' .univ = .univ := CountablyInfinite All goals completed! 🐙 f: × {n | n 0} := fun x match x with | (a, b) => a / bh:f '' Set.univ = Set.univh1:CountablyInfinite (f '' Set.univ)CountablyInfinite f: × {n | n 0} := fun x match x with | (a, b) => a / bh:f '' Set.univ = Set.univh2:Finite (f '' Set.univ)CountablyInfinite f: × {n | n 0} := fun x match x with | (a, b) => a / bh:f '' Set.univ = Set.univh1:CountablyInfinite (f '' Set.univ)CountablyInfinite f: × {n | n 0} := fun x match x with | (a, b) => a / bh:f '' Set.univ = Set.univh1:CountablyInfinite (f '' Set.univ)h1':CountablyInfinite Set.univCountablyInfinite rwa [CountablyInfinite.equiv (EqualCard.univ _)f: × {n | n 0} := fun x match x with | (a, b) => a / bh:f '' Set.univ = Set.univh1:CountablyInfinite (f '' Set.univ)h1':CountablyInfinite CountablyInfinite at h1' f: × {n | n 0} := fun x match x with | (a, b) => a / bh:f '' Set.univ = Set.univh2:Finite (f '' Set.univ)CountablyInfinite f: × {n | n 0} := fun x match x with | (a, b) => a / bh:f '' Set.univ = Set.univh2:Finite (f '' Set.univ)h2':Finite Set.univCountablyInfinite f: × {n | n 0} := fun x match x with | (a, b) => a / bh:f '' Set.univ = Set.univh2:Finite (f '' Set.univ)h2':Finite CountablyInfinite All goals completed! 🐙
/-- Exercise 8.1.1 -/ declaration uses `sorry`example (X: Type) : Infinite X Y : Set X, Y .univ EqualCard Y X := X:TypeInfinite X Y, Y Set.univ EqualCard (↑Y) X All goals completed! 🐙/-- Exercise 8.1.6 -/ declaration uses `sorry`example (A: Type) : AtMostCountable A f : A , Function.Injective f := A:TypeAtMostCountable A f, Function.Injective f All goals completed! 🐙/-- Exercise 8.1.9 -/ declaration uses `sorry`example {I X:Type} (hI: AtMostCountable I) (A: I Set X) (hA: i, AtMostCountable (A i)) : AtMostCountable ( i, A i) := I:TypeX:TypehI:AtMostCountable IA:I Set XhA: (i : I), AtMostCountable (A i)AtMostCountable (⋃ i, A i) All goals completed! 🐙

Exercise 8.1.10. Note the lack of the noncomputable keyword in the abbrev.

abbrev declaration uses `sorry`explicit_bijection : := sorry
theorem declaration uses `sorry`explicit_bijection_spec : Function.Bijective explicit_bijection := Function.Bijective explicit_bijection All goals completed! 🐙end Chapter8