Documentation

CslibFrontier.Computability.Circuit.Frontier.TensorNetwork.ActiveCall

One active call of the contraction recursion #

This file proves the correctness of one active call of the recursive contraction algorithm of [OAI26k] (§D.4.4–§D.4.7, pp. 61–64): the contraction modulo 2 ^ p is recovered from values that reduce, modulo the higher precisions 2 ^ p_t, to deformed contractions of the reduced network. The contractions of the children enter through the child identity (D.16), under the conditions stated below.

Setting. Let K be a ℚ-algebra and B a subring containing ℤ_(2) (in the manuscript, K = ℚ[U] / (f) and B = O), and let N be a Boolean tensor network with entries in B whose edges run from rows to columns. Pack its M edges into packets of L = 2 ^ a slots, and choose n > M (2 L - 1) interpolation points ζ k ∈ B whose differences are units (in the manuscript, binary-coordinate lifts of residue-field elements). For each nonzero grid point t of positive multiplicity q_t and each point ζ k, a value v t k ∈ B is supplied.

Recovery (recoverFromValues). Interpolate the values v t · at the points ζ over B (Lagrange.ringInterpolate), and apply the tapered Hermite recovery (D.9) to the interpolants (Cslib.Circuits.Frontier.taperedRecovery).

Correctness. If every v t k agrees with the local deformation F(t + α ζ k) (TensorNetwork.localDeformation) modulo 2 ^ p_t, p_t = p + 8 h D_t + 8 M (a + 1), then the interpolant agrees with F(t + α z) modulo 2 ^ p_t (Lagrange.exists_ringInterpolate_eq_add), and Lemma D.5 (Cslib.Circuits.Frontier.exists_taperedRecovery_eq_add_of_params) recovers F(0) = Z(N) modulo 2 ^ p (TensorNetwork.exists_recoverFromValues_eq_add). Modulo 2 ^ p_t, F(t + α ζ) is the deformed contraction of the reduced network along the Cauchy matrix at T = t + α ζ (TensorNetwork.mk_eval_localDeformation), so values that reduce modulo 2 ^ p_t to these deformed contractions recover Z(N) modulo 2 ^ p (TensorNetwork.exists_recoverFromValues_eq_add_of_mk). That theorem does not mention the children. The child identity (D.16), TensorNetwork.deformedContraction_cauchyValueMatrix_eq_sum, writes the deformed contraction as the sum over the mode tuples of the products of the contractions of the children at a node of valuation i < a, for edges from rows to columns and groups oriented by digit i of the slots. A node of positive multiplicity has valuation below u, so for u ≤ a and a packing of such edges the values may be computed from the children's contractions modulo 2 ^ p_t (TensorNetwork.exists_recoverFromValues_eq_add_of_children, in Recursion.lean).

The packing bridge. The orientation that the child identity needs is property (2) of Lemma D.3 for Cslib.PacketPacking.Packing (packingGroup_src_tgt), and the port counts of Lemma D.3 (3) are the group sizes that bound the children (card_packingGroup_src, card_packingGroup_tgt, with TensorNetwork.ModeSplitting.mul_card_edges_child_le).

Main definitions #

Main results #

References #

Interpolation of congruent values #

theorem Lagrange.exists_ringInterpolate_eq_add {R : Type u_1} {ι : Type u_2} [CommRing R] [DecidableEq ι] {s : Finset ι} {v : ι → R} (hvs : (↑s).Pairwise fun (i j : ι) => IsUnit (v i - v j)) {f : Polynomial R} (hf : f.degree < ↑s.card) {π : R} {r : ι → R} (hr : ∀ i ∈ s, ∃ (c : R), r i = Polynomial.eval (v i) f + π * c) :
∃ (g : Polynomial R), (ringInterpolate s v) r = f + Polynomial.C π * g

Interpolating congruent values. At nodes with unit differences, if the values r i agree with a polynomial f of degree below #s modulo π, then so does every coefficient of their interpolant.

noncomputable def Cslib.Circuits.Frontier.integerHom {K : Type u_1} [CommRing K] [Algebra ℚ K] (B : Subring K) (hB : ∀ c ∈ (Rat.padicValuation 2).integer, (algebraMap ℚ K) c ∈ B) :

The inclusion of ℤ_(2) into a subring B of a ℚ-algebra containing it.

noncomputable def Cslib.Circuits.Frontier.recoverFromValues {K : Type u_1} [CommRing K] [Algebra ℚ K] (B : Subring K) (a u h : ℕ) {n : ℕ} (ζ : Fin n → ↥B) (v : ℤ → Fin n → ↥B) :
K

The value recovered at an active call from the values v t k at the interpolation points ζ k: interpolate over B at each node t, and apply tapered Hermite recovery (D.9).

