Skip to content

About

📝 A Rocq library written by members of PnV Discord Server

Topics

Resources

Stars

19 stars

Watchers

1 watching

Forks

Latest commit

 

History

814 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PnVRocqLib

A Rocq library written by members of PnV Discord Server.

  • Currently, this library is standalone.

1. How to build

git clone https://github.com/PnVDiscord/PnVRocqLib.git
cd PnVRocqLib

eval `opam env`
rocq makefile -f _CoqProject -o CoqMakefile
eval "$(opam env)" && make -f CoqMakefile -j4

rocq -v

The Rocq Prover, version 9.2
compiled with OCaml 5.2.1

A clean build with -j4 took 4 min 41 s on 2026-11-30, and no single rocq compile process exceeded 2.2 GB of memory.

2. Main results

Index.v imports every theory outside theories/Applications/ and lists the constructive theories, Gödel's incompleteness theorems, the classical theories, and the theories with quotient types separately.

2.1. Logic

  • The weak completeness of propositional logic. (Corollary weak_completeness in PropositionalLogic.v)

  • The soundness, completeness, and compactness theorems of propositional logic. (Theorem the_propositional_soundness_theorem, Theorem the_propositional_completeness_theorem, and Corollary the_propositional_compactness_theorem in ClassicalPropositionalLogic.v)

  • The soundness theorem of first-order logic, and the completeness theorem for countable languages. (Theorem HilbertCalculus_sound and Theorem HilbertCalculus_countable_complete in ClassicalFol.v)

  • The completeness theorem of first-order logic for languages of arbitrary cardinality, and the model existence theorem. (Theorem HilbertCalculus_complete and Theorem consistent_has_model in ClassicalAdvancedFol.v)

  • The compactness theorem of first-order logic. (Corollary first_order_compactness in ClassicalAdvancedFol.v)

  • Isomorphic first-order structures satisfy the same theories and are elementarily equivalent. (Theorem isomorphism_models and Theorem isomorphism_elementarily_equivalent in the FolModel module of ExtraFol.v)

  • The downward and upward Löwenheim-Skolem theorems. (Theorem downward_Löwenheim_Skolem, Theorem upward_Löwenheim_Skolem, and their combination Theorem LöwenheimSkolem.Thm in ClassicalAdvancedFol.v)

  • The cardinality of the set of formulae of a language L is |L| + ℔₀. (Theorem frm_card in ClassicalAdvancedFol.v)

  • The space of complete types over a finite variable context is a Stone space, and its clopen subsets are exactly those defined by individual formulae. (Theorem Stone_isStoneSpace and Theorem clopen_iff_basic in the FolStone module of ClassicalAdvancedFol.v, with explicit ClassicalAxioms parameters for choice and function/proposition extensionality.)

2.2. Computability and Gödel's incompleteness theorems

  • Kleene's normal form theorem, a universal ÎŒ-recursive program, and the undecidability of the halting problem. Church's theorem shows that no total ÎŒ-recursive program decides the theorems of a consistent extension of Q. (Theorem Kleene_normal_form, Theorem univ_spec, Theorem halting_undecidable, and Theorem Church in Kleene.v)

  • The Gödel–Rosser theorem: every consistent, effectively axiomatized extension of the arithmetic theory Q of Arith1.v has a Rosser sentence that is neither provable nor refutable. No classical axiom is used. (Corollary GodelRosser in GodelRosser.v)

  • Tarski's undefinability of arithmetic truth, and the impossibility of effectively axiomatizing true arithmetic. (Corollary Tarski_classical and Corollary true_arithmetic_not_axiomatizable in ClassicalGodel.v)

  • Every consistent, effectively axiomatized extension of Q, including its order axioms, has two models that disagree on its Rosser sentence and are not elementarily equivalent. This includes PA. (Theorem GodelRosser_two_models and Theorem PA_two_models_classical in ClassicalGodel.v, with explicit ClassicalAxioms parameters for choice and function/proposition extensionality.)

  • Löb's theorem and Gödel's second incompleteness theorem under the Hilbert–Bernays–Löb derivability conditions. (Theorem Lob and Theorem Godel2_abstract in Godel2.v) For the concrete provability formula of the recursive presentation PA_rec, PeanoDerivability.v proves D2, internal Σ₁ completeness, D3, and all three derivability conditions; PeanoSchema.v transfers these results to the schema-generated PA. Godel2_PA assumes only PA's consistency, and Godel2_PA_classical in ClassicalGodel.v proves that its consistency sentence is true and unprovable without D2/D3 assumptions.

  • Peano arithmetic PA is generated by the contextual axiom-schema framework of FolFramework.v: induction uses a formula metavariable with explicit parameters and a fresh induction variable, and its instances, including formulae with parameters, characterize the induction axioms up to α-equivalence. PA_iff proves equivalence with the recursive presentation PA_rec. (PeanoSchema.v)

  • Numerical certificates for PA axiom-schema applications, including α-equivalent outputs. The certificate checker characterises membership in the schema-generated PA axioms, and concrete application data produces checked axiom witnesses and Hilbert AXM proof nodes. (Corollary ax_check_spec, Lemma encode_application_check, and Lemma AXM_check in the PeanoSchemaCoding module of PeanoSchemaCoding.v)

  • Incompleteness for effective languages containing arithmetic. Every consistent, effectively axiomatized extension of the embedded Q has a Rosser sentence that is neither provable nor refutable. (Corollary GodelRosser in GodelLanguageRosser.v) For PA with induction over all formulae of the extended language, the Hilbert–Bernays–Löb conditions are proved for the proof predicate of its equivalent recursive presentation, so the second incompleteness theorem assumes only consistency. (Theorem HBL and Corollary Godel2 in the PeanoLanguageDerivability module of PeanoLanguage.v)

