cfahlgren1's picture
download
raw
3.71 kB
import Mathlib
namespace OAI
noncomputable section
open scoped BigOperators
namespace FiniteConstruction
variable {Ξ± Ξ² 𝔽 : Type} [Fintype Ξ±] [DecidableEq Ξ±]
[Field 𝔽]
variable (B : Ξ² β†’ Finset Ξ±)
def monomial (s : Finset Ξ±) : Ξ² β†’ 𝔽 := fun b => if s βŠ† B b then 1 else 0
def smallSets (Ξ± : Type) [Fintype Ξ±] [DecidableEq Ξ±] (d : β„•) : Finset (Finset Ξ±) :=
(Finset.range (d+1)).biUnion (fun j => Finset.univ.powersetCard j)
lemma mem_smallSets (s : Finset Ξ±) (d : β„•) : s ∈ smallSets Ξ± d ↔ s.card ≀ d := by
simp only [smallSets,Finset.mem_biUnion,Finset.mem_range,Finset.mem_powersetCard,
Finset.subset_univ,true_and]
constructor
· rintro ⟨j,hj,he⟩
omega
Β· intro hs
exact ⟨s.card,by omega,rfl⟩
def lowDegree (d : β„•) : Submodule 𝔽 (Ξ² β†’ 𝔽) :=
Submodule.span 𝔽 (monomial (𝔽 := 𝔽) B '' (smallSets Ξ± d : Set (Finset Ξ±)))
lemma monomial_mem {s : Finset Ξ±} {d : β„•} (hs : s.card ≀ d) :
monomial (𝔽 := 𝔽) B s ∈ lowDegree B d := by
exact Submodule.subset_span ⟨s,(mem_smallSets s d).mpr hs,rfl⟩
omit [Fintype Ξ±] in
lemma monomial_empty : monomial (𝔽 := 𝔽) B βˆ…=1 := by ext b; simp [monomial]
omit [Fintype Ξ±] in
lemma monomial_mul (s t : Finset Ξ±) :
monomial (𝔽 := 𝔽) B s * monomial B t=monomial B (s βˆͺ t) := by
ext b
by_cases hs : s βŠ† B b <;> by_cases ht : t βŠ† B b <;>
simp [monomial,Finset.union_subset_iff,hs,ht]
lemma coordinate_mul_mem {d : β„•} {f : Ξ² β†’ 𝔽} (hf : f ∈ lowDegree B d) (a : Ξ±) :
monomial B {a} * f ∈ lowDegree B (d+1) := by
induction hf using Submodule.span_induction with
| mem x hx =>
obtain ⟨s,hs,rfl⟩ := hx
rw [monomial_mul]
apply monomial_mem
have hc := (Finset.card_union_le ({a} : Finset Ξ±) s)
have hd := (mem_smallSets s d).mp hs
simp only [Finset.card_singleton] at hc
omega
| zero => simp
| add x y hx hy ihx ihy => simpa only [mul_add] using Submodule.add_mem _ ihx ihy
| smul c x hx ih => simpa only [mul_smul_comm] using Submodule.smul_mem _ c ih
lemma sum_power_mem (A : Finset Ξ±) (d : β„•) :
(βˆ‘ a ∈ A, monomial (𝔽 := 𝔽) B {a})^d ∈ lowDegree B d := by
induction d with
| zero => simpa only [pow_zero,monomial_empty] using
(monomial_mem (𝔽 := 𝔽) B (s := βˆ…) (d := 0) (by simp))
| succ d ih =>
rw [pow_succ',Finset.sum_mul]
exact Submodule.sum_mem _ (fun a _ => coordinate_mul_mem B ih a)
variable [Fintype Ξ²] [DecidableEq Ξ²]
lemma interpolation_dimension_bound (d : β„•)
(h : βˆ€ b : Ξ², Pi.single b (1 : 𝔽) ∈ lowDegree B d) :
Fintype.card Ξ² ≀ βˆ‘ j ∈ Finset.range (d+1), (Fintype.card Ξ±).choose j := by
have ht : lowDegree (𝔽 := 𝔽) B d=⊀ := by
apply top_unique
intro f hf
have he : f=βˆ‘ b, f b β€’ Pi.single b (1 : 𝔽) := by
ext b
simp [Pi.single_apply]
rw [he]
exact Submodule.sum_mem _ (fun b _ => Submodule.smul_mem _ (f b) (h b))
classical
have hd := finrank_span_finset_le_card (R := 𝔽)
((smallSets Ξ± d).image (monomial (𝔽 := 𝔽) B))
have he : Submodule.span 𝔽 (((smallSets Ξ± d).image (monomial (𝔽 := 𝔽) B)) : Set (Ξ² β†’ 𝔽))=
lowDegree B d := by rw [Finset.coe_image]; rfl
change Module.finrank 𝔽 (Submodule.span 𝔽 _) ≀ _ at hd
rw [he,ht,finrank_top,Module.finrank_fintype_fun_eq_card] at hd
refine hd.trans (Finset.card_image_le.trans ?_)
calc
(smallSets Ξ± d).card ≀ βˆ‘ j ∈ Finset.range (d+1), ((Finset.univ : Finset Ξ±).powersetCard j).card := by
exact Finset.card_biUnion_le
_ = _ := by simp only [Finset.card_powersetCard,Finset.card_univ]
end FiniteConstruction
end
end OAI

Xet Storage Details

Size:
3.71 kB
Β·
Xet hash:
931260c9a32b23b9c9bab7f906855ae1724fdaaeb731f731236687d9f4c286df

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.