File size: 2,123 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | import Mathlib
namespace OAI
section
open Set
namespace InfiniteMatroidCounterexample
noncomputable def splitFunction {A B V : Type*} (e : A βͺ B) :
(B β V) β (A β V) Γ ({b : B // b β Set.range e} β V) := by
classical
exact (Equiv.piEquivPiSubtypeProd (Β· β Set.range e) (fun _ β¦ V)).trans
(Equiv.prodCongr ((Equiv.ofInjective e e.injective).arrowCongr (Equiv.refl V)).symm (Equiv.refl _))
@[simp] lemma splitFunction_fst {A B V : Type*} (e : A βͺ B) (f : B β V) :
(splitFunction e f).1 = fun a β¦ f (e a) := rfl
lemma card_restriction {A B V : Type*} [Fintype A] [Fintype B] [DecidableEq A] [DecidableEq B] [Fintype V]
(e : A βͺ B) (P : (A β V) β Prop) [DecidablePred P] :
Fintype.card {f : B β V // P (fun a β¦ f (e a))} =
Fintype.card {g : A β V // P g} * Fintype.card V ^ (Fintype.card B - Fintype.card A) := by
classical
let fs := splitFunction (V := V) e
have he := (fs.subtypeEquiv (p := fun f β¦ P (fun a β¦ f (e a)))
(q := fun f β¦ P f.1) (fun f β¦ by simp [fs])).trans Equiv.prodSubtypeFstEquivSubtypeProd
have hc : Fintype.card {b : B // b β Set.range e} = Fintype.card A :=
(Fintype.card_congr (Equiv.ofInjective e e.injective)).symm
rw [Fintype.card_congr he, Fintype.card_prod, Fintype.card_fun,
Fintype.card_subtype_compl, hc]
lemma function_density_restriction {A B : Type*} [Fintype A] [Fintype B] [DecidableEq A] [DecidableEq B]
(e : A βͺ B) (P : (A β Bool) β Prop) [DecidablePred P] :
(Fintype.card {f : B β Bool // P (fun a β¦ f (e a))} : β) / Fintype.card (B β Bool) =
(Fintype.card {g : A β Bool // P g} : β) / Fintype.card (A β Bool) := by
rw [card_restriction]
simp only [Fintype.card_fun, Fintype.card_bool, Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat]
have hle : Fintype.card A β€ Fintype.card B := Fintype.card_le_of_injective e e.injective
have heq : (2:β) ^ Fintype.card B = 2 ^ Fintype.card A * 2 ^ (Fintype.card B - Fintype.card A) := by
rw [β pow_add, Nat.add_sub_of_le hle]
rw [heq]
field_simp
end InfiniteMatroidCounterexample
end
end OAI
|