Integer-valued factored tensor networks
Tensor Network
DefinitionOrdered pairs representing unordered pairs#✓fully proved
Pairs (a, b) with a < b, representing unordered pairs once.
def orderedPairs (J : Type*) [Fintype J] [LinearOrder J] : Finset (J × J) :=
univ.filter fun p => p.1 < p.2
Used by 24
TheoremMembership in the ordered pairs#✓fully proved
Membership in orderedPairs is strict ordering of the two coordinates.
@[simp] theorem mem_orderedPairs [Fintype J] [LinearOrder J] (p : J × J) :
p ∈ orderedPairs J ↔ p.1 < p.2
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 1 · Used by 10
DefinitionOrdered representative of an unordered pair#✓fully proved
The ordered representative (min a b, max a b) of the pair {a, b}.
def pairIndex [LinearOrder J] (a b : J) : J × J :=
(min a b, max a b)
DefinitionEdge labelings of the complete graph#✓fully proved
Complete-graph edge labelings, free on orderedPairs and default elsewhere.
def edgeLabelings (J : Type*) [Fintype J] [LinearOrder J]
(labels : Finset A) (default : A) : Finset (J × J → A) :=
Fintype.piFinsetOn (fun p : J × J => p.1 < p.2) (fun _ => labels) default
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
TheoremCharacterization of complete-graph edge labelings#✓fully proved
A labeling belongs to edgeLabelings exactly when active edges use allowed labels and all
other coordinates contain the default.
@[simp] theorem mem_edgeLabelings [Fintype J] [LinearOrder J]
(labels : Finset A) (default : A) (labeling : J × J → A) :
labeling ∈ edgeLabelings J labels default ↔
∀ p, (p.1 < p.2 → labeling p ∈ labels) ∧ (¬p.1 < p.2 → labeling p = default)
def edgeLabelings (J : Type*) [Fintype J] [LinearOrder J]
(labels : Finset A) (default : A) : Finset (J × J → A) :=
Fintype.piFinsetOn (fun p : J × J => p.1 < p.2) (fun _ => labels) default
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:50
Uses 3 · Used by 1
DefinitionEdge labels incident to a vertex#✓fully proved
Labels incident to v, indexed by the other endpoint.
def incidentLabels [LinearOrder J] (labeling : J × J → A) (v : J) : J → A :=
fun w => labeling (pairIndex v w)
def pairIndex [LinearOrder J] (a b : J) : J × J :=
(min a b, max a b)
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:46
AbbreviationInteger-valued complete-graph tensor instance#✓fully proved
An integer-valued local tensor at each vertex.
abbrev Instance (J A : Type*) := J → (J → A) → ℤ
Used by 24
Complete-graph instances
DefinitionValue of a complete-graph tensor instance#✓fully proved
The sum, over complete-graph edge labelings, of the product of local tensors.
def value [Fintype J] [LinearOrder J] (labels : Finset A) (default : A)
(R : Instance J A) : ℤ :=
∑ labeling ∈ edgeLabelings J labels default,
∏ v, R v (incidentLabels labeling v)
abbrev Instance (J A : Type*) := J → (J → A) → ℤ
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:67
def edgeLabelings (J : Type*) [Fintype J] [LinearOrder J]
(labels : Finset A) (default : A) : Finset (J × J → A) :=
Fintype.piFinsetOn (fun p : J × J => p.1 < p.2) (fun _ => labels) default
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:50
def incidentLabels [LinearOrder J] (labeling : J × J → A) (v : J) : J → A :=
fun w => labeling (pairIndex v w)
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:63
Uses 3 · Used by 5
Tensor Network
StructureInteger-valued factored tensor network#✓fully proved
An integer-valued factored tensor network.
Only Θ a b with a < b supplies labels. The factors f a b and f b a are the two
sides of the same interaction. Capacities c are metadata used by totalCapacity, Shaped,
and Sized; value does not read them.
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 → ℕ
Used by 33
Factored
DefinitionLabel set of an unordered vertex pair#✓fully proved
The label set of an unordered vertex pair.
def labelSet [LinearOrder J] (N : Factored J σ τ) (a b : J) : Finset τ :=
N.Θ (min a b) (max a b)
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 1 · Used by 12
TheoremLabel set is symmetric in its endpoints#✓fully proved
The label set is independent of endpoint order.
theorem labelSet_comm [LinearOrder J] (N : Factored J σ τ) (a b : J) :
N.labelSet a b = N.labelSet b a
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 2 · Used by 2
DefinitionInteraction of two states in a factored network#✓fully proved
The interaction of two states, summed over their shared edge labels.
def interaction [LinearOrder J] (N : Factored J σ τ)
(a b : J) (z z' : σ) : ℤ :=
∑ θ ∈ N.labelSet a b, N.f a b z θ * N.f b a z' θ
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 2 · Used by 17
TheoremInteraction is symmetric under swapping endpoints#✓fully proved
Reading an interaction from the other endpoint swaps its states.
theorem interaction_comm [LinearOrder J] (N : Factored J σ τ)
(a b : J) (z z' : σ) :
N.interaction a b z z' = N.interaction b a z' z
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 4 · Used by 3
DefinitionValue of a factored tensor network#✓fully proved
The network value: sum over states of vertex weights times all pair interactions.
def value [Fintype J] [LinearOrder J] (N : Factored J σ τ) : ℤ :=
∑ z ∈ Fintype.piFinset N.S,
(∏ a, N.W a (z a)) *
∏ p ∈ orderedPairs J, N.interaction p.1 p.2 (z p.1) (z p.2)
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
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 3 · Used by 7
DefinitionDirected total capacity of a factored network#✓fully proved
The directed total capacity Σ_{a ≠ b} c a b; both orientations are counted.
def totalCapacity [Fintype J] [DecidableEq J] (N : Factored J σ τ) : ℕ :=
∑ a, ∑ b ∈ univ.erase a, N.c a b
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 1 · Used by 2
StructureFactored tensor network with shape parameter#✓fully proved
A network of shape parameter P: at most 2 ^ P states per vertex, symmetric
capacities summing to at most P at each vertex, and at most 2 ^ c labels per edge.
structure Shaped [Fintype J] [LinearOrder J]
(N : Factored J σ τ) (P : ℕ) : Prop where
card_S : ∀ a, (N.S a).card ≤ 2 ^ P
c_symm : ∀ a b, N.c a b = N.c b a
sum_c : ∀ a, ∑ b ∈ univ.erase a, N.c a b ≤ P
card_labelSet : ∀ a b, a ≠ b → (N.labelSet a b).card ≤ 2 ^ N.c a b
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 2 · Used by 6
StructureShaped tensor network with bounded entries#✓fully proved
A shaped network whose weights, factors and off-diagonal interactions are bounded by
2 ^ B in absolute value.
structure Sized [Fintype J] [LinearOrder J]
(N : Factored J σ τ) (P B : ℕ) : Prop extends Shaped N P where
abs_W : ∀ a z, |N.W a z| ≤ 2 ^ B
abs_f : ∀ a b z θ, |N.f a b z θ| ≤ 2 ^ B
abs_interaction : ∀ a b z z', a ≠ b → |N.interaction a b z z'| ≤ 2 ^ B
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
structure Shaped [Fintype J] [LinearOrder J]
(N : Factored J σ τ) (P : ℕ) : Prop where
card_S : ∀ a, (N.S a).card ≤ 2 ^ P
c_symm : ∀ a b, N.c a b = N.c b a
sum_c : ∀ a, ∑ b ∈ univ.erase a, N.c a b ≤ P
card_labelSet : ∀ a b, a ≠ b → (N.labelSet a b).card ≤ 2 ^ N.c a b
MathlibExt/Combinatorics/TensorNetwork/Basic.lean:132
Uses 3 · Used by 3
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.