@@ -364,18 +364,18 @@ theorem lift_monotone : Monotone lift :=
364364#align cardinal.lift_monotone Cardinal.lift_monotone
365365
366366instance : Zero Cardinal.{u} :=
367- ⟨#PEmpty⟩
367+ -- `PEmpty` might be more canonical, but this is convenient for defeq with natCast
368+ ⟨lift #(Fin 0 )⟩
368369
369370instance : Inhabited Cardinal.{u} :=
370371 ⟨0 ⟩
371372
372373theorem mk_eq_zero (α : Type u) [IsEmpty α] : #α = 0 :=
373- (Equiv.equivPEmpty α ).cardinal_eq
374+ (Equiv.equivOfIsEmpty α (ULift (Fin 0 )) ).cardinal_eq
374375#align cardinal.mk_eq_zero Cardinal.mk_eq_zero
375376
376377@[simp]
377- theorem lift_zero : lift 0 = 0 :=
378- mk_congr (Equiv.equivPEmpty _)
378+ theorem lift_zero : lift 0 = 0 := mk_eq_zero _
379379#align cardinal.lift_zero Cardinal.lift_zero
380380
381381@[simp]
@@ -400,18 +400,19 @@ theorem mk_ne_zero (α : Type u) [Nonempty α] : #α ≠ 0 :=
400400#align cardinal.mk_ne_zero Cardinal.mk_ne_zero
401401
402402instance : One Cardinal.{u} :=
403- ⟨#PUnit⟩
403+ -- `PUnit` might be more canonical, but this is convenient for defeq with natCast
404+ ⟨lift #(Fin 1 )⟩
404405
405406instance : Nontrivial Cardinal.{u} :=
406407 ⟨⟨1 , 0 , mk_ne_zero _⟩⟩
407408
408409theorem mk_eq_one (α : Type u) [Unique α] : #α = 1 :=
409- (Equiv.equivPUnit α ).cardinal_eq
410+ (Equiv.equivOfUnique α (ULift (Fin 1 )) ).cardinal_eq
410411#align cardinal.mk_eq_one Cardinal.mk_eq_one
411412
412413theorem le_one_iff_subsingleton {α : Type u} : #α ≤ 1 ↔ Subsingleton α :=
413414 ⟨fun ⟨f⟩ => ⟨fun _ _ => f.injective (Subsingleton.elim _ _)⟩, fun ⟨h⟩ =>
414- ⟨⟨ fun _ => PUnit.unit , fun _ _ _ => h _ _⟩ ⟩⟩
415+ ⟨fun _ => ULift.up 0 , fun _ _ _ => h _ _⟩⟩
415416#align cardinal.le_one_iff_subsingleton Cardinal.le_one_iff_subsingleton
416417
417418@[simp]
@@ -429,19 +430,17 @@ theorem add_def (α β : Type u) : #α + #β = #(Sum α β) :=
429430 rfl
430431#align cardinal.add_def Cardinal.add_def
431432
432- -- Porting note: Should this be changed to
433- -- `⟨fun n => lift #(Fin n)⟩` in the future?
434433instance : NatCast Cardinal.{u} :=
435- ⟨Nat.unaryCast ⟩
434+ ⟨fun n => lift #(Fin n) ⟩
436435
437436@[simp]
438437theorem mk_sum (α : Type u) (β : Type v) : #(α ⊕ β) = lift.{v, u} #α + lift.{u, v} #β :=
439438 mk_congr (Equiv.ulift.symm.sumCongr Equiv.ulift.symm)
440439#align cardinal.mk_sum Cardinal.mk_sum
441440
442441@[simp]
443- theorem mk_option {α : Type u} : #(Option α) = #α + 1 :=
444- (Equiv.optionEquivSumPUnit α).cardinal_eq
442+ theorem mk_option {α : Type u} : #(Option α) = #α + 1 := by
443+ rw [ (Equiv.optionEquivSumPUnit.{u, u} α).cardinal_eq, mk_sum, mk_eq_one PUnit, lift_id, lift_id]
445444#align cardinal.mk_option Cardinal.mk_option
446445
447446@[simp]
@@ -450,16 +449,13 @@ theorem mk_psum (α : Type u) (β : Type v) : #(PSum α β) = lift.{v} #α + lif
450449#align cardinal.mk_psum Cardinal.mk_psum
451450
452451@[simp]
453- theorem mk_fintype (α : Type u) [h : Fintype α] : #α = Fintype.card α := by
454- refine Fintype.induction_empty_option ?_ ?_ ?_ α (h_fintype := h)
455- · intro α β h e hα
456- letI := Fintype.ofEquiv β e.symm
457- rwa [mk_congr e, Fintype.card_congr e] at hα
458- · rfl
459- · intro α h hα
460- simp [hα]
461- rfl
462- #align cardinal.mk_fintype Cardinal.mk_fintype
452+ theorem mk_fintype (α : Type u) [h : Fintype α] : #α = Fintype.card α :=
453+ mk_congr (Fintype.equivOfCardEq (by simp))
454+
455+ protected theorem cast_succ (n : ℕ) : ((n + 1 : ℕ) : Cardinal.{u}) = n + 1 := by
456+ change #(ULift.{u} (Fin (n+1 ))) = # (ULift.{u} (Fin n)) + 1
457+ rw [← mk_option, mk_fintype, mk_fintype]
458+ simp only [Fintype.card_ulift, Fintype.card_fin, Fintype.card_option]
463459
464460instance : Mul Cardinal.{u} :=
465461 ⟨map₂ Prod fun _ _ _ _ => Equiv.prodCongr⟩
@@ -505,12 +501,12 @@ theorem lift_power (a b : Cardinal.{u}) : lift.{v} (a ^ b) = ((lift.{v} a) ^ (li
505501
506502@[simp]
507503theorem power_zero {a : Cardinal} : (a ^ 0 ) = 1 :=
508- inductionOn a fun α => mk_congr <| Equiv.pemptyArrowEquivPUnit α
504+ inductionOn a fun _ => mk_eq_one _
509505#align cardinal.power_zero Cardinal.power_zero
510506
511507@[simp]
512- theorem power_one {a : Cardinal} : (a ^ 1 ) = a :=
513- inductionOn a fun α => mk_congr <| Equiv.punitArrowEquiv α
508+ theorem power_one {a : Cardinal.{u} } : (a ^ 1 ) = a :=
509+ inductionOn a fun α => mk_congr ( Equiv.funUnique (ULift.{u} (Fin 1 )) α)
514510#align cardinal.power_one Cardinal.power_one
515511
516512theorem power_add {a b c : Cardinal} : (a ^ (b + c)) = (a ^ b) * (a ^ c) :=
@@ -522,21 +518,25 @@ instance commSemiring : CommSemiring Cardinal.{u} where
522518 one := 1
523519 add := (· + ·)
524520 mul := (· * ·)
525- zero_add a := inductionOn a fun α => mk_congr <| Equiv.emptySum PEmpty α
526- add_zero a := inductionOn a fun α => mk_congr <| Equiv.sumEmpty α PEmpty
521+ zero_add a := inductionOn a fun α => mk_congr <| Equiv.emptySum (ULift (Fin 0 )) α
522+ add_zero a := inductionOn a fun α => mk_congr <| Equiv.sumEmpty α (ULift (Fin 0 ))
527523 add_assoc a b c := inductionOn₃ a b c fun α β γ => mk_congr <| Equiv.sumAssoc α β γ
528524 add_comm a b := inductionOn₂ a b fun α β => mk_congr <| Equiv.sumComm α β
529- zero_mul a := inductionOn a fun α => mk_congr <| Equiv.pemptyProd α
530- mul_zero a := inductionOn a fun α => mk_congr <| Equiv.prodPEmpty α
531- one_mul a := inductionOn a fun α => mk_congr <| Equiv.punitProd α
532- mul_one a := inductionOn a fun α => mk_congr <| Equiv.prodPUnit α
525+ zero_mul a := inductionOn a fun α => mk_eq_zero _
526+ mul_zero a := inductionOn a fun α => mk_eq_zero _
527+ one_mul a := inductionOn a fun α => mk_congr <| Equiv.uniqueProd α (ULift (Fin 1 ))
528+ mul_one a := inductionOn a fun α => mk_congr <| Equiv.prodUnique α (ULift (Fin 1 ))
533529 mul_assoc a b c := inductionOn₃ a b c fun α β γ => mk_congr <| Equiv.prodAssoc α β γ
534530 mul_comm := mul_comm'
535531 left_distrib a b c := inductionOn₃ a b c fun α β γ => mk_congr <| Equiv.prodSumDistrib α β γ
536532 right_distrib a b c := inductionOn₃ a b c fun α β γ => mk_congr <| Equiv.sumProdDistrib α β γ
537533 npow n c := c^n
538534 npow_zero := @power_zero
539- npow_succ n c := show (c ^ (n + 1 )) = c * (c ^ n) by rw [power_add, power_one, mul_comm']
535+ npow_succ n c := show (c ^ (n + 1 : ℕ)) = c * (c ^ n)
536+ by rw [Cardinal.cast_succ, power_add, power_one, mul_comm']
537+ natCast := (fun n => lift.{u} #(Fin n) : ℕ → Cardinal.{u})
538+ natCast_zero := rfl
539+ natCast_succ := Cardinal.cast_succ
540540
541541/-! Porting note: Deprecated section. Remove. -/
542542section deprecated
@@ -556,7 +556,7 @@ end deprecated
556556
557557@[simp]
558558theorem one_power {a : Cardinal} : (1 ^ a) = 1 :=
559- inductionOn a fun α => (Equiv.arrowPUnitEquivPUnit α).cardinal_eq
559+ inductionOn a fun _ => mk_eq_one _
560560#align cardinal.one_power Cardinal.one_power
561561
562562-- Porting note : simp can prove this
@@ -599,8 +599,7 @@ theorem pow_cast_right (a : Cardinal.{u}) (n : ℕ) : (a^(↑n : Cardinal.{u}))
599599#align cardinal.pow_cast_right Cardinal.pow_cast_right
600600
601601@[simp]
602- theorem lift_one : lift 1 = 1 :=
603- mk_congr <| Equiv.ulift.trans Equiv.punitEquivPUnit
602+ theorem lift_one : lift 1 = 1 := mk_eq_one _
604603#align cardinal.lift_one Cardinal.lift_one
605604
606605@[simp]
@@ -1312,7 +1311,7 @@ theorem nat_lt_lift_iff {n : ℕ} {a : Cardinal.{u}} : n < lift.{v} a ↔ n < a
13121311 rw [← lift_natCast.{v,u}, lift_lt]
13131312#align cardinal.nat_lt_lift_iff Cardinal.nat_lt_lift_iff
13141313
1315- theorem lift_mk_fin (n : ℕ) : lift #(Fin n) = n := by simp
1314+ theorem lift_mk_fin (n : ℕ) : lift #(Fin n) = n := rfl
13161315#align cardinal.lift_mk_fin Cardinal.lift_mk_fin
13171316
13181317theorem mk_coe_finset {α : Type u} {s : Finset α} : #s = ↑(Finset.card s) := by simp
@@ -1372,9 +1371,11 @@ theorem natCast_injective : Injective ((↑) : ℕ → Cardinal) :=
13721371#align cardinal.nat_cast_injective Cardinal.natCast_injective
13731372
13741373@ [simp, norm_cast]
1375- theorem nat_succ (n : ℕ) : (n.succ : Cardinal) = succ ↑n :=
1376- (add_one_le_succ _).antisymm (succ_le_of_lt <| natCast_lt.2 <| Nat.lt_succ_self _)
1377- #align cardinal.nat_succ Cardinal.nat_succ
1374+ theorem nat_succ (n : ℕ) : (n.succ : Cardinal) = succ ↑n := by
1375+ rw [Nat.cast_succ]
1376+ refine (add_one_le_succ _).antisymm (succ_le_of_lt ?_)
1377+ rw [← Nat.cast_succ]
1378+ exact natCast_lt.2 (Nat.lt_succ_self _)
13781379
13791380@[simp]
13801381theorem succ_zero : succ (0 : Cardinal) = 1 := by norm_cast
0 commit comments