Documentation

LeanPool.PointwiseComposition.CategoricalRiceShapiro.ArithmeticCode.PartialRecursiveEvaluation

Supporting results for pointwise provable equality.

Evaluation existence for the partial-recursive index decoders #

PartialRecursive defines the four codes that read a partial-recursive index: its constructor tag, its payload, and the two components of that payload. This file proves that each has a value in an arbitrary model of 𝐏𝐀, given a value for the index.

Nothing here decodes an index or asserts what the value is. For an arbitrary element of the model the constructions still terminate, and only that is proved; no witness is identified with a quotient, a remainder or a Cantor component of an external number.

The tag is an eager conditional, so both of its branches are evaluated before the test selects one: the index itself, and the compound tag built from the two parity bits of the shifted index.

The payload of a partial-recursive index has a value at any value of the index: the shifted index is a truncated difference, and halving it twice has a value by eval_codeDiv2_exists_of_value.

The constructor tag of a partial-recursive index has a value at any value of the index.

codeIfPos is eager, so both branches are evaluated whatever the test does: the index itself, and the compound tag 4 + 2 * (r % 2) + (h % 2), where r is the shifted index and h is some value of its half. The comparison against 4 then selects one of the two.