Alphabeta Math
Pipeline-generated
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

✓ 4 results · all verified · 4 also independently AI-judged
Every result on this page is machine-checked by a proof checker and read in full and owner-audited; the judge is an additional, independent cross-model AI review of the proofs; all 4 also cleared it.

Finite Trellises, Viterbi, and Sequence Decoding

1 · Prerequisites

None. This page is self-contained.

2 · Summary

Finite trellises turn finite-horizon path optimization into a layer-by-layer recurrence; the zero-length trellis has a unique empty path of score 1. The Viterbi procedure stores one maximizing predecessor per state and recovers a complete maximum-score path by traceback. A finite discrete HMM is a weighted trellis whose path weights are joint probabilities of hidden states and observations. The sequence-MAP theorem handles ties and separates positive-evidence decoding from the zero-evidence case, where no conditional posterior path distribution exists.

3 · Logical flowchart

4 · Definitions, theorems and proofs

DefinitionDefinition: AI-adaptedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Finite weighted trellises

Definition

A finite weighted trellis has an integer length T≥0. If T=0, it is the empty structure, with no vertex layers, edges, or endpoint weights. If T≥1, it consists of finite vertex sets V1,…,VT, edge sets Et⊆Vt−1×Vt for 2≤t≤T, positive edge weights wt:Et→(0,∞), and initial and terminal weights α:V1→[0,∞) and β:VT→[0,∞). The sets Vt may be empty. A zero initial or terminal weight disables that endpoint; every edge in Et is allowed and has positive weight.

A path for T≥1 is a tuple (v1,…,vT) with vt∈Vt, α(v1)>0, β(vT)>0, and (vt−1,vt)∈Et for every 2≤t≤T. Its score is α(v1)(∏t=2Twt(vt−1,vt))β(vT), where the empty product for T=1 is 1. For T=0, the unique path is the empty tuple, with score 1 (the empty product).

A prefix path through layer t, for 1≤t≤T, satisfies the same conditions through vt, without a terminal-weight condition. For T=0, the empty tuple is the unique prefix path through no layers, with score 1. A vertex v∈Vt is reachable if some prefix path ends at v; otherwise it is unreachable. There are finitely many paths. If at least one path exists, its maximum score is attained; if none exists, the trellis has no admissible path.

DefinitionDefinition: AI-adaptedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Finite hidden Markov models for sequence decoding

Definition

A finite discrete hidden Markov model (HMM) is a tuple (S,Y,π,A,B), where S is a finite nonempty hidden-state set, Y is a finite nonempty observation alphabet, π:S→[0,1] is an initial probability distribution, A:S×S→[0,1] is a transition matrix, and B:S×Y→[0,1] is an emission matrix. The parameters satisfy ∑s∈Sπ(s)=1,∑s′∈SA(s,s′)=1(s∈S),∑y∈YB(s,y)=1(s∈S).

For each length T≥1, hidden path z=(z1,…,zT)∈ST, and observation sequence y=(y1,…,yT)∈YT, define the joint mass p(z,y)=π(z1)B(z1,y1)∏t=2TA(zt−1,zt)B(zt,yt). The evidence of y is p(y)=∑z∈STp(z,y). When p(y)>0, the conditional path mass is p(z∣y)=p(z,y)/p(y), and a sequence MAP (maximum-a-posteriori) path is any z maximizing this conditional mass. If p(y)=0, the conditional path mass is undefined, so there is no posterior sequence MAP path for that observation sequence. A zero transition or emission factor gives that hidden path zero joint mass.

LemmaStatement: AI-adaptedProof: AI-generatedprecheck passjudge pass (gpt-6-luna)Open item page →

The optimal-prefix recurrence for a finite trellis

Statement

For a finite weighted trellis with T=0, the unique prefix path through no layers is empty and has score 1. For T≥1, define D1(v)=α(v) and, for 2≤t≤T, Dt(v)=max⁡({Dt−1(u)wt(u,v):(u,v)∈Et}∪{0}). Then Dt(v) is the maximum score of a prefix path ending at v; if no such prefix exists, Dt(v)=0.

Facts & Assumptions

Given: A finite weighted trellis as in the Definition.

[F1]

Finite weighted trellises: For T=0, the unique path through no layers is empty with score 1. For T≥1, a prefix path through layer t starts with positive initial weight and follows an allowed edge at each preceding layer; its score through t is the initial weight times the edge weights.

[A1]

For an induction step at layer t≥2, assume that Dt−1(u) is the maximum score of a prefix path ending at each u∈Vt−1, and is zero exactly when no such prefix path exists.

Proof

1.1givenF1algebra

If T=0, the unique prefix path through no layers is empty and has score 1. For T≥1, at layer 1 the only prefix ending at v is the one-vertex prefix. It exists exactly when α(v)>0, and then has score α(v)=D1(v); when α(v)=0 there is no prefix and D1(v)=0.

1.2givenF1A1algebra

