NLA-lib Explorer

Randomized claims about a certificate

Library · Source module

Randomized claims about a certificate

A certificate NLAlib.Ops.Algorithm states what every run does, on every tape. The accuracy of a randomized algorithm is a statement about the law of the tape, and it is a separate theorem. A NLAlib.Ops.RandomizedClaim ties the two together, in one object a reader can find from the certificate: it names

* the certificate it is about (its type is RandomizedClaim A); * the law of the tape (law): which probability spaces and random tapes the claim covers; * the hypotheses on the size and the input (admits) and on the interpretation of the operations (interprets); * the accuracy event (event), a property of the count and the final memory of the run; * the failure bound (bound), a function of the size and the input;

and it carries the proof (holds) that, under that law, the probability that the counted run of the certified program fails, exceeds a resource bound of the specification or misses the event is at most the bound. The run in the statement is the run of the certificate: the same program, from the initial memory of the problem.

The law of a tape is given in one of two forms. NLAlib.Ops.TapeModel.streams says the entries of the tape are independent with stated laws on named streams. NLAlib.Ops.TapeModel.packed says the tape is a stated packing of a random mathematical object with a stated law. A claim may also state its law directly.

A claim about a law that no tape has would be empty. Every claim proves its law NLAlib.Ops.TapeModel.Realizable (the field realizable): streams requires its stream identifiers to be distinct, and is realizable when the listed laws are probability measures; packed is realizable when the law of the object is. The hypotheses admits and interprets are not proved satisfiable in the structure: they are numerical conditions in the parameters of a claim (a unit roundoff, thresholds, a measurable interpretation), which only a hypothesis of the claim could supply; they are read in the claim, and the certificate report prints them.

A certificate whose routine has the specification NLAlib.Ops.Routine.Spec.terminates claims nothing of what it writes; such a certificate has a randomized claim, and the certificate check scripts/OpsPrograms.lean fails otherwise.

Main definitions

* NLAlib.Ops.TapeModel, NLAlib.Ops.TapeModel.streams, NLAlib.Ops.TapeModel.packed: laws of the tape. * NLAlib.Ops.TapeModel.Realizable: some probability space carries a tape with the law. * NLAlib.Ops.Algorithm.FailsAtMost: the statement of a claim. * NLAlib.Ops.RandomizedClaim: the claim.

Main results

* NLAlib.Ops.TapeModel.realizable_streams, NLAlib.Ops.TapeModel.realizable_packed: the two named laws are realizable. * NLAlib.Ops.RandomizedClaim.ofReference, NLAlib.Ops.RandomizedClaim.ofWp: a claim from each of the two transfers of NLAlib/Ops/Probability.lean.

Declarations