2.3. Order theory, domain theory, and set theory

  • The Knaster-Tarski fixed-point theorem: a monotone map on a complete lattice has a least and a greatest fixed point, and its fixed points form a complete lattice. (Theorem KnasterTarski_1st, Theorem KnasterTarski_2nd, and Theorem KnasterTarski_3rd in DomainTheory.v)

  • A simple replica of pcofix. (Theorem pcofix in DomainTheory.v)

  • The Kleene fixed-point theorem. (Theorem lfp_returns_the_least_fixed_point in ClassicalDomainTheory.v)

  • IPO <=> pointed DCPO <=> every monotone map has a least fixed point. (Theorem ipo_iff_dcpo and Theorem dcpo_iff_every_monotonic_function_has_lfp in ClassicalDomainTheory.v)

  • The Bourbaki-Witt fixed-point theorem, the generalised Kleene fixed-point theorem, and Zorn's Lemma. (Theorem BourbakiWittFixedpointTheorem, Theorem generalised_Kleene_fixedpoint_theorem, and Theorem Zorn's_lemma in ClassicalSetTheory.v)

  • The well-ordering theorem, the Cantor-Schröder-Bernstein theorem, and Cantor's theorem. (Theorem well_ordering_thm, Theorem CantorSchröderBernstein, and Theorem powerCard_gt in ClassicalSetTheory.v)

  • A well-ordered set has order type α iff it is order-isomorphic to α. (Theorem Woset_iso_Ord in ClassicalSetTheory.v)

  • Hartogs numbers, the alephs, and the beths, with â„”_α ≀ ℶ_α. (Theorem Hartogs_spec, Theorem aleph_hasCardinality, Corollary beth_hasCardinality, and Theorem aleph_le_beth in ClassicalSetTheory.v)

  • The beth function ℶ_α(Îș) over an arbitrary base cardinal Îș, with ℶ_α = ℶ_α(â„”_0) and ℶ_{α+ÎČ}(Îș) = ℶ_ÎČ(ℶ_α(Îș)). (Definition beth_from, Theorem beth_from_add, and Corollary beth_add in ClassicalSetTheory.v)

  • |A × A| ≀ |A| for any infinite A. (Theorem Cardinality_ofType_prod_self_le_of_nat_le in ClassicalCardinal.v)

  • The trichotomy of ordinals implies the law of excluded middle. (Corollary OrdTrichotomy_implies_LEM in SetTheory.v)

  • ZFC's ordinary axioms and separation/replacement schemata in the contextual axiom-schema framework. Their schema instances yield Hilbert derivations in the generated theory. (Corollary ordinary_proves, Corollary separation_proves, and Corollary replacement_proves in ZfcFramework.v)