Fix t≥2 and v∈Vt. Every prefix ending at v has a predecessor u with (u,v)∈Et and is obtained by appending that edge to a prefix ending at u. Its score is the predecessor-prefix score multiplied by the positive weight wt(u,v). By [A1], the best such extension through each u has score Dt−1(u)wt(u,v); if no predecessor prefix exists this value is zero. Taking the maximum over the finite predecessor set, with zero when it is empty, gives exactly the stated recurrence.

2.1step 1.1step 1.2induction∎

The T=0 case and the base case in step 1.1, together with the induction step in step 1.2, prove the claim for every trellis length and every layer.

LemmaStatement: Literature-sourcedProof: AI-generatedprecheck passjudge pass (gpt-6-luna)Open item page →

The finite hidden Markov joint law is normalized

Statement

For every finite discrete HMM and each integer T≥1, the joint masses p(z,y) in the Definition sum to 1 over all hidden paths z∈ST and observation sequences y∈YT.

Facts & Assumptions

Given: A finite discrete HMM (S,Y,π,A,B) and T≥1.

[F1]

Finite hidden Markov models for sequence decoding: The initial weights satisfy ∑s∈Sπ(s)=1, each transition row satisfies ∑s′∈SA(s,s′)=1, each emission row satisfies ∑y∈YB(s,y)=1, and p(z,y)=π(z1)B(z1,y1)∏t=2TA(zt−1,zt)B(zt,yt).

Proof

1.1givenF1algebra

Fix a hidden path z. Finite distributivity and the emission row sums in [F1] give ∑y∈YTp(z,y)=π(z1)∏t=2TA(zt−1,zt), because summing over each coordinate yt contributes the factor ∑yt∈YB(zt,yt)=1.

2.1givenF1step 1.1algebra∎

Sum the expression in step 1.1 over all z∈ST. Summing first over zT, then zT−1 down to z2, removes one transition factor at a time by the corresponding row sum in [F1]. The remaining sum is ∑z1∈Sπ(z1)=1. Thus the total joint mass is 1.

AlgorithmAlgorithm: AI-adaptedProof: Not applicableOpen item page →

Max-product Viterbi decoding on a finite trellis

Definition

Input: A finite weighted trellis and a total order on each vertex set.

Output: “No admissible path,” or an admissible path and its score.

If T=0, return the empty path with score 1. Otherwise perform the following steps:

  1. Set D1(v)=α(v) for all v∈V1. For each layer t=2,…,T and each v∈Vt, compute Dt(v)=max⁡({Dt−1(u)wt(u,v):(u,v)∈Et}∪{0}). If Dt(v)>0, store as pt(v) the first predecessor u in the supplied vertex order attaining this maximum; if Dt(v)=0, leave pt(v) undefined.
  2. Compute Q(v)=DT(v)β(v) for all v∈VT. If every Q(v)=0, return “no admissible path.”
  3. Otherwise choose the first vT in the supplied order maximizing Q(v), and follow the stored pointers pT(vT),pT−1(vT−1),…,p2(v2) backwards. Return the resulting path and its score Q(vT).

The stored predecessor at each layer is a backpointer. Following these pointers backward from a maximizing terminal vertex is called traceback. The given orders make the returned path deterministic when several paths have the same maximum score. The empty path at T=0 is the unique path and is therefore the unique maximum-score output in that case.

TheoremStatement: AI-adaptedProof: AI-generatedprecheck passjudge pass (gpt-6-luna)Open item page →

Finite-trellis Viterbi decoding returns a maximum-score path

Statement

For every finite weighted trellis, the algorithm returns “no admissible path” exactly when the trellis has no path. Otherwise it returns an admissible path whose score is maximal among all admissible paths. If V=∑t=1T∣Vt∣ and E=∑t=2T∣Et∣ (with empty sums taken as 0), then when each real multiplication and comparison is counted as one operation the running time is O(1+T+V+E) and the auxiliary storage is O(1+V). In the T=0 case the algorithm returns the unique empty path with score 1.

Facts & Assumptions

Given: A finite weighted trellis, a total order on each vertex set, and the algorithm in the Definition.

[F1]

Finite weighted trellises: When T=0, the unique path is the empty tuple with score 1. When T≥1, every allowed edge weight is positive. A path has positive initial and terminal weights, follows one allowed edge between each pair of consecutive layers, and has score equal to the product of its endpoint and edge weights.

[F2]

The optimal-prefix recurrence for a finite trellis: When T=0, the unique prefix path through no layers has score 1. When T≥1, the recurrence table Dt(v) is the maximum score of a prefix path ending at v, and is zero exactly when no such prefix path exists.

[F3]

Max-product Viterbi decoding on a finite trellis: When T=0, the algorithm returns the empty path with score 1. When T≥1, it stores a maximizing predecessor for each positive Dt(v) with t≥2, maximizes DT(v)β(v) at the terminal layer, and returns the path obtained by following those backpointers.

Proof

1.1givenF1F2F3algebra

If T=0, [F1] gives the unique empty path and its score 1, which the branch in [F3] returns. If T≥1, [F2] shows that every positive Dt(v) is attained by a prefix path and a zero value means there is no such prefix. Therefore, for each terminal vertex v, DT(v)β(v)>0 exactly when some full path ends at v; when positive it is the largest score of such a path.

