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

Commit 94205c4

Browse files
urkudChrisHughes24
authored andcommitted
feat(data/fintype): prove card (subtype p) ≤ card α (#1383)
* feat(data/fintype): prove `card (subtype p) ≤ card α` * Add `cardinal.mk_le_of_subtype` * Rename `mk_le_of_subtype` to `mk_subtype_le`, use it in `mk_set_le` Earlier both `mk_subtype_le` and `mk_set_le` took `set α` as an argument. Now `mk_subtype_le` takes `α → Prop`.
1 parent 227b682 commit 94205c4

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/data/fintype.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,10 @@ instance finset.fintype [fintype α] : fintype (finset α) :=
439439
instance subtype.fintype [fintype α] (p : α → Prop) [decidable_pred p] : fintype {x // p x} :=
440440
set_fintype _
441441

442+
theorem fintype.card_subtype_le [fintype α] (p : α → Prop) [decidable_pred p] :
443+
fintype.card {x // p x} ≤ fintype.card α :=
444+
by rw fintype.subtype_card; exact card_le_of_subset (subset_univ _)
445+
442446
instance psigma.fintype {α : Type*} {β : α → Type*} [fintype α] [∀ a, fintype (β a)] :
443447
fintype (Σ' a, β a) :=
444448
fintype.of_equiv _ (equiv.psigma_equiv_sigma _).symm

src/data/real/cardinality.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ end
105105
lemma mk_real : mk ℝ = 2 ^ omega.{0} :=
106106
begin
107107
apply le_antisymm,
108-
{ dsimp [real], apply le_trans mk_quotient_le, apply le_trans mk_subtype_le,
108+
{ dsimp [real], apply le_trans mk_quotient_le, apply le_trans (mk_subtype_le _),
109109
rw [←power_def, mk_nat, mk_rat, power_self_eq (le_refl _)] },
110110
{ convert mk_le_of_injective (injective_cantor_function _ _),
111111
rw [←power_def, mk_bool, mk_nat], exact 1 / 3, norm_num, norm_num }

src/set_theory/cardinal.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,12 @@ mk_le_of_surjective quot.exists_rep
791791
theorem mk_quotient_le {α : Type u} {s : setoid α} : mk (quotient s) ≤ mk α :=
792792
mk_quot_le
793793

794-
theorem mk_subtype_le {α : Type u} {s : set α} : mk s ≤ mk α :=
795-
mk_le_of_injective subtype.val_injective
794+
theorem mk_subtype_le {α : Type u} (p : α → Prop) : mk (subtype p) ≤ mk α :=
795+
⟨embedding.subtype p⟩
796+
797+
theorem mk_subtype_le_of_subset {α : Type u} {p q : α → Prop} (h : ∀ ⦃x⦄, p x → q x) :
798+
mk (subtype p) ≤ mk (subtype q) :=
799+
⟨embedding.subtype_map (embedding.refl α) h⟩
796800

797801
@[simp] theorem mk_emptyc (α : Type u) : mk (∅ : set α) = 0 :=
798802
quotient.sound ⟨equiv.set.pempty α⟩
@@ -861,7 +865,7 @@ lemma mk_subtype_mono {p q : α → Prop} (h : ∀x, p x → q x) : mk {x // p x
861865
⟨embedding_of_subset h⟩
862866

863867
lemma mk_set_le (s : set α) : mk s ≤ mk α :=
864-
⟨⟨subtype.val, subtype.val_injective⟩⟩
868+
mk_subtype_le s
865869

866870
lemma mk_image_eq_lift {α : Type u} {β : Type v} (f : α → β) (s : set α) (h : injective f) :
867871
lift.{v u} (mk (f '' s)) = lift.{u v} (mk s) :=

0 commit comments

Comments
 (0)