File size: 5,002 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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | import OAI.Algebra.Finitistic.Encoding.ThreeVertexAlgebra
import Mathlib.RingTheory.TensorProduct.Finite
namespace OAI
noncomputable section
open scoped TensorProduct
namespace LittleFinitistic.QuadraticEncoding
universe u v
variable {k : Type u} [Field k] {d t : β}
/-- Coefficients of the finite quadratic relation list, including degrees zero and one. -/
structure Relations (k : Type u) (d t : β) where
constant : Fin t β k
linear : Fin t β Fin d β k
quadratic : Fin t β Fin d β Fin d β k
abbrev Arrows (k : Type u) (d : β) := Fin (d + 1) β k
abbrev Paths (k : Type u) [Field k] (d : β) := Arrows k d β[k] Arrows k d
def basis (i : Fin (d + 1)) : Arrows k d := Pi.single i 1
def commutation (h : Fin d) : Paths k d :=
basis h.succ ββ[k] basis 0 - basis 0 ββ[k] basis h.succ
def homogenized (P : Relations k d t) (j : Fin t) : Paths k d :=
(β h, β l, P.quadratic j h l β’ (basis h.succ ββ[k] basis l.succ)) +
(β h, P.linear j h β’ (basis 0 ββ[k] basis h.succ)) +
P.constant j β’ (basis 0 ββ[k] basis 0)
/-- Exactly the span of a'_h s - s' a_h and all homogenized p_j. -/
def relationSpace (P : Relations k d t) : Submodule k (Paths k d) :=
Submodule.span k (Set.range (commutation (k := k) (d := d)) βͺ Set.range (homogenized P))
/-- Compose arrows, then quotient only the length-two path space by the specified relations. -/
def composition (P : Relations k d t) :
Arrows k d ββ[k] Arrows k d ββ[k] (Paths k d β§Έ relationSpace P) :=
(TensorProduct.mk k (Arrows k d) (Arrows k d)).comprβ (relationSpace P).mkQ
/-- The six path-endpoint components of the manuscript's directed encoding. -/
abbrev B (P : Relations k d t) := ThreeVertexAlgebra (composition P)
variable (P : Relations k d t)
theorem finiteDimensional : FiniteDimensional k (B P) := by
have : FiniteDimensional k (Arrows k d) := inferInstance
have : FiniteDimensional k (Paths k d) := inferInstance
have : FiniteDimensional k (Paths k d β§Έ relationSpace P) := inferInstance
exact inferInstanceAs (FiniteDimensional k
(k Γ k Γ k Γ Arrows k d Γ Arrows k d Γ (Paths k d β§Έ relationSpace P)))
open CategoryTheory in
/-- Actual global dimensions of the constructed finite-dimensional encoding. -/
theorem globalDimension_le_two :
(β¨ N : ModuleCat.{max u v} (B P), projectiveDimension N) β€ (2 : β) β§
(β¨ N : ModuleCat.{max u v} (B P)α΅α΅α΅, projectiveDimension N) β€ (2 : β) :=
ThreeVertexAlgebra.globalDimension_le_two (composition P)
/-- Includes a length-two residue class as the 0-to-2 component. -/
def lengthTwo : (Paths k d β§Έ relationSpace P) ββ[k] B P where
toFun z := (0, 0, 0, 0, 0, z)
map_add' x y := by
change ((0, 0, 0, 0, 0, x+y) : B P) = (0, 0, 0, 0, 0, x) + (0, 0, 0, 0, 0, y)
rw [ThreeVertexAlgebra.add_eq (composition P)]
simp
map_smul' c x := by
change ((0, 0, 0, 0, 0, c β’ x) : B P) = c β’ (0, 0, 0, 0, 0, x)
rw [ThreeVertexAlgebra.smul_eq (composition P)]
simp
def pathMap : Paths k d ββ[k] B P := (lengthTwo P).comp (relationSpace P).mkQ
/-- This records that no additional linear length-two relation was introduced. -/
theorem pathMap_eq_zero_iff (z : Paths k d) : pathMap P z = 0 β z β relationSpace P := by
have hi : Function.Injective (lengthTwo P) := by
intro x y h
exact congrArg (fun a : B P => a.2.2.2.2.2) h
rw [pathMap, LinearMap.comp_apply, (map_eq_zero_iff _ hi)]
exact Submodule.Quotient.mk_eq_zero _
/-- Arrows s,a_1,...,a_d from vertex 0 to 1; index zero is s. -/
def arrow01 (i : Fin (d + 1)) : B P := (0, 0, 0, basis i, 0, 0)
/-- Arrows s',a'_1,...,a'_d from vertex 1 to 2; index zero is s'. -/
def arrow12 (i : Fin (d + 1)) : B P := (0, 0, 0, 0, basis i, 0)
lemma arrow_product (i j : Fin (d + 1)) :
arrow12 P i * arrow01 P j = pathMap P (basis i ββ[k] basis j) := by
change ThreeVertexAlgebra.mul (composition P) (0,0,0,0,basis i,0)
(0,0,0,basis j,0,0) = (0,0,0,0,0,(relationSpace P).mkQ (basis i ββ[k] basis j))
simp [ThreeVertexAlgebra.mul, composition]
/-- Equation a'_h s = s' a_h, with exactly the manuscript's composition order. -/
theorem commutation_holds (h : Fin d) :
arrow12 P h.succ * arrow01 P 0 = arrow12 P 0 * arrow01 P h.succ := by
rw [arrow_product, arrow_product, β sub_eq_zero, β map_sub]
exact (pathMap_eq_zero_iff P _).mpr (Submodule.subset_span (Or.inl β¨h, rflβ©))
/-- Every homogenized defining equation holds in the constructed algebra. -/
theorem homogenized_holds (j : Fin t) :
(β h, β l, P.quadratic j h l β’ (arrow12 P h.succ * arrow01 P l.succ)) +
(β h, P.linear j h β’ (arrow12 P 0 * arrow01 P h.succ)) +
P.constant j β’ (arrow12 P 0 * arrow01 P 0) = 0 := by
have hz := (pathMap_eq_zero_iff P (homogenized P j)).mpr
(Submodule.subset_span (Or.inr β¨j, rflβ©))
simpa only [homogenized, map_add, map_sum, map_smul, β arrow_product] using hz
end LittleFinitistic.QuadraticEncoding
end
end OAI
|