2.1givenF1F2F3step 1.1inductionalgebra

Suppose T≥1. The finite set of terminal values has a positive maximum exactly when at least one full path exists. If it is positive, let vT be the maximizing terminal vertex; then DT(vT)>0 and β(vT)>0. If T=1, then D1(v)=α(v) and Q(v)=α(v)β(v), so the selected one-vertex tuple (v1) is already an admissible path of maximum score; no backpointer is needed. If T≥2, then by [F3], pT(vT) is defined and selects an allowed edge from some vT−1 with DT−1(vT−1)wT(vT−1,vT)=DT(vT)>0, so DT−1(vT−1)>0 because the edge weight is positive. In the T≥2 case, repeating this argument for the layers t=T,T−1,…,2 shows every pointer is defined, each selected pair is an allowed edge, and the chain ends at v1 with D1(v1)=α(v1)>0. The chain is therefore a path, and its score is DT(vT)β(vT), the maximum terminal value from step 1.1. If all terminal values are zero, step 1.1 shows there is no path, so the algorithm correctly returns “no admissible path.” The T=0 case is settled by step 1.1.

3.1givenF3step 2.1algebra∎

The T=0 branch takes constant time. For T≥1, each vertex is initialized or scanned a bounded number of times, each edge contributes one candidate product and comparison, and traceback visits at most T layers. Thus the time is O(1+T+V+E). The algorithm stores at most one backpointer per vertex and scores for the current and preceding layers, so auxiliary storage is O(1+V).

AlgorithmAlgorithm: AI-adaptedProof: Not applicableOpen item page →

Viterbi sequence decoding for a finite hidden Markov model

Definition

Input: A finite discrete HMM (S,Y,π,A,B), an observation sequence y=(y1,…,yT)∈YT with T≥1, and a total order on S.

  1. Form a trellis with Vt=S at every layer. Set αy(s)=π(s)B(s,y1) and terminal weights βy(s)=1.
  2. For every t=2,…,T, include the edge (r,s) exactly when A(r,s)>0 and B(s,yt)>0, and give it weight wt(r,s)=A(r,s)B(s,yt).
  3. Run Max-product Viterbi decoding on a finite trellis on this trellis using the supplied state order. If it returns no admissible path, return “zero evidence; no conditional sequence MAP.” Otherwise return its path as the decoded hidden-state sequence.

Zero transition or emission factors are omitted from the trellis, so every trellis path has positive joint mass.

TheoremStatement: Literature-sourcedProof: AI-generatedprecheck passjudge pass (gpt-6-luna)Open item page →

Finite-HMM Viterbi decoding is exact sequence MAP

Statement

Given a finite discrete HMM and an observation sequence of positive length, the sequence-decoding algorithm returns no conditional MAP path exactly when the observation evidence is zero. When the evidence is positive, it returns a hidden-state sequence maximizing the posterior probability of the entire sequence, including when there are ties.

Facts & Assumptions

Given: A finite discrete HMM (S,Y,π,A,B), a sequence y=(y1,…,yT)∈YT with T≥1, and the HMM decoding algorithm.

[F1]

Finite hidden Markov models for sequence decoding: The joint mass is p(z,y)=π(z1)B(z1,y1)∏t=2TA(zt−1,zt)B(zt,yt); the evidence is the finite sum p(y)=∑z∈STp(z,y), and for p(y)>0 the posterior path mass is p(z∣y)=p(z,y)/p(y); a sequence MAP path is any z maximizing this conditional mass.

[F2]

Viterbi sequence decoding for a finite hidden Markov model: The algorithm creates initial weights π(s)B(s,y1), transition edges exactly for positive transition and emission factors, edge weights equal to their products, and terminal weights 1; it then runs finite-trellis Viterbi.

[F3]

Finite-trellis Viterbi decoding returns a maximum-score path: Finite-trellis Viterbi returns no path exactly when no trellis path exists; otherwise it returns a path with maximum product score.

[F4]

The finite hidden Markov joint law is normalized: For each T≥1, the joint masses p(z,y) sum to 1 over all z∈ST and y∈YT.

Proof

1.1givenF1F2algebra

A hidden path z has positive joint mass exactly when its initial factor, first emission factor, and every later transition and emission factor are positive. By [F2], this is exactly the condition that z is a path in the constructed trellis. The trellis score is the product of those same factors, with terminal factor 1, so it equals p(z,y). Conversely every trellis path gives such a positive-mass hidden path.

2.1givenF1F2F3F4step 1.1algebra∎

If the trellis has no path, step 1.1 shows every summand in [F1] is zero; hence p(y)=0 and no conditional path mass is defined. If it has a path, step 1.1 gives a positive summand, so p(y)>0. By [F3], finite-trellis Viterbi then returns a path maximizing p(z,y). Dividing all path masses by the same positive p(y) preserves their order, so this path maximizes p(z∣y). The normalization in [F4] makes these masses a probability law, and the backpointer tie rule returns one of the maximizers.

5 · Examples, counterexamples and false statements

None yet.

Sources