Draft — mutable and not usable as a dependency; its citation marks the draft state.

Lax53.StructuralRepresentations

Certified structural representations for ranked-tree model checking

concepts/Lax53/StructuralRepresentations.lean · lax-53

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Concept map

    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Definition and theorem

    The finite automaton values used by the uniform evaluator have explicit structural presentations. Product and list codes are built transitively from the fixed lax58lax-58 vocabulary. Intrinsic formulas and ranked trees have datatype-specific first-class certificates covering every constructor and primitive field. Each derivecertifiedencodingderive_certified_encoding invocation emits the encoder, its .Laws.Laws proposition, and its .certified.certified witness. For example, `#print formulaStructure.Laws` displays the full generated formula contract. Field resolution is closed and never consults FieldEncodingFieldEncoding instances.

    These presentations contain no compiled automaton, semantic annotation, or other advice. Their distinguished word-memory realization is the generic Lax58.WordArena.encodeLax58.WordArena.encode construction. Any evaluator-specific representation engineering belongs only to the proof package and is charged there.

    Lean source view on GitHub

    1import Lax58.CertifiedDerivationElab
    2import Lax58.WordArena
    3import Lax53.ValueTranslations
    4
    5/-!
    6---
    7title: Certified structural representations for ranked-tree model checking
    8type: definition and theorem
    9---
    10
    11The finite automaton values used by the uniform evaluator have explicit
    12structural presentations. Product and list codes are built transitively from
    13the fixed `lax-58` vocabulary. Intrinsic formulas and ranked trees have
    14datatype-specific first-class certificates covering every constructor and
    15primitive field. Each `derive_certified_encoding` invocation emits the encoder,
    16its `.Laws` proposition, and its `.certified` witness. For example,
    17`#print formulaStructure.Laws` displays the full generated formula contract.
    18Field resolution is closed and never consults `FieldEncoding` instances.
    19
    20These presentations contain no compiled automaton, semantic annotation, or
    21other advice. Their distinguished word-memory realization is the generic
    22`Lax58.WordArena.encode` construction. Any evaluator-specific representation
    23engineering belongs only to the proof package and is charged there.
    24-/
    25
    26namespace Lax53.StructuralRepresentations
    27
    28open FirstOrder
    29open FirstOrder.Language
    30open Lax52.MSOSyntax
    31open Lax53.RankedTree
    32open Lax53.TreeStructure
    33open Lax53.ValueTranslations
    34open Lax58.StructuralPresentation
    35open Lax58.StructuralPresentation.Presentation
    36open Lax58.StructuralCombinators
    37open Lax58.CertifiedDerivation
    38
    39universe u
    40
    41/-- Structural presentation of the complete finite automaton value. Its
    42components are derived automatically from the `Nat`, product, and ordered-list
    43structure of `EncodedAutomaton`. -/
    44def automatonPresentation : Presentation EncodedAutomaton :=
    45 derivedPresentation
    46
    47/-- Structural representation of a term in the ranked-tree signature. That
    48signature has no function symbols, so every term is intrinsically a variable;
    49the impossible function case carries no represented data. -/
    50derive_certified_encoding termStructure (alphabet : RankedAlphabetCode)
    51 indexed {n : Nat} :
    52 (treeSignature alphabet.toRankedAlphabet).Term (Fin n)
    53
    54/-- Structural representation of a relation symbol in the ranked-tree
    55signature. Subtype proofs in child indices are erased; their natural value is
    56the complete computational content of the field. -/
    57derive_certified_encoding relationStructure (alphabet : RankedAlphabetCode)
    58 indexed {arity : Nat} :
    59 (treeSignature alphabet.toRankedAlphabet).Relations arity
    60
    61/-- Constructor-derived structural representation of the existing intrinsic
    62Lax-52 formula syntax. Recursive occurrences are represented recursively and
    63finite term families are enumerated in their intrinsic order. This is not a
    64second formula datatype and performs no elaboration or semantic preprocessing. -/
    65derive_certified_encoding formulaStructure (alphabet : RankedAlphabetCode)
    66 indexed {n m : Nat} :
    67 Formula (treeSignature alphabet.toRankedAlphabet) n m
    68
    69/-- Named structural presentation of intrinsically scoped MSO sentences. -/
    70noncomputable def sentencePresentation (alphabet : RankedAlphabetCode) :
    71 Presentation (Lax52.MSOSyntax.Sentence
    72 (treeSignature alphabet.toRankedAlphabet)) :=
    73 Lax58.StructuralPresentation.presentationOf (formulaStructure alphabet)
    74
    75/-- Constructor-structural map for a ranked tree over an encoded alphabet. -/
    76derive_certified_encoding treeStructure (alphabet : RankedAlphabetCode)
    77 indexed : Tree alphabet.toRankedAlphabet
    78
    79/-- Named structural presentation of ranked trees. -/
    80noncomputable def treePresentation (alphabet : RankedAlphabetCode) :
    81 Presentation (Tree alphabet.toRankedAlphabet) :=
    82 Lax58.StructuralPresentation.presentationOf (treeStructure alphabet)
    83
    84/-- The complete generated formula laws use only certified fields, including
    85the generated term and relation encodings. -/
    86axiom formula_structural (alphabet : RankedAlphabetCode) :
    87 ∀ {n m : Nat}, formulaStructure.Laws alphabet (n := n) (m := m)
    88
    89/-- The tree encoder agrees pointwise with the complete constructor fold
    90generated from the dependent ranked-tree datatype. -/
    91axiom tree_structural (alphabet : RankedAlphabetCode) :
    92 treeStructure.Laws alphabet
    93
    94/-- The recursive tree presentation is a genuine round-tripping
    95presentation. Advice-freedom is stated separately by `tree_structural`. -/
    96axiom tree_lawful (alphabet : RankedAlphabetCode) :
    97 (StructuralRepresentations.treePresentation alphabet).Lawful
    98
    99/-- The constructor-derived sentence representation is a genuine
    100round-tripping presentation. -/
    101axiom sentence_lawful (alphabet : RankedAlphabetCode) :
    102 (StructuralRepresentations.sentencePresentation alphabet).Lawful
    103
    104end Lax53.StructuralRepresentations
    105
    Show ProofShow ProofShow ProofShow Proof

    Community review

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.

    0 comments

    Loading discussion…