2.4. Type theory and semantics

  • The weak normalisation property of STLC, by normalisation by evaluation. (Corollary Normalisation_by_Evaluation in STLC.v)

  • The strong normalisation property of STLC. (Theorem Typing_implies_StrongNormalisation in STLC.v)

  • Two STLC terms of the same type in the same context are ÎČη-equivalent iff their executable normal forms are α-equivalent. (Theorem equality_iff_semantic_normalise_alpha in STLC.v)

  • Two definitions of η-long normal forms coincide. Given a function that chooses a name outside each list, the judgements clNe and clNf are equivalent to the typed neutral and normal forms typNe and typNf; the η-expansion of a neutral term is normal and, up to α-equivalence, independent of the chosen fresh names. (Corollary clNe_iff_typNe, Corollary clNf_iff_typNf, Lemma etaExpansion_typNf, and Lemma etaExpansion_fresh_alpha in the ChurchStyleStlc1 module of STLC.v)

  • Incremental higher-order pattern unification. HOPUSession in HOPUSolver.v provides solve, extend, and merge, and solve_extend_solution_iff characterises the solutions of the accumulated constraints by ÎČη factorisation through the result. extend_complete assumes supported: the new constraints are patterns after applying the current assignment and normalising. For a valid session under this condition, failure means there is no typed solution; outside it, invalid_problem reports an unsupported input. extend_anchored_no_invalid, extend_anchored_failure, and extend_anchored_complete give the same guarantees under supported_anchored, which supported_anchoredb decides. The kernel executes semantic_normalise from STLC.v, which is proved α-equivalent to NbE, the function extracted from the normalisation proof.

  • Capture-avoiding copying. Copy.v specifies the copy relation of Miller and Nadathur on named STLC terms, and CopySolver.v executes copy goals through HOPU sessions without fuel. run reports every failure as None; run_diagnostic reports the kind of failure, and run_diagnostic_erase proves that erasing it gives run. FolCopy in FolFramework.v returns the computed FOL substitution and proves its correctness and totality. PASolver in PeanoSchema.v builds Hilbert proofs in PA on these operations: pa_axiom selects an axiom, pa_induction generates the base and step goals, and pa_solve combines arithmetic simplification with induction.

  • Decidable instance checking for contextual axiom schemata. For a schema S in context xs satisfying matching_anchoredb xs S = true and equipped with an automatic_condition xs S instance, AxiomSchema.instance_of_dec decides whether a formula is an instance up to α-equivalence. (Definition instance_of_dec and Lemma instance_of_iff_found in FolFramework.v)

  • A simple replica of eutt. (Instance eutt, Instance itree_MonadLaws_eutt, and Instance itree_MonadIterSpec_eutt in BasicITreeTh.v)

  • For a graph given by successor lists, with decidable vertex equality and a finite list containing every edge target, strong normalisation from a vertex is equivalent to the absence of a reachable cycle, and an infinite execution exists iff a cycle is reachable. (Theorem sn_iff_no_reachable_cycle and Theorem forever_iff_reachable_cycle in Graph.v) Verified DFS on pairs of binary natural numbers decides global strong normalisation under the same condition on edge targets. (Theorem cycle_none_iff in DFS.v)

  • Cycle detection in undirected graphs whose edges are two-element sets of distinct vertices. Given decidable vertex equality, successor lists that list exactly the neighbours of each vertex, and a finite list containing every neighbour, cycleb returns true iff the graph has a cycle through at least three distinct vertices. (Theorem cycleb_spec and Corollary cycleb_false_spec in the Graph module of Graph.v)

