Documentation

CslibFrontier.Computability.Circuit.Frontier.TensorNetwork.NativeChildPolyTime

The native child networks in polynomial time #

The native child of group g of an active call of the contraction recursion of [OAI26k] (§D.4.6, p. 63), NativeChild.nativeChild, and its number of rows, NativeChild.childRows, are computable in polynomial time over the encodings of the native recursion. The counts are unary, the node t is in binary sign-magnitude form, and the lists are binary, except the exponents β, which are unary as in a packet descriptor. The parent is encoded by DescribedNetwork.encDescribed (VertexDesc.enc encT), for any encoding encT of the root descriptors, and its packing by PacketPacking.encNativePacking.

The theorems are stated in composition form, for components computed from any input. Besides the components themselves, they ask for 2 ^ a, 2 ^ (i + 1) and the number of packets in unary. Every packet vertex stores 2 ^ a and 2 ^ (i + 1) in unary in its context, and the child has one packet vertex per packet. For the native parent packing (NativeChild.nativeParentPacking), the packing itself and its number of packets, at most M (2 ^ a) ^ 12 for M edges, are computed here, with the number of rows in unary.

The pieces.

The shape of the child, for size bounds along the recursion:

Main results #

References #

theorem Cslib.Circuits.Frontier.NativeChild.portRank_eq_countP (groups : List ℕ) (g : ℕ) (ends : List (ℕ × ℕ)) (sel : ℕ × ℕ → ℕ) (e : ℕ) :
portRank groups g ends sel e = List.countP (fun (e' : ℕ) => decide (groups.getD (sel (ends.getD e' (0, 0))) 0 = g)) (List.range (min ends.length e)) + (e - ends.length) * if groups.getD (sel (0, 0)) 0 = g then 1 else 0

The rank of a port without a loop over the port: the edges before e with an end in group g, the edges past the list counting as (0, 0).

@[reducible, inline]

The end vertices of a list of edges, such as the edges ends of a parent network or the child edges: each edge is the pair (u, v) of its two end vertices in binary. The pairs are framed and concatenated in edge order, each with its first end framed.

The parent edge of a child edge is polynomial-time, with the child edge in binary and the parent edge in unary.

theorem Cslib.Circuits.Frontier.NativeChild.computableInPolyTime_nativeChild {T : Type} {encT : T ↪ List Bool} {δ : Type} {encIn : δ ↪ List Bool} {g : δ → ℕ} {fl ζ β : δ → List ℕ} {a i pt r : δ → ℕ} {t : δ → ℤ} {D : δ → DescribedNetwork (VertexDesc T)} {pk : δ → (List (List ℕ) × List (List ℕ)) × ℕ × List (ℕ × ℕ)} (hfl : Turing.MultiTapeTM.ComputableInPolyTime fl encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (ha : Turing.MultiTapeTM.ComputableInPolyTime a encIn Turing.MultiTapeTM.encUnary) (hL : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : δ) => 2 ^ a x) encIn Turing.MultiTapeTM.encUnary) (hi : Turing.MultiTapeTM.ComputableInPolyTime i encIn Turing.MultiTapeTM.encUnary) (hT : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : δ) => 2 ^ (i x + 1)) encIn Turing.MultiTapeTM.encUnary) (hpt : Turing.MultiTapeTM.ComputableInPolyTime pt encIn Turing.MultiTapeTM.encUnary) (ht : Turing.MultiTapeTM.ComputableInPolyTime t encIn Turing.MultiTapeTM.encIntBin) (hζ : Turing.MultiTapeTM.ComputableInPolyTime ζ encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (hr : Turing.MultiTapeTM.ComputableInPolyTime r encIn Turing.MultiTapeTM.encNat) (hD : Turing.MultiTapeTM.ComputableInPolyTime D encIn (DescribedNetwork.encDescribed (VertexDesc.enc encT))) (hpk : Turing.MultiTapeTM.ComputableInPolyTime pk encIn PacketPacking.encNativePacking) (hP : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : δ) => (pk x).2.1) encIn Turing.MultiTapeTM.encUnary) (hβ : Turing.MultiTapeTM.ComputableInPolyTime β encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary)) (hg : Turing.MultiTapeTM.ComputableInPolyTime g encIn Turing.MultiTapeTM.encNat) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : δ) => nativeChild (fl x) (a x) (i x) (pt x) (t x) (ζ x) (r x) (D x) (pk x) (β x) (g x)) encIn (DescribedNetwork.encDescribed (VertexDesc.enc encT))

The native child is polynomial-time. The counts a, i and p_t are unary, the node t is in binary sign-magnitude form, the lists fl and ζ, the number of rows r and the group g are in binary, and the exponents β are unary. The child stores 2 ^ a and 2 ^ (i + 1) in unary in every packet vertex and has one packet vertex per packet, so these and the number of packets are asked for in unary.

The child of the native parent packing #

At most M (2 ^ a) ^ 12 packets: the native parent packing of a network with M edges has at most one block of 2 ^ a slots per edge, times the 4096 ^ a words of pairs of symbols.

The number of packets of the native parent packing in unary is polynomial-time, with a and 2 ^ a in unary.

