cfahlgren1/math / lean /OAI /Algebra /DepthFive /BlockMiddleSemantics.lean
cfahlgren1's picture
download
raw
1.6 kB
import OAI.Algebra.DepthFive.UpperBlockData
import OAI.Algebra.DepthFive.MatrixPathSemantics
namespace OAI
noncomputable section
namespace Problem335.BlockData
variable {n : ℕ}
/-- The lower-gate monomial belonging to an enumerated block path. -/
def lowerMonomial (K : Type*) [CommSemiring K]
(blocks : List (List (Fin n))) (p : Lower blocks) :
MvPolynomial (Fin n × Fin n × Fin n) K :=
((lowerInputs blocks p).map MvPolynomial.X).prod
/-- The weighted middle input list computes exactly the corresponding block matrix entry. -/
theorem middleInputs_value (K : Type*) [CommSemiring K]
(blocks : List (List (Fin n))) (m : Middle blocks) :
((middleInputs K blocks m).map (fun e =>
MvPolynomial.C e.1 * lowerMonomial K blocks e.2)).sum =
(((blocks.get m.1).map (immLayer K n)).prod) m.2.1 m.2.2 := by
simp only [middleInputs, List.map_ofFn, Function.comp_def, lowerMonomial,
lowerInputs, MvPolynomial.C_1, one_mul, List.sum_ofFn]
exact matrixEntryPaths_fin_sum_prod (immLayer K n) (blocks.get m.1) m.2.1 m.2.2
/-- Substitute lower-gate semantics into the middle gate. -/
theorem middleInputs_value_of_lower
(K : Type*) [CommSemiring K] (blocks : List (List (Fin n)))
(v : Lower blocks → MvPolynomial (Fin n × Fin n × Fin n) K)
(hv : ∀ p, v p = lowerMonomial K blocks p) (m : Middle blocks) :
((middleInputs K blocks m).map (fun e => MvPolynomial.C e.1 * v e.2)).sum =
(((blocks.get m.1).map (immLayer K n)).prod) m.2.1 m.2.2 := by
simp_rw [hv]
exact middleInputs_value K blocks m
end Problem335.BlockData
end
end OAI

Xet Storage Details

Size:
1.6 kB
·
Xet hash:
a37ff4c8e7f7ec4913fce062ecd7348347a41ec3b4bf68b27458709f109dc782

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