2.5. Formal languages and automata

  • The pumping lemma for regular expressions. (Theorem pumping_lemma in Regex.v)

  • With decidable character equality, regular-expression simplification preserves the language and never increases the number of constructors. (Theorem reduce_regex_spec and Theorem reduce_regex_size in Regex.v)

  • Thompson's construction from regular expressions to Δ-NFAs. (Corollary thompson_accepts and Corollary thompson_rules_accepts in Automata.v)

  • The subset construction from Δ-NFAs to DFAs; the DFA accepts a word with the least tag among those the Δ-NFA accepts it with. (Theorem powerset_correct in Automata.v)

  • Hopcroft's algorithm preserves the language of a DFA and returns a minimal DFA. (Theorem hopcroft_accepts and Theorem hopcroft_isMinimal in Automata.v)

  • Conversion from total or partial DFAs to regular expressions using Kleene's recurrence with a Floyd–Warshall table. Given an alphabet that lists every character and decidable character equality, the resulting expression matches exactly the words accepted with the specified tag. (Theorem to_regex_total and Theorem to_regex_partial in Automata.v) Kleene's theorem characterises regular-expression languages exactly as those accepted by total tagged DFAs, and the Regex → DFA → Regex roundtrip preserves the language. (Theorem regular_iff_dfa and Corollary regex_dfa_roundtrip in the same file.)

  • Soundness and completeness of Kozen's axioms of Kleene algebra for the equivalence of regular expressions. KleeneDeduction.derivable e e' means that e = e' is derivable from the axioms. A derivable equation holds in any Kleene algebra under any interpretation of the characters, so derivably equal expressions denote the same language; this assumes neither a finite alphabet nor decidable character equality. (Theorem sound and Theorem regex_sound in the KleeneDeduction module of Regex.v) Conversely, for an alphabet with decidable equality and a list containing every character, expressions denoting the same language are derivably equal. (Theorem interpret_inclusion and Theorem regex_complete in the FiniteKleeneCompleteness module of Automata.v)

  • Three descriptions of the language of a context-free grammar coincide: derivations in the grammar, derivations in the augmented grammar, and rightmost derivations in the augmented grammar. (Theorem three_descriptions_of_language in CFGrammar.v)

  • The viable-prefix theorem: the LR(0) items reached by reading Îł are exactly the items valid for Îł. (Theorem goto_word_valid_prefix_iff in CFGrammar.v)

  • The LALR(1) lookaheads computed from the LR(0) automaton are exact: A → ω can be reduced in state q on lookahead t iff some rightmost derivation S' ⇒rm* α A t z has αω leading to q. (Theorem construct_can_reduce_grammar_iff in Automata.v)

2.6. Verified lexer generator and parser generator

  • Verified lexer generator. Given an alphabet that lists every character, LGS.prepare compiles a list of regular expressions to a DFA (Thompson's construction, the subset construction, Hopcroft's minimisation, and dead-state removal), and fails iff some rule matches the empty word. The scanner LGS.scan_all returns tokens iff tokens is the maximal-munch tokenisation of the input, where earlier rules win ties, and fails iff no such tokenisation exists. (Theorem build_accepts, Theorem prepare_None, Theorem scan_one_correct, Theorem scan_all_correct, and Corollary scan_all_rejects in LGS.v)

  • Verified right-context lexer generator. Module LGS2 of LGS.v accepts plain R and trailing R R', including rules whose body and right context both have variable length. Selection maximises the combined length, then prefers the earlier rule, then the longest body within that rule. Only the body becomes a lexeme; the context remains in the input. Preparation rejects nullable bodies and permits nullable contexts. Success, failure, input preservation, SN termination, compiled execution, and compatibility with plain LGS rules are proved. Computed examples are in LGS2Examples.v.

  • Verified LALR(1) parser generator. Let G be a well-formed grammar whose nonterminals are all productive. G is LALR(1), a property defined from valid prefixes and item cores, iff the generated table has no conflict. If G is LALR(1), then G is LR(1), build_prepared G succeeds, and the generated parser returns the tree τ on input x iff τ is a parse tree of x, succeeds iff x ∈ L(G), and fails iff x ∉ L(G). (Theorem grammar_LALR1_iff_conflict_free, Theorem grammar_LALR1_isLR1, and Theorem lalr1_generator_correct in AdvancedPGS.v)

  • Parser generation with yacc-style precedences. PGS.build G succeeds iff G is well-formed, its nonterminals are all productive, and the precedences settle every conflict. When it succeeds, build_prepared G succeeds iff the generated parser terminates on every input. Termination is proved as strong normalisation, without fuel. The prepared parser returns exactly the parse trees selected by the grammar's precedence rules, and fails iff no selected parse tree exists. (Theorem build_spec in PGS.v, and Theorem build_prepared_totality_iff, Theorem build_prepared_divergence_iff, Theorem build_prepared_selected_iff, and Theorem build_prepared_selected_failure_iff in AdvancedPGS.v)

  • The trees returned by the generated parser, described by the priorities alone. Whenever PGS.build_prepared G returns prepared, PGS.run prepared x returns τ iff τ is a parse tree of x without a priority violation: a position where the action required by the tree (a shift at a leaf, a reduction at an internal node) fails to outrank another grammar candidate in the same context, including a tie or an unranked conflict. build_run_priority_iff gives the same equivalence for the runner that takes a termination proof. (Theorem build_prepared_priority_iff and Corollary build_run_priority_iff in AdvancedPGS.v) In PGSPriorityExamples.v, where * binds more tightly than + in A → a | A + A | A * A, the parser returns a+(a*a) on a+a*a, and mixed_priority_offending_subtree shows that the other parse tree (a+a)*a violates the priorities. On a+a+a, a left- or right-associative + gives the left- or right-nested tree, and a non-associative + gives an UnexpectedToken error at +.

  • A reusable verified frontend API. VerifiedFrontend.v separates FrontendInput, generated FrontendArtifacts, and CompiledFrontend Input Artifacts. The artifacts contain frozen execution tables and proofs connecting them to the generators, so calling lexer, tokenize, parser, or run_string only interprets those tables. The optimized runners are proved equal to the reference runners and retain their soundness, completeness, failure, and SN termination results.

