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:

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 Unknown identifier `Chapter3.SetTheory.Set.EqualCard`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.{u_1, u_2} (α : Sort u_1) (β : Sort u_2) : Sort (max (max 1 u_1) u_2)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.{u} : Type u Cardinal.{u}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.{u_3} (α : Type u_3) : Type u_3Denumerable 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.{u} (α : Sort u) : PropCountable 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) 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:?_mvar.133034 := Function.leftInverse_invFun (Function.Embedding.injective _fvar.132963)CountablyInfinite X A:TypeX:Set Af: Ahf:X = f '' Set.univthis:?_mvar.133034 := Function.leftInverse_invFun (Function.Embedding.injective _fvar.132963)Function.Bijective (Function.invFun f Subtype.val); A:TypeX:Set Af: Ahf:X = f '' Set.univthis:?_mvar.133034 := Function.leftInverse_invFun (Function.Embedding.injective _fvar.132963)Function.Injective (Function.invFun f Subtype.val)A:TypeX:Set Af: Ahf:X = f '' Set.univthis:?_mvar.133034 := Function.leftInverse_invFun (Function.Embedding.injective _fvar.132963)Function.Surjective (Function.invFun f Subtype.val) A:TypeX:Set Af: Ahf:X = f '' Set.univthis:?_mvar.133034 := Function.leftInverse_invFun (Function.Embedding.injective _fvar.132963)Function.Injective (Function.invFun f Subtype.val) A:TypeX:Set Af: Ahf:X = f '' Set.univthis:?_mvar.133034 := Function.leftInverse_invFun (Function.Embedding.injective _fvar.132963)x: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:?_mvar.133034 := Function.leftInverse_invFun (Function.Embedding.injective _fvar.132963)n: a, (Function.invFun f Subtype.val) a = n; use f n, A:TypeX:Set Af: Ahf:X = f '' Set.univthis:Function.LeftInverse (Function.invFun _fvar.132963) _fvar.132963 := Function.leftInverse_invFun (Function.Embedding.injective _fvar.132963)n: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! 🐙open Classical in /-- Equivalence with Mathlib's `Nat.find` method -/ theorem 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:?_mvar.142721 := Chapter8.Nat.min_spec _fvar.141846min 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 ?_mvar.143707 t∃! f, Function.Bijective f StrictMono f X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807∃! 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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtype∃! 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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 n∃! f, Function.Bijective f StrictMono f have hf_injective : Function.Injective f := X:Set inst✝:Infinite X∃! f, Function.Bijective f StrictMono f X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nx:y:hxy:f x = f yx = y; X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nx: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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339x:hx:x X a, f a = x, hx; X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339x:hx:x X a_1, a a_1 = x; X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339x:hx:x Xx✝:¬ 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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339x:hx:x Xx✝:¬ a_1, a a_1 = xh1: (n : ), _fvar.150743 {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.153392 nn: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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339x:hx:x Xx✝:¬ a_1, a a_1 = xh1: (n : ), _fvar.150743 {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.153392 nh2: (n : ), _fvar.150743 @_fvar.143713 n := fun n => @?_mvar.153410 nh3: (n : ), @_fvar.143713 n n := fun n => @?_mvar.153520 nh4: (n : ), _fvar.150743 n := fun n => LE.le.trans (@_fvar.153521 n) (@_fvar.153411 n)False All goals completed! 🐙 X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710 (y : X), Function.Bijective y StrictMono y y = f X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gg = f; X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: 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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | g n f n} = g = f X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: 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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | @_fvar.155250 n @_fvar.149178 n}.Nonempty := ?_mvar.156284m: := Chapter8.Nat.min {n | @_fvar.155250 n @_fvar.149178 n}False X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | @_fvar.155250 n @_fvar.149178 n}.Nonempty := ?_mvar.156284m: := Chapter8.Nat.min {n | @_fvar.155250 n @_fvar.149178 n}hm:@_fvar.155250 _fvar.157405 @_fvar.149178 _fvar.157405 := (Chapter8.Nat.min_spec _fvar.156285).leftFalse 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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | @_fvar.155250 n @_fvar.149178 n}.Nonempty := ?_mvar.156284m: := Chapter8.Nat.min {n | @_fvar.155250 n @_fvar.149178 n}hm:@_fvar.155250 _fvar.157405 @_fvar.149178 _fvar.157405 := (Chapter8.Nat.min_spec _fvar.156285).leftn: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 => Chapter8.Nat.min {x | x _fvar.143691 (m : ) (h : m < n), x a m h}) tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def fun n a => Chapter8.Nat.min {x | x _fvar.143691 (m : ) (h : m < n), x a m h}ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => sorryha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := sorryha_injective:Function.Injective _fvar.143713 := sorryhaX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => sorryf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := fun x y hxy => @_fvar.149051 x y (@_fvar.149051 (@_fvar.143713 x) (@_fvar.143713 y) )hf_surjective:Function.Surjective _fvar.149178 := fun h => match h with | x, hx => Eq.mpr (id (congrArg Exists (funext fun a => Subtype.mk.injEq (@_fvar.143713 a) (@_fvar.149136 a) x hx))) (Classical.byContradiction fun x_1 => have h1 := fun n => sorry; have h2 := fun n => Eq.mpr (id (congrArg (fun _a => x _a) (@_fvar.143876 n))) (ge_iff_le.mpr ((Chapter8.Nat.min_spec (@_fvar.148909 n)).right x (h1 n))); have h3 := fun n => sorry; have h4 := fun n => LE.le.trans (h3 n) (h2 n); False.elim (Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf x) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (x ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.atom_pf x) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑x) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑x) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_zero_add 0))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_le._simp_1 (x + 1) x) (congrArg (fun x_2 => x_2 x) (Eq.trans (Nat.cast_add x 1) (congrArg (HAdd.hAdd x) Nat.cast_one)))) (h4 (x + 1)))))))))g: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | @_fvar.155250 n @_fvar.149178 n}.Nonempty := Mathlib.Tactic.Contrapose.mtr (Eq.mpr (id (implies_congr (Mathlib.Tactic.PushNeg.not_nonempty_eq {n | @_fvar.155250 n @_fvar.149178 n}) (Mathlib.Tactic.PushNeg.not_ne_eq _fvar.155250 _fvar.149178))) fun this => funext (Eq.mp (Eq.trans Chapter8.Nat.monotone_enum_of_infinite._simp_2 (forall_congr fun x => Decidable.not_not._simp_1)) this)) _fvar.156252m: := Chapter8.Nat.min {n | @_fvar.155250 n @_fvar.149178 n}hm:@_fvar.155250 _fvar.157405 @_fvar.149178 _fvar.157405 := (Chapter8.Nat.min_spec _fvar.156285).leftn: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 ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | @_fvar.155250 n @_fvar.149178 n}.Nonempty := ?_mvar.156284m: := Chapter8.Nat.min {n | @_fvar.155250 n @_fvar.149178 n}hm:@_fvar.155250 _fvar.157405 @_fvar.149178 _fvar.157405 := (Chapter8.Nat.min_spec _fvar.156285).lefthm': {n : }, n < _fvar.157405 @_fvar.155250 n = @_fvar.149178 n := fun {n} hn => @?_mvar.157621 n hnhgm:(g m) = a mFalse; X:Set inst✝:Infinite Xa: := fun t => Nat.strongRec ?_mvar.143707 tha: (n : ), @_fvar.143713 n = Chapter8.Nat.min {x | x _fvar.143691 m < n, x @_fvar.143713 m} := Nat.strongRec.eq_def ?_mvar.143807ha_infinite: (n : ), Infinite {x | x _fvar.143691 m < n, x @_fvar.143713 m} := fun n => @?_mvar.144152 nha_nonempty: (n : ), {x | x _fvar.143691 m < n, x @_fvar.143713 m}.Nonempty := fun n => Set.Nonempty.of_subtypeha_mono:StrictMono _fvar.143713 := ?_mvar.149030ha_injective:Function.Injective _fvar.143713 := ?_mvar.149050haX: (n : ), @_fvar.143713 n _fvar.143691 := fun n => @?_mvar.149135 nf: _fvar.143691 := fun n => @_fvar.143713 n, @_fvar.149136 nhf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g: Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:{n | @_fvar.155250 n @_fvar.149178 n}.Nonempty := ?_mvar.156284m: := Chapter8.Nat.min {n | @_fvar.155250 n @_fvar.149178 n}hm': {n : }, n < _fvar.157405 @_fvar.155250 n = @_fvar.149178 n := fun {n} hn => @?_mvar.157621 n hnhgm:(g m) = a mhm:¬Falseg 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:?_mvar.167918 := ExistsUnique.exists (Chapter8.Nat.monotone_enum_of_infinite _fvar.167914)CountablyInfinite 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':_fvar.169060 (_fvar.169111 '' _fvar.169060) := fun y => @_fvar.169111 y, @?_mvar.169257 yhf':Function.Bijective _fvar.169260 := ?_mvar.184590AtMostCountable (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, 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 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:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586 f, {n | n 0} = f '' Set.univ use (-·: ), h1:Chapter8.CountablyInfinite {n | n 0} := Eq.mpr (id (congrArg (fun _a => _a) (propext (Chapter8.CountablyInfinite.iff_image_inj {n | n 0})))) (Exists.intro { toFun := fun x => x, inj' := fun a₁ a₂ a => of_eq_true (Eq.trans (congrArg (fun x => x = a₂) (id (Eq.mp Nat.cast_inj._simp_1 a))) (eq_self a₂)) } (Set.ext fun n => Eq.mpr (id (congr (congrArg (fun x => Iff (n setOf x)) (funext fun n => ge_iff_le._simp_1)) (Eq.trans (congrArg (fun x => n x) (Eq.trans (Set.image_congr fun a a_1 => Eq.refl a) Set.image_univ)) Set.mem_range._simp_1))) { mp := fun h => Exists.intro n.toNat (of_eq_true (Eq.trans (congrArg (fun x => x = n) (Eq.trans (Int.ofNat_toNat n) (sup_of_le_left h))) (eq_self n))), mpr := fun a => Exists.casesOn a fun w h => h of_eq_true (Nat.cast_nonneg._simp_1 w) }))Function.Injective fun x => -x h1:Chapter8.CountablyInfinite {n | n 0} := Eq.mpr (id (congrArg (fun _a => _a) (propext (Chapter8.CountablyInfinite.iff_image_inj {n | n 0})))) (Exists.intro { toFun := fun x => x, inj' := fun a₁ a₂ a => of_eq_true (Eq.trans (congrArg (fun x => x = a₂) (id (Eq.mp Nat.cast_inj._simp_1 a))) (eq_self a₂)) } (Set.ext fun n => Eq.mpr (id (congr (congrArg (fun x => Iff (n setOf x)) (funext fun n => ge_iff_le._simp_1)) (Eq.trans (congrArg (fun x => n x) (Eq.trans (Set.image_congr fun a a_1 => Eq.refl a) Set.image_univ)) Set.mem_range._simp_1))) { mp := fun h => Exists.intro n.toNat (of_eq_true (Eq.trans (congrArg (fun x => x = n) (Eq.trans (Int.ofNat_toNat n) (sup_of_le_left h))) (eq_self n))), mpr := fun a => Exists.casesOn a fun w h => h of_eq_true (Nat.cast_nonneg._simp_1 w) }))a₁✝:a₂✝:a✝:(fun x => -x) a₁✝ = (fun x => -x) a₂✝a₁✝ = a₂✝; All goals completed! 🐙 h1:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586n:n {n | n 0} n { toFun := fun x => -x, inj' := } '' Set.univ; h1:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586n:n 0 y, -y = n; refine ?_, h1:Chapter8.CountablyInfinite {n | n 0} := Eq.mpr (id (congrArg (fun _a => _a) (propext (Chapter8.CountablyInfinite.iff_image_inj {n | n 0})))) (Exists.intro { toFun := fun x => x, inj' := fun a₁ a₂ a => of_eq_true (Eq.trans (congrArg (fun x => x = a₂) (id (Eq.mp Nat.cast_inj._simp_1 a))) (eq_self a₂)) } (Set.ext fun n => Eq.mpr (id (congr (congrArg (fun x => Iff (n setOf x)) (funext fun n => ge_iff_le._simp_1)) (Eq.trans (congrArg (fun x => n x) (Eq.trans (Set.image_congr fun a a_1 => Eq.refl a) Set.image_univ)) Set.mem_range._simp_1))) { mp := fun h => Exists.intro n.toNat (of_eq_true (Eq.trans (congrArg (fun x => x = n) (Eq.trans (Int.ofNat_toNat n) (sup_of_le_left h))) (eq_self n))), mpr := fun a => Exists.casesOn a fun w h => h of_eq_true (Nat.cast_nonneg._simp_1 w) }))n:(∃ y, -y = n) n 0 All goals completed! 🐙 h1:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586n:h:n 0 y, -y = n; h1:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586n:h:n 0-(-n).toNat = n; All goals completed! 🐙 have : CountablyInfinite (.univ : Set ) := CountablyInfinite h1:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586h2:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.197742Set.univ = {n | n 0} {n | n 0}; h1:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586h2:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.197742x✝:x✝ Set.univ x✝ {n | n 0} {n | n 0}; h1:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586h2:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.197742x✝:0 x✝ x✝ 0; All goals completed! 🐙 rwa [CountablyInfinite.equiv (.univ _)h1:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.188586h2:Chapter8.CountablyInfinite {n | n 0} := ?_mvar.197742this:Chapter8.CountablyInfinite Set.univ := ?_mvar.216738CountablyInfinite 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:?_mvar.222250 := {n | n.2 n.1}CountablyInfinite {n | n.2 n.1} A:?_mvar.222250 := {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:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mCountablyInfinite {n | n.2 n.1} have hf : Function.Injective f := CountablyInfinite {n | n.2 n.1} A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'n = n' m = m' A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mn:m:hnm:m nm':hnm':m' nh:a n + m = a n + m'n = n m = m'A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mn:m:hnm:m nn':m':hnm':m' n'h:a n + m = a n' + m'hnn':n' < nn = n' m = m' A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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 _fvar.222527 := sorryf:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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 _fvar.222527 := sorryf:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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 _fvar.222527 := sorryf:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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 _fvar.222527 := sorryf:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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 _fvar.222527 := sorryf:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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 _fvar.222527 := sorryf:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 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 _fvar.222527 := sorryf:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := fun a₁ => Subtype.casesOn (motive := fun x => a₂ : _fvar.222278⦄, @_fvar.222874 x = @_fvar.222874 a₂ x = a₂) a₁ fun val hnm => Prod.casesOn (motive := fun x => (hnm : x _fvar.222278) a₂ : _fvar.222278⦄, @_fvar.222874 x, hnm = @_fvar.222874 a₂ x, hnm = a₂) val (fun n m hnm a₂ => Subtype.casesOn (motive := fun x => @_fvar.222874 (n, m), hnm = @_fvar.222874 x (n, m), hnm = x) a₂ fun val hnm' => Prod.casesOn (motive := fun x => (hnm' : x _fvar.222278), @_fvar.222874 (n, m), hnm = @_fvar.222874 x, hnm' (n, m), hnm = x, hnm') val (fun n' m' hnm' h => Eq.mpr (id (Eq.trans (Subtype.mk.injEq (n, m) hnm (n', m') hnm') (Prod.mk.injEq n m n' m'))) (Or.casesOn (lt_trichotomy n n') (fun hnn' => have this := Trans.trans (Trans.trans (Trans.trans (le_of_not_gt fun a => Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))) (Mathlib.Tactic.Ring.atom_pf m') (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_zero_add (m' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0)))) (Mathlib.Tactic.Ring.add_pf_add_lt (Int.negOfNat 1).rawCast (Mathlib.Tactic.Ring.add_pf_zero_add (m' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0)))) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n')) (Mathlib.Tactic.Ring.atom_pf m') (Mathlib.Tactic.Ring.add_pf_add_gt (m' ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1 + 0))))) (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n')) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_lt (m' ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0)))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑m') (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0)))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Mathlib.Tactic.Linarith.natCast_nonneg m'))) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Int.add_one_le_iff.mpr (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_lt._simp_1 (@_fvar.222527 n' + m') (@_fvar.222527 n')) (congrArg (fun x => x < (@_fvar.222527 n')) (Nat.cast_add (@_fvar.222527 n') m'))) a))))))) (StrictMono.monotone _fvar.222658 (le_of_not_gt fun a => Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf n) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (n ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.atom_pf n') (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑n') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_lt (n ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (n' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0)))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_zero_add (n ^ Nat.rawCast 1 * Nat.rawCast 1 + (n' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf n') (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (n' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf n) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (n ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑n) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_add_gt (n ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast) (Mathlib.Tactic.Ring.add_pf_add_zero (n' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑n) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑n') (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0)))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Int.add_one_le_iff.mpr (id (Eq.mp (Mathlib.Tactic.Zify.natCast_lt._simp_1 n n') hnn'))))) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Int.add_one_le_iff.mpr (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_lt._simp_1 n' (n + 1)) (congrArg (LT.lt n') (Eq.trans (Nat.cast_add n 1) (congrArg (HAdd.hAdd n) Nat.cast_one)))) a))))))))) (Finset.sum_range_succ id (n + 1))) (lt_of_not_ge fun a => Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.atom_pf m) (Mathlib.Tactic.Ring.atom_pf n) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑n) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_add_lt (m ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (n ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))) (Mathlib.Tactic.Ring.add_pf_add_lt (Int.negOfNat 1).rawCast (Mathlib.Tactic.Ring.add_pf_zero_add (m ^ Nat.rawCast 1 * Nat.rawCast 1 + (n ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n)) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf n) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (n ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_gt (n ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1 + 0))))) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n)) (Mathlib.Tactic.Ring.atom_pf m) (Mathlib.Tactic.Ring.add_pf_add_gt (m ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n)) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_gt (m ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast) (Mathlib.Tactic.Ring.add_pf_add_lt (n ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑(@_fvar.222527 n)) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0))))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑m) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑n) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0))))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (id (Eq.mp (Mathlib.Tactic.Zify.natCast_le._simp_1 m n) hnm)))) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_le._simp_1 (@_fvar.222527 n + (n + 1)) (@_fvar.222527 n + m)) (congr (congrArg LE.le (Eq.trans (Nat.cast_add (@_fvar.222527 n) (n + 1)) (congrArg (HAdd.hAdd (@_fvar.222527 n)) (Eq.trans (Nat.cast_add n 1) (congrArg (HAdd.hAdd n) Nat.cast_one))))) (Nat.cast_add (@_fvar.222527 n) m))) a)))))); False.elim (Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n)) (Mathlib.Tactic.Ring.atom_pf m) (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (m ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n')) (Mathlib.Tactic.Ring.atom_pf m') (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_lt (m ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add ((@_fvar.222527 n') ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + (m' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n)) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsNat.to_raw_eq (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 1))))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsNat.to_raw_eq (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 1))))))) Mathlib.Tactic.Ring.neg_zero))))) (Mathlib.Tactic.Ring.add_pf_add_lt (Int.negOfNat 1).rawCast (Mathlib.Tactic.Ring.add_pf_zero_add ((@_fvar.222527 n) ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + (m ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1 + (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0))))))) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n)) (Mathlib.Tactic.Ring.atom_pf m) (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (m ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1 + (m ^ Nat.rawCast 1 * Nat.rawCast 1 + 0))))) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n')) (Mathlib.Tactic.Ring.atom_pf m') (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_lt (m ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add ((@_fvar.222527 n') ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + (m' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0)))))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑(@_fvar.222527 n)) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑m) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑m') (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0))))))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (Mathlib.Tactic.Linarith.lt_of_lt_of_eq (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (neg_eq_zero.mpr (sub_eq_zero_of_eq (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_eq._simp_1 (@_fvar.222527 n + m) (@_fvar.222527 n' + m')) (congr (congrArg Eq (Nat.cast_add (@_fvar.222527 n) m)) (Nat.cast_add (@_fvar.222527 n') m'))) h))))) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Int.add_one_le_iff.mpr (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_lt._simp_1 (@_fvar.222527 n + m) (@_fvar.222527 n' + m')) (congr (congrArg LT.lt (Nat.cast_add (@_fvar.222527 n) m)) (Nat.cast_add (@_fvar.222527 n') m'))) this)))))))) fun h_1 => Or.casesOn h_1 (fun h_2 => Eq.ndrec (motive := fun n' => m' n' @_fvar.222527 n + m = @_fvar.222527 n' + m' n = n' m = m') (fun hnm' h => Eq.mpr (id (Eq.trans (congrArg (fun x => x m = m') (eq_self n)) (true_and (m = m')))) (Eq.mp Nat.add_left_cancel_iff._simp_1 h)) h_2 hnm' h) fun hnn' => have this := Trans.trans (Trans.trans (Trans.trans (le_of_not_gt fun a => Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))) (Mathlib.Tactic.Ring.atom_pf m) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_zero_add (m ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0)))) (Mathlib.Tactic.Ring.add_pf_add_lt (Int.negOfNat 1).rawCast (Mathlib.Tactic.Ring.add_pf_zero_add (m ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0)))) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n)) (Mathlib.Tactic.Ring.atom_pf m) (Mathlib.Tactic.Ring.add_pf_add_gt (m ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (m ^ Nat.rawCast 1 * Nat.rawCast 1 + ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1 + 0))))) (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n)) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n)) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_lt (m ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑(@_fvar.222527 n)) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0)))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑m) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0)))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Mathlib.Tactic.Linarith.natCast_nonneg m))) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Int.add_one_le_iff.mpr (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_lt._simp_1 (@_fvar.222527 n + m) (@_fvar.222527 n)) (congrArg (fun x => x < (@_fvar.222527 n)) (Nat.cast_add (@_fvar.222527 n) m))) a))))))) (StrictMono.monotone _fvar.222658 (le_of_not_gt fun a => Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf n') (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (n' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.atom_pf n) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑n) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_lt (n' ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (n ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0)))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_zero_add (n' ^ Nat.rawCast 1 * Nat.rawCast 1 + (n ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf n) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (n ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf n') (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (n' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑n') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_add_gt (n' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast) (Mathlib.Tactic.Ring.add_pf_add_zero (n ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑n') (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑n) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0)))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Int.add_one_le_iff.mpr (id (Eq.mp (Mathlib.Tactic.Zify.natCast_lt._simp_1 n' n) hnn'))))) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Int.add_one_le_iff.mpr (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_lt._simp_1 n (n' + 1)) (congrArg (LT.lt n) (Eq.trans (Nat.cast_add n' 1) (congrArg (HAdd.hAdd n') Nat.cast_one)))) a))))))))) (Finset.sum_range_succ id (n' + 1))) (lt_of_not_ge fun a => Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.atom_pf m') (Mathlib.Tactic.Ring.atom_pf n') (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑n') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero) (Mathlib.Tactic.Ring.add_pf_add_lt (m' ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (n' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))) (Mathlib.Tactic.Ring.add_pf_add_lt (Int.negOfNat 1).rawCast (Mathlib.Tactic.Ring.add_pf_zero_add (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + (n' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n')) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf n') (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero (n' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_gt (n' ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1 + 0))))) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n')) (Mathlib.Tactic.Ring.atom_pf m') (Mathlib.Tactic.Ring.add_pf_add_gt (m' ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_gt (m' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast) (Mathlib.Tactic.Ring.add_pf_add_lt (n' ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0))))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑m') (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑n') (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0))))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (id (Eq.mp (Mathlib.Tactic.Zify.natCast_le._simp_1 m' n') hnm')))) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_le._simp_1 (@_fvar.222527 n' + (n' + 1)) (@_fvar.222527 n' + m')) (congr (congrArg LE.le (Eq.trans (Nat.cast_add (@_fvar.222527 n') (n' + 1)) (congrArg (HAdd.hAdd (@_fvar.222527 n')) (Eq.trans (Nat.cast_add n' 1) (congrArg (HAdd.hAdd n') Nat.cast_one))))) (Nat.cast_add (@_fvar.222527 n') m'))) a)))))); False.elim (Mathlib.Tactic.Linarith.lt_irrefl (Eq.mp (congrArg (fun _a => _a < 0) (Mathlib.Tactic.Ring.of_eq (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.neg_congr (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n)) (Mathlib.Tactic.Ring.atom_pf m) (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (m ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n')) (Mathlib.Tactic.Ring.atom_pf m') (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m') (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_lt (m ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add ((@_fvar.222527 n') ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + (m' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))))) (Mathlib.Tactic.Ring.add_pf_add_lt (Int.negOfNat 1).rawCast (Mathlib.Tactic.Ring.add_pf_zero_add ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1 + (m ^ Nat.rawCast 1 * Nat.rawCast 1 + ((@_fvar.222527 n') ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + (m' ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast + 0))))))) (Mathlib.Tactic.Ring.sub_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n')) (Mathlib.Tactic.Ring.atom_pf m') (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.cast_pos (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 1))) (Mathlib.Tactic.Ring.add_pf_add_gt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1 + (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0))))) (Mathlib.Tactic.Ring.add_congr (Mathlib.Tactic.Ring.atom_pf (@_fvar.222527 n)) (Mathlib.Tactic.Ring.atom_pf m) (Mathlib.Tactic.Ring.add_pf_add_lt ((@_fvar.222527 n) ^ Nat.rawCast 1 * Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_zero_add (m ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))) (Mathlib.Tactic.Ring.sub_pf (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑(@_fvar.222527 n)) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) (Mathlib.Tactic.Ring.neg_add (Mathlib.Tactic.Ring.neg_mul (↑m) (Nat.rawCast 1) (Mathlib.Tactic.Ring.neg_one_mul (Mathlib.Meta.NormNum.IsInt.to_raw_eq (Mathlib.Meta.NormNum.isInt_mul (Eq.refl HMul.hMul) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.negOfNat 1)))))) Mathlib.Tactic.Ring.neg_zero)) (Mathlib.Tactic.Ring.add_pf_add_lt (Nat.rawCast 1) (Mathlib.Tactic.Ring.add_pf_add_gt ((@_fvar.222527 n) ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast) (Mathlib.Tactic.Ring.add_pf_add_gt (m ^ Nat.rawCast 1 * (Int.negOfNat 1).rawCast) (Mathlib.Tactic.Ring.add_pf_add_zero ((@_fvar.222527 n') ^ Nat.rawCast 1 * Nat.rawCast 1 + (m' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0)))))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0)))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑(@_fvar.222527 n)) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑m) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑(@_fvar.222527 n')) (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_add_overlap_zero (Mathlib.Tactic.Ring.add_overlap_pf_zero (↑m') (Nat.rawCast 1) (Mathlib.Meta.NormNum.IsInt.to_isNat (Mathlib.Meta.NormNum.isInt_add (Eq.refl HAdd.hAdd) (Mathlib.Meta.NormNum.IsInt.of_raw (Int.negOfNat 1)) (Mathlib.Meta.NormNum.IsNat.to_isInt (Mathlib.Meta.NormNum.IsNat.of_raw 1)) (Eq.refl (Int.ofNat 0))))) (Mathlib.Tactic.Ring.add_pf_zero_add 0))))))) (Mathlib.Tactic.Ring.cast_zero (Mathlib.Meta.NormNum.isNat_ofNat (Eq.refl 0))))) (Mathlib.Tactic.Linarith.add_lt_of_neg_of_le (Mathlib.Tactic.Linarith.lt_of_lt_of_eq (neg_neg_of_pos Mathlib.Tactic.Linarith.zero_lt_one) (sub_eq_zero_of_eq (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_eq._simp_1 (@_fvar.222527 n + m) (@_fvar.222527 n' + m')) (congr (congrArg Eq (Nat.cast_add (@_fvar.222527 n) m)) (Nat.cast_add (@_fvar.222527 n') m'))) h)))) (Mathlib.Tactic.Linarith.sub_nonpos_of_le (Int.add_one_le_iff.mpr (id (Eq.mp (Eq.trans (Mathlib.Tactic.Zify.natCast_lt._simp_1 (@_fvar.222527 n' + m') (@_fvar.222527 n + m)) (congr (congrArg LT.lt (Nat.cast_add (@_fvar.222527 n') m')) (Nat.cast_add (@_fvar.222527 n) m))) this))))))))) hnm') hnmp:Af p f '' Set.univ All goals completed! 🐙 have hf' : Function.Bijective f' := CountablyInfinite {n | n.2 n.1} A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 pFunction.Injective f'A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 pFunction.Surjective f' A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 pFunction.Injective f' A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 pp:Aq:Ahpq:f' p = f' qp = q; A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 pp:Aq:Ahpq:f p = f qp = q; All goals completed! 🐙 A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 pl:hl:l f '' Set.univ a, f' a = l, hl; A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 pl:hl✝:l f '' Set.univhl: a b, (b_1 : (a, b) A), f (a, b), b_1 = l a, f' a = l, hl✝ A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 pn: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:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 phf':Function.Bijective _fvar.267542 := ?_mvar.284854AtMostCountable (f '' Set.univ); All goals completed! 🐙 have hfin : ¬ Finite A := CountablyInfinite {n | n.2 n.1} All goals completed! 🐙 A:?_mvar.222250 := {n | n.2 n.1}a: := fun n => m Finset.range (n + 1), mha:StrictMono _fvar.222527 := ?_mvar.222657f:_fvar.222278 := fun x => match x with | (n, m), property => @_fvar.222527 n + mhf:Function.Injective _fvar.222874 := ?_mvar.222886f':_fvar.222278 (_fvar.222874 '' Set.univ) := fun p => @_fvar.222874 p, @?_mvar.267539 phf':Function.Bijective _fvar.267542 := ?_mvar.284854this:Chapter8.CountablyInfinite _fvar.222278 Finite _fvar.222278 := ?_mvar.303058hfin:¬Finite _fvar.222278 := ?_mvar.303318CountablyInfinite {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), 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:Chapter8.CountablyInfinite {n | n.1 n.2} := ?_mvar.305784Set.univ = {n | n.2 n.1} {n | n.1 n.2}; upper_diag:Chapter8.CountablyInfinite {n | n.1 n.2} := ?_mvar.305784n:m:(n, m) Set.univ (n, m) {n | n.2 n.1} {n | n.1 n.2}; upper_diag:Chapter8.CountablyInfinite {n | n.1 n.2} := ?_mvar.305784n: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:?_mvar.318934 := Chapter8.AtMostCountable.image _fvar.316750 _fvar.318929CountablyInfinite have h : f '' .univ = .univ := CountablyInfinite All goals completed! 🐙 f: × {n | n 0} := fun x => match x with | (a, b) => a / bh:_fvar.318929 '' Set.univ = ?_mvar.318962 := ?_mvar.318967this:CountablyInfinite Finite CountablyInfinite have hfin : ¬ Finite := CountablyInfinite f: × {n | n 0} := fun x => match x with | (a, b) => a / bh:_fvar.318929 '' Set.univ = ?_mvar.318962 := ?_mvar.318967this✝:CountablyInfinite Finite this:Finite False replace : Finite (.univ : Set ) := CountablyInfinite f: × {n | n 0} := fun x => match x with | (a, b) => a / bh:_fvar.318929 '' Set.univ = ?_mvar.318962 := ?_mvar.318967this✝:CountablyInfinite Finite this:Finite Set.InjOn (fun x => x) Set.univ; f: × {n | n 0} := fun x => match x with | (a, b) => a / bh:_fvar.318929 '' Set.univ = ?_mvar.318962 := ?_mvar.318967this✝:CountablyInfinite Finite this:Finite x₁✝:a✝¹:x₁✝ Set.univx₂✝:a✝:x₂✝ Set.univ(fun x => x) x₁✝ = (fun x => x) x₂✝ x₁✝ = x₂✝; All goals completed! 🐙 f: × {n | n 0} := fun x => match x with | (a, b) => a / bh:_fvar.318929 '' Set.univ = ?_mvar.318962 := ?_mvar.318967this✝:CountablyInfinite Finite this:¬Infinite False f: × {n | n 0} := fun x => match x with | (a, b) => a / bh:_fvar.318929 '' Set.univ = ?_mvar.318962 := ?_mvar.318967this✝:CountablyInfinite Finite this:¬Infinite Infinite ; All goals completed! 🐙 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 keyword in the .

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