Skip to content

Commit e5837f6

Browse files
committed
apply suggestion
1 parent 16ffd29 commit e5837f6

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

Mathlib/SetTheory/ZFC/Basic.lean

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -398,22 +398,35 @@ theorem mem_omega : x ∈ omega ↔ ∃ (n : ℕ), x = n := by
398398
simp [omega, PSet.mem_omega, Nat.cast, NatCast.natCast, eq]
399399

400400
@[simp]
401-
theorem omega_zero : ∅ ∈ omega :=
402-
⟨⟨0⟩, Equiv.rfl⟩
401+
theorem natCast_mem_omega (n : ℕ) : ↑n ∈ omega := by
402+
simp [mem_omega]
403403

404404
@[simp]
405-
theorem omega_succ {x} : x ∈ omega.{u} → insert x x ∈ omega.{u} := by
405+
theorem omega_zero : ∅ ∈ omega := by
406+
simp [← natCast_zero]
407+
408+
@[simp]
409+
theorem omega_succ : x ∈ omega → insert x x ∈ omega := by
406410
simp only [mem_omega, forall_exists_index]
407411
rintro n rfl
408412
exact ⟨n + 1, by simp⟩
409413

410-
/-- `omega` is the smallest inductive set. -/
411-
theorem omega_subset {x} : ∅ ∈ x → (∀ y ∈ x, insert y y ∈ x) → omega ⊆ x := by
412-
intro _ _ _ h
413-
rw [mem_omega] at h
414-
rcases h with ⟨n, rfl⟩
414+
@[elab_as_elim]
415+
theorem omega_induction_on {motive : ∀ x ∈ omega, Prop} (hx : x ∈ omega)
416+
(omega_zero : motive ∅ omega_zero)
417+
(omega_succ : ∀ {x} (hx : x ∈ omega), motive x hx → motive (insert x x) (omega_succ hx)) :
418+
motive x hx := by
419+
rcases mem_omega.1 hx with ⟨n, rfl⟩
415420
induction n with simp [*]
416421

422+
theorem omega_subset : ∅ ∈ x → (∀ y ∈ x, insert y y ∈ x) → omega ⊆ x := by
423+
intro _ _ _ h
424+
induction h using omega_induction_on with simp [*]
425+
426+
/-- `omega` is the smallest inductive set. -/
427+
theorem isLeast_inductive_omega : IsLeast {x | ∅ ∈ x ∧ ∀ y ∈ x, insert y y ∈ x} omega := by
428+
simp +contextual [IsLeast, mem_lowerBounds, omega_subset]
429+
417430
/-- `{x ∈ a | p x}` is the set of elements in `a` satisfying `p` -/
418431
protected def sep (p : ZFSet → Prop) : ZFSet → ZFSet :=
419432
Quotient.map (PSet.sep fun y => p (mk y))

0 commit comments

Comments
 (0)