theorem Cslib.Circuits.Frontier.NativeChild.computableInPolyTime_nativeChild_nativeParentPacking {T : Type} {encT : T ↪ List Bool} {δ : Type} {encIn : δ ↪ List Bool} {fl ζ β : δ → List ℕ} {a i pt r g : δ → ℕ} {t : δ → ℤ} {D : δ → DescribedNetwork (VertexDesc T)} (hfl : Turing.MultiTapeTM.ComputableInPolyTime fl encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (ha : Turing.MultiTapeTM.ComputableInPolyTime a encIn Turing.MultiTapeTM.encUnary) (hL : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : δ) => 2 ^ a x) encIn Turing.MultiTapeTM.encUnary) (hi : Turing.MultiTapeTM.ComputableInPolyTime i encIn Turing.MultiTapeTM.encUnary) (hT : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : δ) => 2 ^ (i x + 1)) encIn Turing.MultiTapeTM.encUnary) (hpt : Turing.MultiTapeTM.ComputableInPolyTime pt encIn Turing.MultiTapeTM.encUnary) (ht : Turing.MultiTapeTM.ComputableInPolyTime t encIn Turing.MultiTapeTM.encIntBin) (hζ : Turing.MultiTapeTM.ComputableInPolyTime ζ encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) (hr : Turing.MultiTapeTM.ComputableInPolyTime r encIn Turing.MultiTapeTM.encUnary) (hD : Turing.MultiTapeTM.ComputableInPolyTime D encIn (DescribedNetwork.encDescribed (VertexDesc.enc encT))) (hβ : Turing.MultiTapeTM.ComputableInPolyTime β encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary)) (hg : Turing.MultiTapeTM.ComputableInPolyTime g encIn Turing.MultiTapeTM.encNat) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : δ) => nativeChild (fl x) (a x) (i x) (pt x) (t x) (ζ x) (r x) (D x) (nativeParentPacking (r x) (a x) (D x)) (β x) (g x)) encIn (DescribedNetwork.encDescribed (VertexDesc.enc encT))

The native child of the native parent packing is polynomial-time, with the number of rows in unary (computableInPolyTime_nativeChild for nativeParentPacking).

The shape of the native child #

theorem Cslib.Circuits.Frontier.NativeChild.numEdges_nativeChild_le {T : Type} (fl : List ℕ) (a i pt : ℕ) (t : ℤ) (ζ : List ℕ) (r : ℕ) (D : DescribedNetwork (VertexDesc T)) (pk : (List (List ℕ) × List (List ℕ)) × ℕ × List (ℕ × ℕ)) (β : List ℕ) (g : ℕ) :
(nativeChild fl a i pt t ζ r D pk β g).numEdges ≤ 2 * D.numEdges

The child has at most twice as many edges as the parent: one per end of a parent edge in group g.

theorem Cslib.Circuits.Frontier.NativeChild.length_vertices_nativeChild {T : Type} (fl : List ℕ) (a i pt : ℕ) (t : ℤ) (ζ : List ℕ) (r : ℕ) (D : DescribedNetwork (VertexDesc T)) (pk : (List (List ℕ) × List (List ℕ)) × ℕ × List (ℕ × ℕ)) (β : List ℕ) (g : ℕ) :
(nativeChild fl a i pt t ζ r D pk β g).vertices.length = childRows r i D pk g + pk.2.1

The vertices of the child: its rows, the parent vertices of group g, then one packet vertex per packet.

theorem Cslib.Circuits.Frontier.NativeChild.mem_vertices_nativeChild {T : Type} (fl : List ℕ) (a i pt : ℕ) (t : ℤ) (ζ : List ℕ) (r : ℕ) (D : DescribedNetwork (VertexDesc T)) (pk : (List (List ℕ) × List (List ℕ)) × ℕ × List (ℕ × ℕ)) (β : List ℕ) (g : ℕ) {v : List ℕ × VertexDesc T} (hv : v ∈ (nativeChild fl a i pt t ζ r D pk β g).vertices) :
(∃ w ∈ D.vertices, v.2 = w.2 ∧ v.1.length = w.1.length) ∨ ∃ q < pk.2.1, ∃ (tags : List (Bool × ℕ)), v.2 = Sum.inr (packetCtx fl a i pt t ζ g q, tags, betaSlice i pt β q) ∧ tags.length = v.1.length ∧ ∀ b ∈ tags, b.2 = 0 ∨ ∃ y ∈ pk.2.2, b.2 = y.2

Every vertex of the child is a parent vertex or a packet vertex. A vertex of the child is either a parent vertex with renumbered ports, with the same descriptor and the same number of ports, or the vertex of a packet q, whose descriptor is its context, tags of its ports with slots from the packing (or 0), and its slice of β.

theorem Cslib.Circuits.Frontier.NativeChild.length_betaSlice_le (i pt : ℕ) (β : List ℕ) (q : ℕ) :
(betaSlice i pt β q).length ≤ 2 ^ (i + 1) * pt

The slice of β at a packet has at most 2 ^ (i + 1) p_t exponents.

theorem Cslib.Circuits.Frontier.NativeChild.mem_of_mem_betaSlice (i pt : ℕ) (β : List ℕ) {q b : ℕ} (hb : b ∈ betaSlice i pt β q) :
b ∈ β

The exponents in the slice of β at a packet are exponents of β.