@@ -286,19 +286,27 @@ instance : has_zero cardinal.{u} := ⟨⟦ulift empty⟧⟩
286
286
287
287
instance : inhabited cardinal.{u} := ⟨0 ⟩
288
288
289
- theorem ne_zero_iff_nonempty {α : Type u} : @ne cardinal ⟦α⟧ 0 ↔ nonempty α :=
289
+ theorem ne_zero_iff_nonempty {α : Type u} : mk α ≠ 0 ↔ nonempty α :=
290
290
not_iff_comm.1
291
291
⟨λ h, quotient.sound ⟨(equiv.empty_of_not_nonempty h).trans equiv.ulift.symm⟩,
292
292
λ e, let ⟨h⟩ := quotient.exact e in λ ⟨a⟩, (h a).down.elim⟩
293
293
294
294
instance : has_one cardinal.{u} := ⟨⟦ulift unit⟧⟩
295
295
296
+ instance : zero_ne_one_class cardinal.{u} :=
297
+ { zero := 0 , one := 1 , zero_ne_one :=
298
+ ne.symm $ ne_zero_iff_nonempty.2 ⟨⟨()⟩⟩ }
299
+
300
+ theorem le_one_iff_subsingleton {α : Type u} : mk α ≤ 1 ↔ subsingleton α :=
301
+ ⟨λ ⟨f⟩, ⟨λ a b, f.inj (subsingleton.elim _ _)⟩,
302
+ λ ⟨h⟩, ⟨⟨λ a, ⟨()⟩, λ a b _, h _ _⟩⟩⟩
303
+
296
304
instance : has_add cardinal.{u} :=
297
- ⟨λq₁ q₂, quotient.lift_on₂ q₁ q₂ (λα β, ⟦ α ⊕ β ⟧ ) $ assume α β γ δ ⟨e₁⟩ ⟨e₂⟩,
305
+ ⟨λq₁ q₂, quotient.lift_on₂ q₁ q₂ (λα β, mk ( α ⊕ β) ) $ assume α β γ δ ⟨e₁⟩ ⟨e₂⟩,
298
306
quotient.sound ⟨equiv.sum_congr e₁ e₂⟩⟩
299
307
300
308
instance : has_mul cardinal.{u} :=
301
- ⟨λq₁ q₂, quotient.lift_on₂ q₁ q₂ (λα β, ⟦ α × β ⟧ ) $ assume α β γ δ ⟨e₁⟩ ⟨e₂⟩,
309
+ ⟨λq₁ q₂, quotient.lift_on₂ q₁ q₂ (λα β, mk ( α × β) ) $ assume α β γ δ ⟨e₁⟩ ⟨e₂⟩,
302
310
quotient.sound ⟨equiv.prod_congr e₁ e₂⟩⟩
303
311
304
312
private theorem add_comm (a b : cardinal.{u}) : a + b = b + a :=
@@ -345,7 +353,7 @@ instance : comm_semiring cardinal.{u} :=
345
353
by rw [mul_comm (a + b) c, left_distrib c a b, mul_comm c a, mul_comm c b] }
346
354
347
355
protected def power (a b : cardinal.{u}) : cardinal.{u} :=
348
- quotient.lift_on₂ a b (λα β, ⟦ β → α⟧ ) $ assume α₁ α₂ β₁ β₂ ⟨e₁⟩ ⟨e₂⟩,
356
+ quotient.lift_on₂ a b (λα β, mk ( β → α) ) $ assume α₁ α₂ β₁ β₂ ⟨e₁⟩ ⟨e₂⟩,
349
357
quotient.sound ⟨equiv.arrow_congr e₂ e₁⟩
350
358
351
359
local notation a ^ b := cardinal.power a b
@@ -362,7 +370,7 @@ quotient.induction_on a $ assume α, quotient.sound ⟨
362
370
equiv.trans (equiv.arrow_unit_equiv_unit α) $
363
371
equiv.ulift.symm⟩
364
372
365
- @[simp] theorem prop_eq_two : @eq cardinal.{u} ⟦ ulift Prop ⟧ 2 :=
373
+ @[simp] theorem prop_eq_two : mk ( ulift Prop ) = 2 :=
366
374
quot.sound ⟨equiv.ulift.trans $ equiv.Prop_equiv_bool.trans $
367
375
equiv.bool_equiv_unit_sum_unit.trans
368
376
(equiv.sum_congr equiv.ulift equiv.ulift).symm⟩
@@ -395,6 +403,9 @@ open sum
395
403
theorem zero_le (a : cardinal.{u}) : 0 ≤ a :=
396
404
quot.induction_on a $ λ α, ⟨embedding.of_not_nonempty $ λ ⟨⟨a⟩⟩, a.elim⟩
397
405
406
+ theorem zero_lt_one : (0 : cardinal) < 1 :=
407
+ lt_of_le_of_ne (zero_le _) zero_ne_one
408
+
398
409
theorem add_mono {a b c d : cardinal.{u}} : a ≤ b → c ≤ d → a + c ≤ b + d :=
399
410
quotient.induction_on₂ a b $ assume α β, quotient.induction_on₂ c d $ assume γ δ ⟨e₁⟩ ⟨e₂⟩,
400
411
⟨embedding.sum_congr e₁ e₂⟩
@@ -442,29 +453,28 @@ quot.induction_on a (λ α, ⟨⟨⟨λ a b, ⟨a = b⟩,
442
453
instance : no_top_order cardinal.{u} :=
443
454
{ no_top := λ a, ⟨_, cantor a⟩, ..cardinal.linear_order }
444
455
445
- def min {ι} [inhabited ι] (f : ι → cardinal) : cardinal :=
456
+ def min {ι} (I : nonempty ι) (f : ι → cardinal) : cardinal :=
446
457
f $ classical.some $
447
- @embedding.injective_min _ (λ i, (f i).out) nonempty_of_inhabited
458
+ @embedding.injective_min _ (λ i, (f i).out) I
448
459
449
- theorem min_eq {ι} [inhabited ι] (f : ι → cardinal) : ∃ i, min f = f i :=
460
+ theorem min_eq {ι} (I) (f : ι → cardinal) : ∃ i, min I f = f i :=
450
461
⟨_, rfl⟩
451
462
452
- theorem min_le {ι} [inhabited ι] (f : ι → cardinal) (i) : min f ≤ f i :=
453
- by rw [← quotient.out_eq (min f), ← quotient.out_eq (f i)]; exact
463
+ theorem min_le {ι I} (f : ι → cardinal) (i) : min I f ≤ f i :=
464
+ by rw [← quotient.out_eq (min I f), ← quotient.out_eq (f i)]; exact
454
465
let ⟨g, hg⟩ := classical.some_spec
455
- (@embedding.injective_min _ (λ i, (f i).out) nonempty_of_inhabited ) i in
466
+ (@embedding.injective_min _ (λ i, (f i).out) I ) i in
456
467
⟨⟨g, hg⟩⟩
457
468
458
- theorem le_min {ι} [inhabited ι] {f : ι → cardinal} {a} : a ≤ min f ↔ ∀ i, a ≤ f i :=
469
+ theorem le_min {ι I} {f : ι → cardinal} {a} : a ≤ min I f ↔ ∀ i, a ≤ f i :=
459
470
⟨λ h i, le_trans h (min_le _ _),
460
- λ h, let ⟨i, e⟩ := min_eq f in e.symm ▸ h i⟩
471
+ λ h, let ⟨i, e⟩ := min_eq I f in e.symm ▸ h i⟩
461
472
462
473
protected theorem wf : @well_founded cardinal.{u} (<) :=
463
474
⟨λ a, classical.by_contradiction $ λ h,
464
475
let ι := {c :cardinal // ¬ acc (<) c},
465
- f : ι → cardinal := subtype.val in
466
- by have : inhabited ι := ⟨⟨_, h⟩⟩; exact
467
- let ⟨⟨c, hc⟩, hi⟩ := min_eq f in
476
+ f : ι → cardinal := subtype.val,
477
+ ⟨⟨c, hc⟩, hi⟩ := @min_eq ι ⟨⟨_, h⟩⟩ f in
468
478
hc (acc.intro _ (λ j ⟨_, h'⟩,
469
479
classical.by_contradiction $ λ hj, h' $
470
480
by have := min_le f ⟨j, hj⟩; rwa hi at this ))⟩
@@ -475,11 +485,11 @@ def succ (c : cardinal) : cardinal :=
475
485
@min {c' // c < c'} ⟨⟨_, cantor _⟩⟩ subtype.val
476
486
477
487
theorem lt_succ_self (c : cardinal) : c < succ c :=
478
- by cases min_eq _ with s e; rw [succ, e]; exact s.2
488
+ by cases min_eq _ _ with s e; rw [succ, e]; exact s.2
479
489
480
490
theorem succ_le {a b : cardinal} : succ a ≤ b ↔ a < b :=
481
491
⟨lt_of_lt_of_le (lt_succ_self _), λ h,
482
- by exact @ min_le _ ⟨_⟩ _ (subtype.mk b h)⟩
492
+ by exact min_le _ (subtype.mk b h)⟩
483
493
484
494
theorem add_one_le_succ (c : cardinal) : c + 1 ≤ succ c :=
485
495
begin
@@ -508,7 +518,7 @@ def sup {ι} (f : ι → cardinal) : cardinal :=
508
518
@min {c // ∀ i, f i ≤ c} ⟨⟨sum f, le_sum f⟩⟩ (λ a, a.1 )
509
519
510
520
theorem le_sup {ι} (f : ι → cardinal) (i) : f i ≤ sup f :=
511
- by dsimp [sup]; cases min_eq _ with c hc; rw hc; exact c.2 i
521
+ by dsimp [sup]; cases min_eq _ _ with c hc; rw hc; exact c.2 i
512
522
513
523
theorem sup_le {ι} (f : ι → cardinal) (a) : sup f ≤ a ↔ ∀ i, f i ≤ a :=
514
524
⟨λ h i, le_trans (le_sup _ _) h,
@@ -570,13 +580,13 @@ quotient.sound ⟨equiv.ulift.trans (equiv.prod_congr equiv.ulift equiv.ulift).s
570
580
quotient.induction_on₂ a b $ λ α β,
571
581
quotient.sound ⟨equiv.ulift.trans (equiv.arrow_congr equiv.ulift equiv.ulift).symm⟩
572
582
573
- @[simp] theorem lift_min {ι} [inhabited ι] (f : ι → cardinal) : lift (min f) = min (lift ∘ f) :=
583
+ @[simp] theorem lift_min {ι I} (f : ι → cardinal) : lift (min I f) = min I (lift ∘ f) :=
574
584
le_antisymm (le_min.2 $ λ a, lift_le.2 $ min_le _ a) $
575
- let ⟨i, e⟩ := min_eq (lift ∘ f) in
585
+ let ⟨i, e⟩ := min_eq I (lift ∘ f) in
576
586
by rw e; exact lift_le.2 (le_min.2 $ λ j, lift_le.1 $
577
587
by have := min_le (lift ∘ f) j; rwa e at this )
578
588
579
- def ω : cardinal.{u} := lift (mk ℕ)
589
+ def omega : cardinal.{u} := lift (mk ℕ)
580
590
581
591
@[simp] theorem mk_fin : ∀ (n : ℕ), mk (fin n) = n
582
592
| 0 := quotient.sound ⟨(equiv.empty_of_not_nonempty $
@@ -613,15 +623,19 @@ by simp [le_antisymm_iff]
613
623
@[simp] theorem nat_succ (n : ℕ) : succ n = n.succ :=
614
624
le_antisymm (succ_le.2 $ nat_cast_lt.2 $ nat.lt_succ_self _) (add_one_le_succ _)
615
625
616
- theorem nat_lt_ω (n : ℕ) : (n : cardinal.{u}) < ω :=
617
- succ_le.1 $ by rw [nat_succ, ← lift_mk_fin, ω, lift_mk_le.{0 0 u}]; exact
626
+ @[simp] theorem succ_zero : succ 0 = 1 :=
627
+ by simpa using nat_succ 0
628
+
629
+ theorem nat_lt_omega (n : ℕ) : (n : cardinal.{u}) < omega :=
630
+ succ_le.1 $ by rw [nat_succ, ← lift_mk_fin, omega, lift_mk_le.{0 0 u}]; exact
618
631
⟨⟨fin.val, λ a b, fin.eq_of_veq⟩⟩
619
632
620
633
/-
621
- theorem lt_ω {c : cardinal} : c < ω ↔ ∃ n : ℕ, c = n :=
634
+ theorem lt_omega {c : cardinal} : c < omega ↔ ∃ n : ℕ, c = n :=
622
635
⟨λ h, begin
623
636
cases le_mk_iff_exists_set.1 h.1 with S e, rw ← e,
624
- end, λ ⟨n, e⟩, e.symm ▸ nat_lt_ω _⟩
637
+
638
+ end, λ ⟨n, e⟩, e.symm ▸ nat_lt_omega _⟩
625
639
-/
626
640
627
641
end cardinal
0 commit comments