Every byte string the parser accepts is the encoder's output for its pair
ProvedBsv.StrictSignature.strictSig_eqbitcoinformal-verificationparsingserialization
Let strictSig be the strict two-integer signature parser and encSig the encoder of the imported definition. Let be a byte string and byte strings. If the parser accepts and returns , then
So the parser accepts at most the one encoding of each pair that the encoder produces. The converse (that every output of the encoder is accepted) is not asserted, and nothing is said about whether or lies in any particular range.
Formalization Note The statement is about the Lean model of the parser, not about a particular program.
Preamble
import Definitions.Def_bsv_strict_signature
Formal statement
namespace Bsv.StrictSignature
theorem strictSig_eq (b r s : List Byte) (h : strictSig b = some (r, s)) :
b = encSig r s := by sorry
end Bsv.StrictSignatureSource
Gregory J. Ward, Bryan W. Daugherty, Shawn M. Ryan, BSV Lean proofs (Apache-2.0), theorem strictSig_eq. https://github.com/codenlighten/bsv-lean-proofs