Skip to content

Commit 5547d6b

Browse files
committed
Remove NumberingOn altogether
1 parent 6d7bd28 commit 5547d6b

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

LeanCamCombi/ProbLYM.lean

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,15 @@ in mathlib because we need the special property `set_prefix_subset` below. -/
4242
@[reducible]
4343
def Numbering (α : Type*) [Fintype α] := α ≃ Fin (card α)
4444

45-
@[reducible]
46-
def NumberingOn {α : Type*} (s : Finset α) := Numbering s
47-
4845
variable {α : Type*} [Fintype α] [DecidableEq α]
4946

5047
theorem card_Numbering : card (Numbering α) = (card α).factorial := by
5148
exact Fintype.card_equiv (Fintype.equivFinOfCardEq rfl)
5249

5350
omit [Fintype α] in
54-
theorem card_NumberingOn (s : Finset α) : card (NumberingOn s) = s.card.factorial := by
55-
simp only [NumberingOn, card_Numbering, card_coe]
51+
theorem card_Numbering' (s : Finset α) : card (Numbering s) = s.card.factorial := by
52+
simp only [Numbering, card_Numbering]
53+
rw [card_coe]
5654

5755
/-- `IsPrefix s f` means that the elements of `s` precede the elements of `sᶜ`
5856
in the numbering `f`. -/
@@ -65,7 +63,7 @@ theorem subset_IsPrefix_IsPrefix {s1 s2 : Finset α} {f : Numbering α}
6563
intro a h_as1
6664
exact (h_s2 a).mpr (lt_of_lt_of_le ((h_s1 a).mp h_as1) h_card)
6765

68-
def equiv_IsPrefix_NumberingOn2' (s : Finset α) :
66+
def equiv_IsPrefix_Numbering2' (s : Finset α) :
6967
{f // IsPrefix s f} ≃ ({x // x ∈ s} ≃ Fin s.card) × ({x // x ∈ sᶜ} ≃ Fin sᶜ.card) where
7068
toFun := fun ⟨f, hf⟩ ↦
7169
({
@@ -139,10 +137,10 @@ def equiv_IsPrefix_NumberingOn2' (s : Finset α) :
139137
rw [Finset.mem_compl] at hx
140138
simp [hx]
141139

142-
def equiv_IsPrefix_NumberingOn2 (s : Finset α) :
143-
{f // IsPrefix s f} ≃ NumberingOn s × NumberingOn sᶜ := by
144-
simp only [NumberingOn, Numbering, card_coe]
145-
exact equiv_IsPrefix_NumberingOn2' s
140+
def equiv_IsPrefix_Numbering2 (s : Finset α) :
141+
{f // IsPrefix s f} ≃ Numbering s × Numbering (sᶜ : Finset α) := by
142+
simp only [Numbering, card_coe]
143+
exact equiv_IsPrefix_Numbering2' s
146144

147145
instance (s : Finset α) :
148146
DecidablePred fun f ↦ (IsPrefix s f) := by
@@ -153,10 +151,10 @@ def PrefixedNumbering (s : Finset α) : Finset (Numbering α) :=
153151

154152
theorem card_PrefixedNumbering (s : Finset α) :
155153
(PrefixedNumbering s).card = s.card.factorial * (card α - s.card).factorial := by
156-
have h_eq:= Fintype.card_congr (equiv_IsPrefix_NumberingOn2 s)
154+
have h_eq:= Fintype.card_congr (equiv_IsPrefix_Numbering2 s)
157155
rw [Fintype.card_subtype] at h_eq
158156
rw [PrefixedNumbering, h_eq, Fintype.card_prod,
159-
card_NumberingOn s, card_NumberingOn sᶜ, card_compl]
157+
card_Numbering' s, card_Numbering' sᶜ, card_compl]
160158

161159
private lemma auxLemma {k m n : ℕ} (hn : 0 < n) (heq : k * m = n) :
162160
(↑ m : ENNReal) / (↑ n : ENNReal) = 1 / (↑ k : ENNReal) := by

0 commit comments

Comments
 (0)