Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 638b7fd

Browse files
committed
feat(set_theory/cardinal): finite lower bound on cardinality
1 parent 9699f8d commit 638b7fd

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

data/fintype.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ instance finset.subtype.fintype (s : finset α) : fintype {x // x ∈ s} :=
315315
instance finset_coe.fintype (s : finset α) : fintype (↑s : set α) :=
316316
finset.subtype.fintype s
317317

318+
@[simp] lemma fintype.card_coe (s : finset α) :
319+
fintype.card (↑s : set α) = s.card := card_attach
320+
318321
instance plift.fintype (p : Prop) [decidable p] : fintype (plift p) :=
319322
if h : p then finset.singleton ⟨h⟩ else ∅, λ ⟨h⟩, by simp [h]⟩
320323

data/set/finite.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ noncomputable def finite.to_finset {s : set α} (h : finite s) : finset α :=
5555
@[simp] theorem finite.mem_to_finset {s : set α} {h : finite s} {a : α} : a ∈ h.to_finset ↔ a ∈ s :=
5656
@mem_to_finset _ _ (finite.fintype h) _
5757

58+
theorem finite.exists_finset {s : set α} : finite s →
59+
∃ s' : finset α, ∀ a : α, a ∈ s' ↔ a ∈ s
60+
| ⟨h⟩ := by exactI ⟨to_finset s, λ _, mem_to_finset⟩
61+
5862
theorem finite_mem_finset (s : finset α) : finite {a | a ∈ s} :=
5963
⟨fintype_of_finset s (λ _, iff.rfl)⟩
6064

set_theory/cardinal.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,14 @@ theorem fintype_card (α : Type u) [fintype α] : mk α = fintype.card α :=
525525
by rw [← lift_mk_fin.{u}, ← lift_id (mk α), lift_mk_eq.{u 0 u}];
526526
exact fintype.card_eq.1 (by simp)
527527

528+
theorem card_le_of_finset {α} (s : finset α) :
529+
(s.card : cardinal) ≤ cardinal.mk α :=
530+
begin
531+
rw (_ : (s.card : cardinal) = cardinal.mk (↑s : set α)),
532+
{ exact ⟨function.embedding.subtype _⟩ },
533+
rw [cardinal.fintype_card, fintype.card_coe]
534+
end
535+
528536
@[simp] theorem nat_cast_pow {m n : ℕ} : (↑(pow m n) : cardinal) = m ^ n :=
529537
by induction n; simp [nat.pow_succ, -_root_.add_comm, power_add, *]
530538

0 commit comments

Comments
 (0)