theorem Cslib.Circuits.Frontier.recoverFromValues_def {K : Type u_1} [CommRing K] [Algebra ℚ K] (B : Subring K) (a u h : ℕ) {n : ℕ} (ζ : Fin n → ↥B) (v : ℤ → Fin n → ↥B) :

A nonzero integer t of valuation i is divisible by 2 ^ i but not by 2 ^ (i + 1).

theorem Cslib.Circuits.Frontier.TensorNetwork.exists_recoverFromValues_eq_add {K : Type u_1} [CommRing K] [Algebra ℚ K] {V : Type u_2} {E : Type u_3} {P : Type u_4} [Fintype V] [Fintype E] [DecidableEq E] [DecidableEq P] (B : Subring K) (hB : ∀ c ∈ (Rat.padicValuation 2).integer, (algebraMap ℚ K) c ∈ B) (N : TensorNetwork (↥B) Bool V E) (side : V → Bool) {a : ℕ} {packet : E → P} {slot : E → ℕ} (hslot : ∀ (e : E), slot e < 2 ^ a) (hinj : ∀ (e e' : E), packet e = packet e' → slot e = slot e' → e = e') {u h p : ℕ} (hu : 1 ≤ u) (huM : u ≤ Fintype.card E) (hh : 3 * Fintype.card E ≤ h * u) (hh' : h * u ≤ 3 * Fintype.card E + u) {n : ℕ} (ζ : Fin n → ↥B) (hζ : Pairwise fun (k l : Fin n) => IsUnit (ζ k - ζ l)) (hn : Fintype.card E * (2 * 2 ^ a - 1) < n) (v : ℤ → Fin n → ↥B) (hv : ∀ t ∈ recoveryNodes a, 0 < taperMult u h t → ∀ (k : Fin n), ∃ (c : ↥B), v t k = Polynomial.eval (ζ k) (N.localDeformation side (integerHom B hB) a t packet slot) + 2 ^ (p + 8 * h * 2 ^ (a - padicValInt 2 t) + 8 * Fintype.card E * (a + 1)) * c) :
∃ b ∈ B, recoverFromValues B a u h ζ v = ↑N.contraction + 2 ^ p * b

Correctness of recovery from values. Let N have entries in B, edges from rows to columns packed into packets of 2 ^ a slots, and let 1 ≤ u ≤ M and 3 M ≤ h u ≤ 3 M + u for M edges. Let the n > M (2 L - 1) points ζ k have unit differences. If at every node t of positive multiplicity the values v t k agree with F(t + α ζ k) modulo 2 ^ p_t, p_t = p + 8 h D_t + 8 M (a + 1), then the recovered value agrees with the contraction modulo 2 ^ p.

The packing bridge #

def Cslib.Circuits.Frontier.packingGroup {V : Type u_2} {E : Type u_3} {src tgt : E → V} {a r : ℕ} (side : V → Bool) (Q : PacketPacking.Packing src tgt a r) (i : Fin a) (v : V) :
Fin r

The group of a vertex in coordinate i of a packing of the edges src e → tgt e: its row label if it is a row and its column label if it is a column.

theorem Cslib.Circuits.Frontier.packingGroup_src_tgt {V : Type u_2} {E : Type u_3} {src tgt : E → V} {a r : ℕ} (side : V → Bool) (hsrc : ∀ (e : E), side (src e) = true) (htgt : ∀ (e : E), side (tgt e) = false) (Q : PacketPacking.Packing src tgt a r) (i : Fin a) (e : E) :
(packingGroup side Q i (src e), packingGroup side Q i (tgt e)) = if (↑(Q.slot e)).testBit ↑i = true then (Q.symbols (Q.packet e) i).swap else Q.symbols (Q.packet e) i

The packing bridge. For a packing of edges that run from rows to columns (Lemma D.3 of [OAI26k]), the groups in coordinate i are oriented by digit i of the slots (Lemma D.3 (2)): the hypothesis of TensorNetwork.cauchyModeSplitting. The edge ends src and tgt are arbitrary functions, so the bridge applies to N.src and N.tgt of any network with these ends, such as N.map f.

theorem Cslib.Circuits.Frontier.packing_slot_lt {V : Type u_2} {E : Type u_3} {src tgt : E → V} {a r : ℕ} (Q : PacketPacking.Packing src tgt a r) (e : E) :
↑(Q.slot e) < 2 ^ a

The slots of a packing lie below 2 ^ a.

theorem Cslib.Circuits.Frontier.packing_slot_injective {V : Type u_2} {E : Type u_3} {src tgt : E → V} {a r : ℕ} (Q : PacketPacking.Packing src tgt a r) (e e' : E) (hp : Q.packet e = Q.packet e') (hs : ↑(Q.slot e) = ↑(Q.slot e')) :
e = e'

No two edges share a slot of a packet.

theorem Cslib.Circuits.Frontier.card_packingGroup_src {V : Type u_2} {E : Type u_3} {src tgt : E → V} {a r : ℕ} [Fintype E] (side : V → Bool) (hsrc : ∀ (e : E), side (src e) = true) (Q : PacketPacking.Packing src tgt a r) (i : Fin a) (σ : Fin r) :
{e : E | packingGroup side Q i (src e) = σ}.card = {e : E | Q.rowLabel (src e) i = σ}.card

The rows of group σ in coordinate i of a packing are the rows with symbol σ.

theorem Cslib.Circuits.Frontier.card_packingGroup_tgt {V : Type u_2} {E : Type u_3} {src tgt : E → V} {a r : ℕ} [Fintype E] (side : V → Bool) (htgt : ∀ (e : E), side (tgt e) = false) (Q : PacketPacking.Packing src tgt a r) (i : Fin a) (σ : Fin r) :
{e : E | packingGroup side Q i (tgt e) = σ}.card = {e : E | Q.colLabel (tgt e) i = σ}.card

The columns of group σ in coordinate i of a packing are the columns with symbol σ.

theorem Cslib.Circuits.Frontier.TensorNetwork.mk_eval_localDeformation {V : Type u_2} {E : Type u_3} {P : Type u_4} [Fintype V] [Fintype E] [DecidableEq E] [DecidableEq P] {B : Type u_5} [CommRing B] (N : TensorNetwork B Bool V E) (side : V → Bool) (κ : ↥(Rat.padicValuation 2).integer →+* B) (a : ℕ) (t : ℤ) (packet : E → P) (slot : E → ℕ) (I : Ideal B) (ζ : B) :
(Ideal.Quotient.mk I) (Polynomial.eval ζ (N.localDeformation side κ a t packet slot)) = (map (Ideal.Quotient.mk I) N).deformedContraction side (cauchyValueMatrix ((Ideal.Quotient.mk I).comp κ) ((Ideal.Quotient.mk I) ζ) a t packet slot)

The values of the local deformation modulo 2 ^ p_t are deformed contractions of the reduced network along the Cauchy matrix at T = t + α ζ (which the child identity (D.16), TensorNetwork.deformedContraction_cauchyValueMatrix_eq_sum, expands).

theorem Cslib.Circuits.Frontier.TensorNetwork.exists_recoverFromValues_eq_add_of_mk {K : Type u_1} [CommRing K] [Algebra ℚ K] {V : Type u_2} {E : Type u_3} {P : Type u_4} [Fintype V] [Fintype E] [DecidableEq E] [DecidableEq P] (B : Subring K) (hB : ∀ c ∈ (Rat.padicValuation 2).integer, (algebraMap ℚ K) c ∈ B) (N : TensorNetwork (↥B) Bool V E) (side : V → Bool) {a : ℕ} {packet : E → P} {slot : E → ℕ} (hslot : ∀ (e : E), slot e < 2 ^ a) (hinj : ∀ (e e' : E), packet e = packet e' → slot e = slot e' → e = e') {u h p : ℕ} (hu : 1 ≤ u) (huM : u ≤ Fintype.card E) (hh : 3 * Fintype.card E ≤ h * u) (hh' : h * u ≤ 3 * Fintype.card E + u) {n : ℕ} (ζ : Fin n → ↥B) (hζ : Pairwise fun (k l : Fin n) => IsUnit (ζ k - ζ l)) (hn : Fintype.card E * (2 * 2 ^ a - 1) < n) (v : ℤ → Fin n → ↥B) (hv : ∀ t ∈ recoveryNodes a, 0 < taperMult u h t → ∀ (k : Fin n), have I := Ideal.span {2 ^ (p + 8 * h * 2 ^ (a - padicValInt 2 t) + 8 * Fintype.card E * (a + 1))}; (Ideal.Quotient.mk I) (v t k) = (map (Ideal.Quotient.mk I) N).deformedContraction side (cauchyValueMatrix ((Ideal.Quotient.mk I).comp (integerHom B hB)) ((Ideal.Quotient.mk I) (ζ k)) a t packet slot)) :
∃ b ∈ B, recoverFromValues B a u h ζ v = ↑N.contraction + 2 ^ p * b

Correctness of one active call ([OAI26k], §D.4.4–§D.4.7). Under the hypotheses of exists_recoverFromValues_eq_add, suppose that at every node t of positive multiplicity, each value v t k reduces modulo 2 ^ p_t to the deformed contraction of the reduced network along the Cauchy matrix at T = t + α ζ k, p_t = p + 8 h D_t + 8 M (a + 1). Then the recovered value agrees with the contraction modulo 2 ^ p. The children do not appear in this statement: for u ≤ a and a packing of edges that run from rows to columns, the child identity (D.16) writes each of these deformed contractions as the sum over the mode tuples of the products of the contractions of the children (exists_recoverFromValues_eq_add_of_children).