File size: 1,817 Bytes
216fb31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Algebra.Finitistic.Encoding.RelationSequence

namespace OAI
noncomputable section
open scoped TensorProduct
namespace LittleFinitistic.RelationBasisCoefficients
open QuadraticEncoding
universe u
variable {k : Type u} [Field k] {d t : ℕ} (P : Relations k d t)

/-- The actual ordered length-two path basis, with the later arrow first. -/
def pathBasis : Module.Basis (Fin (d+1) × Fin (d+1)) k (Paths k d) :=
  (Pi.basisFun k (Fin (d+1))).tensorProduct (Pi.basisFun k (Fin (d+1)))

/-- Coefficient of the path b a in a vector of the actual relation subspace. -/
def coefficient (r : relationSpace P) (a b : Fin (d+1)) : k :=
  (pathBasis (k := k) (d := d)).repr r.val (b,a)

theorem expansion (r : relationSpace P) :
    (∑ a, ∑ b, coefficient P r a b • (basis b ⊗ₜ[k] basis a)) = r.val := by
  rw [Finset.sum_comm]
  simpa only [coefficient,pathBasis,Fintype.sum_prod_type,
    Module.Basis.tensorProduct_apply,Pi.basisFun_apply,basis] using
    (pathBasis (k := k) (d := d)).sum_repr r.val

/-- Every vector in the chosen relation basis gives the genuine algebra equation. -/
theorem algebra_relation (r : relationSpace P) :
    (∑ a, ∑ b, coefficient P r a b • (arrow12 P b * arrow01 P a)) = 0 := by
  have h := (pathMap_eq_zero_iff P r.val).2 r.property
  rw [← expansion P r] at h
  simpa only [map_sum,map_smul,← arrow_product] using h

abbrev RelationIndex := Fin (Module.finrank k (relationSpace P))

def basisCoefficient (r : RelationIndex P) (a b : Fin (d+1)) : k :=
  coefficient P (RelationSequence.relationBasis P r) a b

theorem basis_relation (r : RelationIndex P) :
    (∑ a, ∑ b, basisCoefficient P r a b • (arrow12 P b * arrow01 P a)) = 0 :=
  algebra_relation P (RelationSequence.relationBasis P r)
end LittleFinitistic.RelationBasisCoefficients

end

end OAI