2.7. Example: a C99 frontend

C99.v supplies the 237-production C99 syntax grammar of Jutta Degener as a FrontendInput, prepares its artifacts once in C99Generated, and instantiates C99 and C99Tokens. The latter keeps a Token.t in each leaf, containing a named token kind and the exact source spelling:

Require Import PnV.System.VerifiedFrontend.
Require Import PnV.Applications.C99.
Require Import Stdlib.Lists.List.
Import ListNotations.

(* Characters -> tagged lexemes, including whitespace and comments. *)
Eval compute in C99.lexer hello_world_characters.
(* Characters -> tokens with named kinds and source spellings. *)
Eval compute in C99Tokens.tokenize hello_world_characters.
(* Source text -> a tree whose leaves contain those tokens. *)
Eval compute in C99Tokens.run_string hello_world.
(* Recover the leaf tokens in source order. *)
Eval compute in either (fun _ : C99Tokens.Core.Failure => None) (fun tau : C99Tokens.tree => Some (C99Tokens.tokens tau)) (C99Tokens.run_string hello_world).

The frontend processes ASCII C99 syntax after preprocessing; preprocessing and the contextual classification of typedef names are outside this input module.

3. Contents of theories/

  • C99.v : A verified frontend for the C99 syntax grammar of Jutta Degener.

  • C99Token.v : Names for the 87 terminals of the C99 grammar.

  • CopyExamples.v : Examples of the copy kernel: the untyped λ-calculus and capture-avoiding FOL substitution.

  • CopyPerformance.v : Scaling tests of the copy kernel, with the expected answers checked.

  • FolFrameworkExamples.v : Examples of the first-order logic framework and its axiom schemata.

  • GodelLanguageExamples.v : The incompleteness theorems for an extension of the arithmetic language by a constant, a ternary function, and a unary predicate.

  • HOPUExamples.v : Examples of higher-order pattern unification.

  • HOPUPerformance.v : Scaling families for the HOPU solver, with the returned assignments checked against the original equations.

  • HOPUSessionExamples.v : Examples of incremental HOPU sessions: refinement, merging, and identifier collisions.

  • Index.v : Accumulates all source files outside theories/Applications/ and checks their consistency.

  • LGS2Examples.v : Computed examples of the right-context lexer generator.

  • PeanoSolverExamples.v : Hilbert proofs in PA built by PASolver.

  • PeanoSolverPerformance.v : Timings of PASolver on open terms.

  • PGSPriorityExamples.v : Parse trees selected by precedences and associativity in the grammar A → a | A + A | A * A.

  • RegexExamples.v : Examples of regular-expression simplification.

  • ZfcFramework.v : ZFC in the contextual axiom-schema framework.

  • CFGrammar.v : Context-free grammars, rightmost derivations, LR(0) items, and the viable-prefix theorem.

  • Category.v : Basic theory on category.

  • DFS.v : Verified depth-first search on finite digraphs whose vertices are pairs of binary natural numbers.

  • Monad.v : Basic definitions about monad, monad iteration, and monad transformers.

  • Regex.v : Regular expressions: the pumping lemma, simplification, and Kleene-algebra deduction.

  • Traverse.v : Monadic traversal of lists.

  • Worklist.v : A worklist algorithm computing finite closures, terminating by strong normalisation.

  • Aczel.v : Aczel's type theoretic interpretation of set theory.

  • Automata.v : Δ-NFAs, DFAs, and the constructions between them and regular expressions; LR(0) and LALR(1) automata.

  • BalancedTree.v : Balanced binary trees.

  • BinaryTrie.v : Finite maps and sets keyed by binary natural numbers or by pairs of them.

  • FiniteMap.v : Finite partial maps as sorted association lists.

  • FiniteSet.v : Finite sets as sorted lists.

  • Graph.v : Basic graph theory: reachability, cycles, and labelled transition systems.

  • HsOrd.v : Haskell-style comparison functions compatible with a partial order.

  • ITree.v : Basic definitions on interaction tree.

  • NumRepr.v : Number representation.

  • SymbolDictionary.v : Dictionaries encoding symbols as binary natural numbers.

  • Vector.v : Replaces Stdlib.Vectors.VectorDef.t.

  • Arith1.v : The language of arithmetic, its standard structure, and the theory Q.

  • Arith2.v : Codes of terms and formulae, and their primitive recursive operations.

  • ArithLanguage.v : Transport of arithmetic proofs along a signature inclusion.

  • ClassicalGodel.v : Classical corollaries of the incompleteness theorems; the only file of the Gödel development that uses classical axioms.

  • Diagonal.v : The diagonal lemma, independent of the signature.

  • FolCoding.v : An interface for effective syntax, and a proof checker derived from it.

  • FolSyntaxCoding.v : Presentations numbering the symbols of a language with primitive recursive validity tests.

  • Godel1.v : Gödel's first incompleteness theorem and Tarski's theorem.

  • Godel2.v : Löb's theorem and Gödel's second incompleteness theorem.

  • GodelLanguage.v : The first and second incompleteness theorems for extensions of the arithmetic language.

  • GodelLanguageRosser.v : The Gödel–Rosser theorem for extensions of the arithmetic language.

  • GodelRosser.v : The Gödel–Rosser theorem.

  • Kleene.v : Kleene's normal form, the universal program, and the computational first incompleteness theorem.

  • Lob.v : Löb's theorem and the abstract second incompleteness theorem over an arbitrary language.

  • PeanoArith1.v : The recursive presentation PA_rec of Peano arithmetic.

  • PeanoArith2.v : Proofs in PA: substitution lemmas and the least number principle.

  • PeanoArith3.v : Order properties in PA.

  • PeanoCertificates.v : Representability in PA: division, multiples, certificates, and the beta function.

  • PeanoCoding.v : The coding of histories, lists, and nodes in PA.

  • PeanoDerivability.v : Bounded truth, formula completeness, and the derivability conditions for PA_rec.

  • PeanoLanguage.v : Peano arithmetic in an extension of the arithmetic language, and its derivability conditions.

  • PeanoNumeralEvaluation.v : Numeral evaluation and numeral order in PA.

  • PeanoNumeralProofs.v : Code generators of Hilbert proofs from Q, defined as functions on numbers.

  • PeanoPrograms.v : Programs, composition, and minimization represented in PA.

  • PeanoProofRules.v : Substitution traces and proof rules on codes.

  • PeanoQuotedFormulae.v : Term evaluation, atomic completeness, and quotation in PA.

  • PeanoRecursion.v : Sequences, traces, and primitive recursion represented in PA.

  • PeanoSchema.v : Peano arithmetic from contextual axiom schemata, and PASolver.

  • PeanoSchemaCoding.v : Numerical certificates for schema applications.

  • PeanoSubstitutionChecking.v : Substitution checking and free variables on codes.

  • PeanoSyntaxChecking.v : Proof syntax, provability, proof checking, and quotation checking on codes.

  • AdvancedFol.v : Henkin extensions of first-order languages.

  • BasicFol.v : Basic definitions of First-Order Logic.

  • BasicFol2.v : Extra definitions of First-Order Logic: languages augmented with Henkin constants.

  • ClassicalAdvancedFol.v : Completeness and compactness for languages of arbitrary cardinality, the Löwenheim-Skolem theorems, and Stone spaces of types.

  • ClassicalFol.v : The meta-theory on Classical First-Order Logic--such as Soundness Theorem and Completeness Theorem.

  • ClassicalPropositionalLogic.v : The Soundness, Completeness, and Compactness Theorem for PropositionalLogic.

  • ExtraFol.v : First-order theories and structures, and isomorphism invariance.

  • FolEmbedding.v : Language inclusions, preserving the sorts and arities of symbols.

  • HilbertFol.v : Basic facts about Hilbert calculus for First-Order Logic.

  • HilbertFol2.v : Advanced facts about Hilbert calculus for First-Order Logic.

  • MuRec.v : Basic facts about ÎŒ-recursive functions.

  • PrimRec.v : Basic facts about primitive recursive functions.

  • PropositionalLogic.v : Constructive meta-theory on the Propositional Logic, Weak Completeness Theorem for PropositionalLogic.

  • BooleanAlgebra.v : Basic theory on Boolean algebras.

  • ClassicalCardinal.v : Classical cardinal arithmetic.

  • ClassicalDomainTheory.v : Classical domain theory.

  • ClassicalSetTheory.v : Classical set theory.

  • ClassicalTopology.v : Classical topology: closed and clopen sets, and bases.

  • DomainTheory.v : Constructive domain theory.

  • OrderTheory.v : Basic order theory.

  • SetTheory.v : Constructive set theory.

  • ThN.v : Basic facts about the natural numbers.

  • ClassicalFacts.v : Facts about CIC + (classic : forall P, P \/ ~ P), and the class ClassicalAxioms of choice and extensionality axioms.

  • ConstructiveFacts.v : Facts about CIC.

  • Notations.v : Reserves all notations to avoid the conflict.

  • PnVTacs.v : Tactics of the library.

  • Prelude.v : The prelude.

  • Quotient.v : Quotient types, postulated by the axiom Quotient_always_exists.

  • SfLib.v : A copy of snu-sf/sflib.v.

  • X.v : List utilities, reflexive transitive closures, and strong normalisation.

  • AdvancedPGS.v : The correctness of the LALR(1) parser generator and of precedence selection.

  • BasicITreeTh.v : A basic theory on interaction trees.

  • Copy.v : The copy relation on named terms: the specification of capture-avoiding substitution.

  • CopySolver.v : The copy kernel: a solver for copy goals on HOPU sessions.

  • FolExternal.v : An external first-order vocabulary, independent of the internal formula representation.

  • FolFramework.v : A First-Order Logic Framework with contextual axiom schemata.

  • HOPU.v : Higher-order pattern unification: problems, solutions, and the kernel.

  • HOPUInvariants.v : Invariants of the HOPU kernel states.

  • HOPUSolver.v : Results about the HOPU solver, and incremental sessions.

  • Lambda1.v : Basic definitions for Church-style stlc.

  • Lang.v : Some formal languages.

  • LGS.v : A verified lexer generator.

  • P.v : Names: printing and parsing by base 36.

  • PGS.v : A verified parser generator.

  • Scan.v : Iterating a scanner over the input, terminating by strong normalisation.

  • STLC.v : Basic theorems for Church-style stlc.

  • TokenTree.v : Parse trees whose leaves carry a token kind and its source spelling.

  • VerifiedFrontend.v : A reusable verified frontend API.

