Quantitative computability rules #
fun_prop (disch := lia) composes degree certificates (ComputableInDegree and
ComputableTidilyInDegree) without replacing output-size bounds by
runtime bounds. Computation premises determine the intermediate encodings and degrees before the
arithmetic obligations compare the resulting degrees with the requested ones. The same fun_prop
interface recognizes ordinary finite-state bit folds with linear time and constant work space.
For nested projections with inferred degrees, disch := first | apply le_refl | lia first
instantiates a missing degree with the derived bound, then checks arithmetic inequalities.
Framed-list and option rules infer the payload encoding from the representation explicitly.
Main results #
Turing.MultiTapeTM.ComputableInDegree.foldl',Turing.MultiTapeTM.ComputableInDegree.foldlWith: plain left folds with degree bounds.Turing.MultiTapeTM.ComputableInDegree.natSucc: binary successor with degrees one.Turing.MultiTapeTM.computableInDegree_add,Turing.MultiTapeTM.computableInDegree_mul: plain binary addition (quadratic) and multiplication (cubic).Turing.MultiTapeTM.ComputableInO.comp_enc: reuse a bit-word computation on encoded instances, with bounds evaluated on their encodings.Turing.MultiTapeTM.ComputableInO.lengthUnary: compute bit-word length in unary within linear time and space.Turing.MultiTapeTM.ComputableInO.unary_two_pow: compute2 ^ nfrom unarynwithin timeO((n + 1) * 2 ^ n)and spaceO(2 ^ n).Turing.MultiTapeTM.ComputableInDegree.comp_le,.prod_le,.ite_le: plain composition, pairing, and branching at requested degrees, retaining output-size bounds.Turing.MultiTapeTM.ComputableInDegree.bitsReverse,Turing.MultiTapeTM.ComputableInDegree.bitsDropLast,Turing.MultiTapeTM.ComputableInDegree.bitsGetLast?ToList,Turing.MultiTapeTM.ComputableInDegree.bitsGetLast?,Turing.MultiTapeTM.ComputableInDegree.optionBoolToList,Turing.MultiTapeTM.ComputableInDegree.bitsAppend,Turing.MultiTapeTM.ComputableInDegree.unaryAdd: plain degree rules for raw bit-list reversal, prefix, last-bit extraction, concatenation, and unary addition (alongside tidy counterparts).
References #
Uses Christian Reitwiessner's degree calculus and streaming backend; see the source markers in
Degree.lean and CslibFrontier/Computability/Machines/Turing/MultiTape/Encodings/StreamFold.lean.
The first component of a pair computed with given degrees.
The second component of a pair computed with given degrees.
List.headD on any list encoding.
List.tail on any list encoding.
List.isEmpty on any list encoding.
Left folds with bounds of given degrees, compiled directly from plain degree certificates.
Left folds with a parameter, keeping par x in the fold state.
Adding one on unary-magnitude signed integers.
Subtracting one on unary-magnitude signed integers.
Equality for any encoding in quadratic time/space and constant output length.
The result encoding fixes the element encoding, without reversing ListEncoding inference.
The framed input list determines the encoding of its head, including a fixed fallback.
Testing a framed list for emptiness.
The option encoding determines the encoding used for the payload and fallback.
Copy an encoded value. This identity rule also lets fun_prop retain a shared let binding.
Reverse a raw bit list in linear time and linear output size.
Drop the last bit of a raw bit list in linear time and linear output size.
Extract the last bit of a raw bit list as a 0-or-1-element list in linear time and constant output size.
Extract the last bit of a raw bit list as an Option Bool in linear time and constant output
size.
Convert an Option Bool to a 0-or-1-element bit list in linear time and linear output size.
Concatenate two raw bit lists while preserving their time and output degrees independently.
Add two unary natural numbers while preserving their time and output degrees independently.
Compose using the intermediate output size. The computation premises determine the degrees before arithmetic compares them with the requested bound.
Pair two results while preserving their output degrees independently of computation time.
Branching on a computed Boolean, retaining each branch's output degree.
The result encoding fixes the element encoding, without reversing ListEncoding inference.
The framed input list determines the encoding of its head, including a fixed fallback.
Testing a framed list for emptiness.
The option encoding determines the encoding used for the payload and fallback.
Copy an encoded value. This identity rule also lets fun_prop retain a shared let binding.
Reverse a raw bit list in linear time and linear output size.
Drop the last bit of a raw bit list in linear time and linear output size.
Extract the last bit of a raw bit list as a 0-or-1-element list in linear time and constant output size.
Extract the last bit of a raw bit list as an Option Bool in linear time and constant output
size.
Convert an Option Bool to a 0-or-1-element bit list in linear time and linear output size.
Concatenate two raw bit lists while preserving their time and output degrees independently.
Add two unary natural numbers while preserving their time and output degrees independently.
Compose using the intermediate output size. The computation premises determine the degrees before arithmetic compares them with the requested bound.
Pair two results while preserving their output degrees independently of computation time.
Branching on a computed Boolean, retaining each branch's output degree.
A function of bit words computed within given bounds is computed by the same machine on encoded instances.
The length of a bit word in unary, within linear time and space, by the streaming machine of
Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.length_bits.