cfahlgren1's picture
download
raw
2.4 kB
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Logic.Equiv.Fin.Basic
import Mathlib.Logic.Equiv.Fintype
namespace OAI
/-! Finite sampling identities. The splitting theorem below is the counting
step behind contraction of an order-one row; it is independent of the values
of the matrix entries and uses no certificate data. -/
open scoped BigOperators
noncomputable section
attribute [local instance] Classical.propDecidable
namespace MUB6.Sampling
variable {A B V : Type*} [Fintype A] [Fintype B] [AddCommMonoid V]
theorem sum_split_embedding (e : A ↪ B) (f : B → V) :
(∑ b, f b) = (∑ a, f (e a)) + ∑ b : {b // b ∉ Set.range e}, f b := by
classical
let E : A ⊕ {b // b ∉ Set.range e} ≃ B :=
(e.toEquivRange.sumCongr (Equiv.refl _)).trans (Equiv.sumCompl (· ∈ Set.range e))
have h := E.sum_comp f
simpa [E, Fintype.sum_sum_type, Equiv.trans_apply, Equiv.sumCongr_apply] using h.symm
def dropFirst {p : ℕ} (e : Fin (p + 1) ↪ B) : Fin p ↪ B :=
(Equiv.embeddingFinSucc p B e).1
omit [Fintype B] in
@[simp] theorem dropFirst_apply {p : ℕ} (e : Fin (p + 1) ↪ B) (i : Fin p) :
dropFirst e i = e i.succ := rfl
theorem sum_injective_extension {p : ℕ} (f : (Fin p ↪ B) → B → V) :
(∑ e : Fin (p + 1) ↪ B, f (dropFirst e) (e 0)) =
∑ e : Fin p ↪ B, ∑ b : {b // b ∉ Set.range e}, f e b := by
classical
have h := (Equiv.embeddingFinSucc p B).sum_comp
(fun x : Σ e : Fin p ↪ B, {b // b ∉ Set.range e} => f x.1 x.2)
simpa [dropFirst, Fintype.sum_sigma] using h
theorem sum_samples_split {p : ℕ} (f : (Fin p ↪ B) → B → V) :
(∑ e : Fin p ↪ B, ∑ b, f e b) =
(∑ e : Fin p ↪ B, ∑ j, f e (e j)) +
∑ e : Fin (p + 1) ↪ B, f (dropFirst e) (e 0) := by
classical
calc
_ = ∑ e : Fin p ↪ B,
((∑ j, f e (e j)) + ∑ b : {b // b ∉ Set.range e}, f e b) := by
apply Finset.sum_congr rfl
intro e _
exact sum_split_embedding e (f e)
_ = _ := by rw [Finset.sum_add_distrib, sum_injective_extension]
theorem sum_contraction {p : ℕ} (f : (Fin p ↪ B) → B → V)
(h : ∀ e, ∑ b, f e b = 0) :
(∑ j : Fin p, ∑ e : Fin p ↪ B, f e (e j)) +
(∑ e : Fin (p + 1) ↪ B, f (dropFirst e) (e 0)) = 0 := by
classical
rw [Finset.sum_comm]
rw [← sum_samples_split]
simp [h]
end MUB6.Sampling
end
end OAI

Xet Storage Details

Size:
2.4 kB
·
Xet hash:
95c0fcb6f3237bc1470f9c286c8feda9b51f010b5c3838700aa868617d78e93a

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