4. References

Source Code

  1. sflib
  2. stdpp
  3. DmxLarchey/Murec_Extraction
  4. CoqGym/goedel
  5. ernius/formalmetatheory-stoughton
  6. uds-psl/Constructive Analysis of First-Order Completeness
  7. snu-sf/Ordinal
  8. Damhiya/Logos
  9. Lean Zulip Chat (1)
  10. DeepSpec/Interaction Trees
  11. Jutta Degener's ANSI C grammar (C99)

Literature

  1. A note written by Jayadev Misra
  2. Constructive Completeness Proofs and Delimited Control
  3. A Mathematical Introduction to Logic
  4. The Lambda Calculus: Its Syntax and Semantics
  5. The Power of Parameterization in Coinductive Proof
  6. Andrei Popescu and Dmitriy Traytel, A Formally Verified Abstract Account of Gödel's Incompleteness Theorems (CADE 2019)
  7. Dale Miller and Gopalan Nadathur, Programming with Higher-Order Logic (Cambridge University Press, 2012)
  8. Dexter Kozen, A Completeness Theorem for Kleene Algebras and the Algebra of Regular Events (Information and Computation, 1994)

5. Thanks to

6. License

PnVRocqLib is distributed under the BSD 2-Clause License; see LICENSE. The exceptions are the following parts, which are distributed under the licenses of the works they are adapted from; the header of each file says which parts these are.

The following files contain code adapted from other projects, and their headers carry the notices of those projects:

BasicFol.v and STLC.v follow the developments of formalmetatheory-stoughton and Logos, respectively, and credit them in their headers.

About

📝 A Rocq library written by members of PnV Discord Server

Topics

Resources

Stars

19 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages