Proof of `Evaluation of distance formulas on type trees`

groundedproofs/Lax185574Proofs/Evaluation.lean · lax-185574

What this proof establishes

no assumptions

Assuming the claims on the left, the claim on the right holds — checked by the archive's pipeline. Proof code is not displayed here.

Read the Lean proof on GitHub

In the paper

  • page 42 of this submission's paper

Description

The program reads the tree, copies the word of its root into an array, reads the code of the formula into a second array, and lists the nodes of the tree in breadth-first order. It fills a table with a row for every position of the code and a column for every node, from the last position to the first. At a position where a subformula starts, the entry of a node is the value of the subformula at the node: an atom is looked up among the atom codes of the node, a negation or a conjunction is read off the rows of its subformulas, and ∃y(dist(xi,y)≤s∧ψ)∃ y (dist(xᵢ, y) ≤ s ∧ ψ) holds if some extension of the node with guard ii has a child where ψψ holds, read off the row of ψψ. A second table records where every subformula ends, which locates the second conjunct of a conjunction. This is the recursion of the proof of the evaluation lemma over pairs of a subformula and a node. The answer is the entry of the first position at the root, which is the semantic core evalNodeevalNode, whose correctness is evalNodenodeevalNode_node. A cell takes time linear in the length of the input, so the time is a polynomial of degree three. Every value is at most a constant times the square of the input length, so word-length exponent 22 suffices.

The proof is carried out for the notion Lax185574.Computing.ComputesLax185574.Computing.Computes, and transferred to Lax185574.Algorithms.Algorithm.ComputesLax185574.Algorithms.Algorithm.Computes through Lax185574Proofs.InterfaceLax185574Proofs.Interface.