Proof of `Canonical form`

groundedproofs/Lax185574Proofs/CanonicalForm.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 list of words into arrays, the entries one after the other with the start and the length of every word. It then selects the distinct words in increasing order: in round tt it scans all words and keeps the smallest one above the word selected in round t−1t - 1, comparing words lexicographically entry by entry. The indices of the selected words are recorded, and finally their number and their frames are written. With mm words of total length NN, this takes O(m2⋅N)O(m² · N) steps, so cubic time in the length of the input. Every value the program produces is at most the length of the input plus its largest entry, so word-length exponent 11 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.