Equivalent presentations of finite tensor networks
Factored
DefinitionComplete-graph instance of a factored network#✓fully proved
Turn a factored network into a complete-graph tensor instance.
The finite set D a b names the source labels on the edge {a, b} through dec a b.
Labels outside D a b make the corresponding directed factor zero.
def toInstance [Fintype J] [LinearOrder J] [DecidableEq A] (N : Factored J σ τ)
(D : J → J → Finset A) (dec : J → J → A → τ) : Instance J A :=
fun a θ => ∑ z ∈ N.S a, N.W a z *
∏ b ∈ univ.erase a,
if θ b ∈ D (min a b) (max a b) then
N.f a b z (dec (min a b) (max a b) (θ b))
else 0
structure Factored (J σ τ : Type*) where
/-- The finite set of states allowed at each vertex. -/
S : J → Finset σ
/-- The integer weight of a state at a vertex. -/
W : J → σ → ℤ
/-- The finite label set stored in increasing vertex order. -/
Θ : J → J → Finset τ
/-- The factor contributed on one vertex's side of an edge label. -/
f : J → J → σ → τ → ℤ
/-- The directed capacity table; the bare structure does not require symmetry. -/
c : J → J → ℕ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:84
abbrev Instance (J A : Type*) := J → (J → A) → ℤ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:67
Uses 2 · Used by 6
TheoremConverting a factored network to an instance preserves value#✓fully proved
Naming every source edge alphabet bijectively inside labels preserves network value.
theorem value_toInstance [Fintype J] [LinearOrder J] [DecidableEq A]
(N : Factored J σ τ) (labels : Finset A) (default : A)
(D : J → J → Finset A) (dec : J → J → A → τ)
(hD : ∀ a b, a < b → D a b ⊆ labels)
(hdec : ∀ a b, a < b → Set.BijOn (dec a b) (D a b) (N.Θ a b)) :
(N.toInstance D dec).value labels default = N.value
structure Factored (J σ τ : Type*) where
/-- The finite set of states allowed at each vertex. -/
S : J → Finset σ
/-- The integer weight of a state at a vertex. -/
W : J → σ → ℤ
/-- The finite label set stored in increasing vertex order. -/
Θ : J → J → Finset τ
/-- The factor contributed on one vertex's side of an edge label. -/
f : J → J → σ → τ → ℤ
/-- The directed capacity table; the bare structure does not require symmetry. -/
c : J → J → ℕ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:84
Uses 13 · Used by 2
Half-edge presentations
DefinitionHalf-edge factored presentation of a tensor instance#✓fully proved
Present an instance as a half-edge network.
A state at v chooses one label for every off-diagonal half-edge from v; the two sides of
each edge are constrained to agree. The capacities are zero because this construction makes no
size claim.
def toFactored [Fintype J] [DecidableEq J] [DecidableEq A]
(R : Instance J A) (labels : Finset A) (default : A) :
Factored J (J → A) A where
S v := Fintype.piFinsetOn (fun w => w ≠ v) (fun _ => labels) default
W := R
Θ _ _ := labels
f _ w z θ := if z w = θ then 1 else 0
c _ _ := 0
abbrev Instance (J A : Type*) := J → (J → A) → ℤ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:67
structure Factored (J σ τ : Type*) where
/-- The finite set of states allowed at each vertex. -/
S : J → Finset σ
/-- The integer weight of a state at a vertex. -/
W : J → σ → ℤ
/-- The finite label set stored in increasing vertex order. -/
Θ : J → J → Finset τ
/-- The factor contributed on one vertex's side of an edge label. -/
f : J → J → σ → τ → ℤ
/-- The directed capacity table; the bare structure does not require symmetry. -/
c : J → J → ℕ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:84
S : J → Finset σ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:86
def piFinsetOn (P : ι → Prop) [DecidablePred P] (T : ι → Finset σ) (d : σ) :
Finset (ι → σ) :=
piFinset fun i => if P i then T i else {d}
MathlibExt/Data/Fintype/PiFinsetOn.lean:35
Θ : J → J → Finset τ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:90
f : J → J → σ → τ → ℤ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:92
c : J → J → ℕ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:94
Uses 3 · Used by 5
TheoremHalf-edge presentation preserves instance value#✓fully proved
The half-edge presentation of an instance has the same value.
theorem value_toFactored [Fintype J] [LinearOrder J] [DecidableEq A]
(R : Instance J A) (labels : Finset A) (default : A) :
R.value labels default = (R.toFactored labels default).value
abbrev Instance (J A : Type*) := J → (J → A) → ℤ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:67
Uses 13 · Used by 2
TheoremInstance value as a sum over half-edge vectors#✓fully proved
Expand an instance value as a sum over directed half-edge vectors with equality factors.
theorem value_eq_halfEdges [Fintype J] [LinearOrder J] [DecidableEq A]
(R : Instance J A) (labels : Finset A) (default : A) :
R.value labels default =
∑ ℓ ∈ Fintype.piFinset fun w : J =>
Fintype.piFinsetOn (fun w' => w' ≠ w) (fun _ => labels) default,
(∏ w, R w (ℓ w)) * ∏ p ∈ orderedPairs J,
if ℓ p.1 p.2 = ℓ p.2 p.1 then 1 else 0
abbrev Instance (J A : Type*) := J → (J → A) → ℤ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:67
def piFinsetOn (P : ι → Prop) [DecidablePred P] (T : ι → Finset σ) (d : σ) :
Finset (ι → σ) :=
piFinset fun i => if P i then T i else {d}
MathlibExt/Data/Fintype/PiFinsetOn.lean:35
def orderedPairs (J : Type*) [Fintype J] [LinearOrder J] : Finset (J × J) :=
univ.filter fun p => p.1 < p.2
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:37
Uses 12 · Used by 1
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.