Documentation

LeanPool.PointwiseComposition.CategoricalRiceShapiro.Evaluator.CellEvaluation

Supporting results for pointwise provable equality.

Success and totality of an evaluator cell #

This module states two kinds of result, with different assumptions.

The success theorems describe a cell that has already reported a positive value: the encoded Option is x + 1 when the computation returned x. eval_codeOptionBind_succ_iff and eval_codeCompEvaluatorCell_succ_iff use 𝐏𝐀⁻. eval_codePairEvaluatorCell_succ_iff characterises the two successful lookups and their Cantor-pair result over 𝐈𝐎𝐩𝐞𝐧; its proof uses the public eval_codePair API at that fragment. None asserts that a cell has a value at all.

Over 𝐏𝐀, eval_codeEvaluatorCell_exists_of_values asserts exactly that: from values for the table and the argument alone, the whole cell has a value. The cell is a nested eager conditional, so the proof evaluates all five branches — base, pairing, composition, primitive recursion and minimization — together with every lookup and every option continuation inside them, whichever branch the tag comparisons end up selecting. It asserts existence only and identifies no value.

A successful bind on an encoded option: the bound code succeeds with some value, and the body succeeds at that value.

Success of the pairing branch: the first index succeeds on the argument, the second index succeeds on the same argument, and the cell reports the Cantor pair of the two results.

Success of the composition branch: the inner index succeeds on the argument, and the outer index succeeds on that intermediate value.

Totality of an evaluator cell #

The primitive-recursion cell has a value. Both arms of its eager conditional are evaluated: the step lookup with its continuation, and the base lookup.

An evaluator cell has a value at any table and argument values.

The cell is a nested eager conditional, so every one of its five branches is evaluated before the tag comparisons select one, and each branch in turn supplies every lookup and every option continuation it contains. Only existence is asserted: nothing here decodes the table, the index, or the program, and no value is identified.