Analysis I, Section 8.1: Countability
I have attempted to make the translation as faithful a paraphrasing as possible of the original text. When there is a choice between a more idiomatic Lean solution and a more faithful translation, I have generally chosen the latter. In particular, there will be places where the Lean code could be "golfed" to be more elegant and idiomatic, but I have consciously avoided doing so.
Main constructions and results of this section:
-
Custom notions for "equal cardinality", "countable", and "at most countable". Note that Mathlib's
Countabletypeclass corresponds to what we call "at most countable" in this text. -
Countability of the integers and rationals.
Note that as the Chapter 3 set theory has been deprecated, we will not re-use relevant constructions from that theory here, replacing them with Mathlib counterparts instead.
namespace Chapter8
The definition of equal cardinality. For simplicity we restrict attention to the Type 0 universe.
This is analogous to Chapter3.SetTheory.Set.EqualCard, but we are not using the latter since
the Chapter 3 set theory is deprecated.
abbrev EqualCard (X Y : Type) : Prop := ∃ f : X → Y, Function.Bijective f
Relation with Mathlib's Equiv concept
theorem EqualCard.iff {X Y : Type} : EqualCard X Y ↔ Nonempty (X ≃ Y) := X:TypeY:Type⊢ EqualCard 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:Type⊢ Nonempty (X ≃ Y) → ∃ f, Function.Bijective f
X:TypeY:Type⊢ (∃ f, Function.Bijective f) → Nonempty (X ≃ Y) X:TypeY:Typef:X → Yhf:Function.Bijective f⊢ Nonempty (X ≃ Y); All goals completed! 🐙
X:TypeY:Typee:X ≃ Y⊢ ∃ f, Function.Bijective f; All goals completed! 🐙
Equivalence with Mathlib's Cardinal.mk concept
theorem EqualCard.iff' {X Y : Type} : EqualCard X Y ↔ Cardinal.mk X = Cardinal.mk Y := X:TypeY:Type⊢ EqualCard X Y ↔ Cardinal.mk X = Cardinal.mk Y
All goals completed! 🐙theorem EqualCard.refl (X : Type) : EqualCard X X := sorrytheorem EqualCard.symm {X Y : Type} (hXY : EqualCard X Y) : EqualCard Y X := X:TypeY:TypehXY:EqualCard X Y⊢ EqualCard Y X
All goals completed! 🐙theorem 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 Z⊢ EqualCard 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:Type⊢ Function.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 Y⊢ Finite X ↔ Finite Y X:TypeY:Typef:X → Yhf:Function.Bijective f⊢ Finite 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 Y⊢ AtMostCountable X ↔ AtMostCountable Y
All goals completed! 🐙
Equivalence with Mathlib's Denumerable concept (cf. Remark 8.1.2)
theorem CountablyInfinite.iff (X : Type) : CountablyInfinite X ↔ Nonempty (Denumerable X) := X:Type⊢ CountablyInfinite X ↔ Nonempty (Denumerable X)
X:Type⊢ Nonempty (X ≃ ℕ) ↔ Nonempty (Denumerable X); X:Type⊢ Nonempty (X ≃ ℕ) → Nonempty (Denumerable X)X:Type⊢ Nonempty (Denumerable X) → Nonempty (X ≃ ℕ)
X:Type⊢ Nonempty (X ≃ ℕ) → Nonempty (Denumerable X) X:Typee:X ≃ ℕ⊢ Nonempty (Denumerable X); All goals completed! 🐙
X:Typeh:Denumerable X⊢ Nonempty (X ≃ ℕ); All goals completed! 🐙
Equivalence with Mathlib's Countable typeclass
theorem CountablyInfinite.iff' (X : Type) : CountablyInfinite X ↔ Countable X ∧ Infinite X := X:Type⊢ CountablyInfinite X ↔ Countable X ∧ Infinite X
All goals completed! 🐙theorem CountablyInfinite.toCountable {X : Type} (hX: CountablyInfinite X) : Countable X := X:TypehX:CountablyInfinite X⊢ Countable X
All goals completed! 🐙theorem CountablyInfinite.toInfinite {X : Type} (hX: CountablyInfinite X) : Infinite X := X:TypehX:CountablyInfinite X⊢ Infinite X
All goals completed! 🐙theorem AtMostCountable.iff (X : Type) : AtMostCountable X ↔ Countable X := X:Type⊢ AtMostCountable X ↔ Countable X
X:Typeh1:CountablyInfinite X ↔ Countable X ∧ Infinite X⊢ AtMostCountable X ↔ Countable X
X:Typeh1:CountablyInfinite X ↔ Countable X ∧ Infinite Xh2:Finite X ∨ Infinite X⊢ AtMostCountable X ↔ Countable X
X:Typeh1:CountablyInfinite X ↔ Countable X ∧ Infinite Xh2:Finite X ∨ Infinite Xh3:Finite X → Countable X⊢ AtMostCountable 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 A⊢ CountablyInfinite ↑X ↔ ∃ f, X = ⇑f '' Set.univ
A:TypeX:Set A⊢ CountablyInfinite ↑X → ∃ f, X = ⇑f '' Set.univA:TypeX:Set A⊢ (∃ f, X = ⇑f '' Set.univ) → CountablyInfinite ↑X
A:TypeX:Set A⊢ CountablyInfinite ↑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 g⊢ Function.Injective (Subtype.val ∘ f)A:TypeX:Set Ag:↑X → ℕhg:Function.Bijective gf:ℕ → ↑Xhleft:Function.LeftInverse f ghright:Function.RightInverse f g⊢ X = ⇑{ 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 g⊢ Function.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) y⊢ x = y; A:TypeX:Set Ag:↑X → ℕhg:Function.Bijective gf:ℕ → ↑Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx:ℕy:ℕhxy:(Subtype.val ∘ f) x = (Subtype.val ∘ f) y⊢ f x = f y; All goals completed! 🐙
A:TypeX:Set Ag:↑X → ℕhg:Function.Bijective gf:ℕ → ↑Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:A⊢ x✝ ∈ 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✝:A⊢ x✝ ∈ X ↔ ∃ y, ↑(f y) = x✝; A:TypeX:Set Ag:↑X → ℕhg:Function.Bijective gf:ℕ → ↑Xhleft:Function.LeftInverse f ghright:Function.RightInverse f gx✝:A⊢ x✝ ∈ 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✝:A⊢ 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⊢ ∃ 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.univ⊢ CountablyInfinite ↑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, hy⟩⊢ ⟨x, 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! 🐙
example : CountablyInfinite (.univ \ {0}: Set ℕ) := ⊢ CountablyInfinite ↑(Set.univ \ {0}) All goals completed! 🐙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 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 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 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.Nonempty⊢ min 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! 🐙example : Nat.min ((fun n ↦ 2*n) '' (.Ici 1)) = 2 := ⊢ Nat.min ((fun n => 2 * n) '' Set.Ici 1) = 2 All goals completed! 🐙theorem Nat.min_eq_sInf {X : Set ℕ} (hX : X.Nonempty) : min X = sInf X := X:Set ℕhX:X.Nonempty⊢ min 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.Nonempty⊢ min X = Nat.find hX
X:Set ℕhX:X.Nonempty⊢ Nat.find hX = min X; X:Set ℕhX:X.Nonempty⊢ min X ∈ X ∧ ∀ n < min X, n ∉ X; X:Set ℕhX:X.Nonemptythis:?_mvar.142721 := Chapter8.Nat.min_spec _fvar.141846⊢ min X ∈ X ∧ ∀ n < min X, n ∉ X; All goals completed! 🐙Proposition 8.1.5
theorem 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 n⟩x:ℕy:ℕhxy:f x = f y⊢ x = 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 n⟩x:ℕy:ℕhxy:a x = a y⊢ x = 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 n⟩hf_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 n⟩hf_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 n⟩hf_injective:Function.Injective _fvar.149178 := ?_mvar.149339x:ℕhx:x ∈ Xx✝:¬∃ a_1, a a_1 = x⊢ False
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 n⟩hf_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 n⟩hf_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 n⟩hf_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 n⟩hf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g:ℕ → ↑Xhg_bijective:Function.Bijective ghg_mono:StrictMono g⊢ 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 n⟩hf_injective:Function.Injective _fvar.149178 := ?_mvar.149339hf_surjective:Function.Surjective _fvar.149178 := ?_mvar.150710g:ℕ → ↑Xhg_bijective:Function.Bijective ghg_mono:StrictMono gthis:g ≠ f⊢ False
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 n⟩hf_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 n⟩hf_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 n⟩hf_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 n⟩hf_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).left⊢ False
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 n⟩hf_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 n⊢ False; 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 n⟩hf_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 n⊢ n ∈ {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 n⟩hf_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 m⊢ 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 n⟩hf_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:¬False⊢ g m = f m; All goals completed! 🐙theorem Nat.countable_of_infinite (X : Set ℕ) [Infinite X] : CountablyInfinite X := X:Set ℕinst✝:Infinite ↑X⊢ CountablyInfinite ↑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 ↑X⊢ AtMostCountable ↑XX:Set ℕh✝:Infinite ↑X⊢ AtMostCountable ↑X
X:Set ℕh✝:Finite ↑X⊢ AtMostCountable ↑X All goals completed! 🐙
All goals completed! 🐙Corollary 8.1.7
theorem AtMostCountable.subset {X: Type} (hX : AtMostCountable X) (Y: Set X) : AtMostCountable Y := X:TypehX:AtMostCountable XY:Set X⊢ AtMostCountable ↑Y
-- This proof is written to follow the structure of the original text.
X:TypeY:Set Xf:X → ℕhf:Function.Bijective f⊢ AtMostCountable ↑YX:TypeY:Set XhX:Finite X⊢ AtMostCountable ↑Y
X:TypeY:Set Xf:X → ℕhf:Function.Bijective f⊢ AtMostCountable ↑Y let f' : Y → f '' Y := fun y ↦ ⟨ f y, X:TypeY:Set Xf:X → ℕhf:Function.Bijective fy:↑Y⊢ f ↑y ∈ f '' Y All goals completed! 🐙 ⟩
have hf' : Function.Bijective f' := X:TypehX:AtMostCountable XY:Set X⊢ AtMostCountable ↑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 y⟩hf':Function.Bijective _fvar.169260 := ?_mvar.184590⊢ AtMostCountable ↑(f '' Y); All goals completed! 🐙
All goals completed! 🐙theorem AtMostCountable.subset' {A: Type} {X Y: Set A} (hX: AtMostCountable X) (hY: Y ⊆ X) : AtMostCountable Y := A:TypeX:Set AY:Set AhX:AtMostCountable ↑XhY:Y ⊆ X⊢ AtMostCountable ↑Y
A:TypeX:Set AY:Set AhX:AtMostCountable ↑XhY:Y ⊆ X⊢ Function.Injective fun y => ⟨↑↑y, ⋯⟩A:TypeX:Set AY:Set AhX:AtMostCountable ↑XhY:Y ⊆ X⊢ Function.Surjective fun y => ⟨↑↑y, ⋯⟩
A:TypeX:Set AY:Set AhX:AtMostCountable ↑XhY:Y ⊆ X⊢ Function.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 ∈ Y⊢ ⟨y, ⋯⟩ ∈ {x | ↑x ∈ Y} All goals completed! 🐙 ⟩Proposition 8.1.8 / Exercise 8.1.4
theorem AtMostCountable.image_nat (Y: Type) (f: ℕ → Y) : AtMostCountable (f '' .univ) := Y:Typef:ℕ → Y⊢ AtMostCountable ↑(f '' Set.univ)
All goals completed! 🐙Corollary 8.1.9 / Exercise 8.1.5
theorem AtMostCountable.image {X:Type} (hX: CountablyInfinite X) {Y: Type} (f: X → Y) : AtMostCountable (f '' .univ) := X:TypehX:CountablyInfinite XY:Typef:X → Y⊢ AtMostCountable ↑(f '' Set.univ)
All goals completed! 🐙Proposition 8.1.10 / Exercise 8.1.7
theorem 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 ↑Y⊢ CountablyInfinite ↑(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 ≤ n⊢ ↑n.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.197742⊢ Set.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.216738⊢ CountablyInfinite ↑Set.univLemma 8.1.12
theorem 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), m⊢ CountablyInfinite ↑{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 + m⊢ CountablyInfinite ↑{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' < 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 ≤ 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' < 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! 🐙
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:↑A⊢ f 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 p⟩⊢ Function.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 p⟩⊢ Function.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 p⟩⊢ Function.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 p⟩p:↑Aq:↑Ahpq:f' p = f' q⊢ p = 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 p⟩p:↑Aq:↑Ahpq:f p = f q⊢ p = 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 p⟩l:ℕ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 p⟩l:ℕhl✝:l ∈ f '' Set.univhl:∃ a b, ∃ (b_1 : (a, b) ∈ A), f ⟨(a, b), b_1⟩ = l⊢ ∃ a, f' a = ⟨l, hl✝⟩
A:?_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 p⟩n:ℕm:ℕq:(n, m) ∈ Ahl:f ⟨(n, m), q⟩ ∈ f '' Set.univ⊢ ∃ a, f' a = ⟨f ⟨(n, m), q⟩, hl⟩; All goals completed! 🐙
have : AtMostCountable A := ⊢ CountablyInfinite ↑{n | n.2 ≤ n.1} A:?_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 p⟩hf':Function.Bijective _fvar.267542 := ?_mvar.284854⊢ AtMostCountable ↑(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 p⟩hf':Function.Bijective _fvar.267542 := ?_mvar.284854this:Chapter8.CountablyInfinite ↑_fvar.222278 ∨ Finite ↑_fvar.222278 := ?_mvar.303058hfin:¬Finite ↑_fvar.222278 := ?_mvar.303318⊢ CountablyInfinite ↑{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.305784⊢ Set.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 CountablyInfinite.prod {X Y:Type} (hX: CountablyInfinite X) (hY: CountablyInfinite Y) :
CountablyInfinite (X × Y) := X:TypeY:TypehX:CountablyInfinite XhY:CountablyInfinite Y⊢ CountablyInfinite (X × Y)
All goals completed! 🐙Corollary 8.1.15
theorem 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 / ↑↑b⊢ CountablyInfinite ℚ
f:ℤ × ↑{n | n ≠ 0} → ℚ :=
fun x =>
match x with
| (a, b) => ↑a / ↑↑bthis:?_mvar.318934 := Chapter8.AtMostCountable.image _fvar.316750 _fvar.318929⊢ CountablyInfinite ℚ
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
example (X: Type) : Infinite X ↔ ∃ Y : Set X, Y ≠ .univ ∧ EqualCard Y X := X:Type⊢ Infinite X ↔ ∃ Y, Y ≠ Set.univ ∧ EqualCard (↑Y) X
All goals completed! 🐙Exercise 8.1.6
example (A: Type) : AtMostCountable A ↔ ∃ f : A → ℕ, Function.Injective f := A:Type⊢ AtMostCountable A ↔ ∃ f, Function.Injective f
All goals completed! 🐙Exercise 8.1.9
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! 🐙theorem explicit_bijection_spec : Function.Bijective explicit_bijection := ⊢ Function.Bijective explicit_bijection All goals completed! 🐙end Chapter8