Archive of Formal Proofs https://www.isa-afp.org The Archive of Formal Proofs is a collection of proof libraries, examples, and larger scientific developments, mechanically checked in the theorem prover Isabelle. 08 Oct 2019 00:00:00 +0000 Aristotle's Assertoric Syllogistic https://www.isa-afp.org/entries/Aristotles_Assertoric_Syllogistic.html https://www.isa-afp.org/entries/Aristotles_Assertoric_Syllogistic.html Angeliki Koutsoukou-Argyraki 08 Oct 2019 00:00:00 +0000 We formalise with Isabelle/HOL some basic elements of Aristotle's assertoric syllogistic following the <a href="https://plato.stanford.edu/entries/aristotle-logic/">article from the Stanford Encyclopedia of Philosophy by Robin Smith.</a> To this end, we use a set theoretic formulation (covering both individual and general predication). In particular, we formalise the deductions in the Figures and after that we present Aristotle's metatheoretical observation that all deductions in the Figures can in fact be reduced to either Barbara or Celarent. As the formal proofs prove to be straightforward, the interest of this entry lies in illustrating the functionality of Isabelle and high efficiency of Sledgehammer for simple exercises in philosophy. Sigma Protocols and Commitment Schemes https://www.isa-afp.org/entries/Sigma_Commit_Crypto.html https://www.isa-afp.org/entries/Sigma_Commit_Crypto.html David Butler, Andreas Lochbihler 07 Oct 2019 00:00:00 +0000 We use CryptHOL to formalise commitment schemes and Sigma-protocols. Both are widely used fundamental two party cryptographic primitives. Security for commitment schemes is considered using game-based definitions whereas the security of Sigma-protocols is considered using both the game-based and simulation-based security paradigms. In this work, we first define security for both primitives and then prove secure multiple case studies: the Schnorr, Chaum-Pedersen and Okamoto Sigma-protocols as well as a construction that allows for compound (AND and OR statements) Sigma-protocols and the Pedersen and Rivest commitment schemes. We also prove that commitment schemes can be constructed from Sigma-protocols. We formalise this proof at an abstract level, only assuming the existence of a Sigma-protocol; consequently, the instantiations of this result for the concrete Sigma-protocols we consider come for free. Clean - An Abstract Imperative Programming Language and its Theory https://www.isa-afp.org/entries/Clean.html https://www.isa-afp.org/entries/Clean.html Frédéric Tuong, Burkhart Wolff 04 Oct 2019 00:00:00 +0000 Clean is based on a simple, abstract execution model for an imperative target language. “Abstract” is understood in contrast to “Concrete Semantics”; alternatively, the term “shallow-style embedding” could be used. It strives for a type-safe notion of program-variables, an incremental construction of the typed state-space, support of incremental verification, and open-world extensibility of new type definitions being intertwined with the program definitions. Clean is based on a “no-frills” state-exception monad with the usual definitions of bind and unit for the compositional glue of state-based computations. Clean offers conditionals and loops supporting C-like control-flow operators such as break and return. The state-space construction is based on the extensible record package. Direct recursion of procedures is supported. Clean’s design strives for extreme simplicity. It is geared towards symbolic execution and proven correct verification tools. The underlying libraries of this package, however, deliberately restrict themselves to the most elementary infrastructure for these tasks. The package is intended to serve as demonstrator semantic backend for Isabelle/C, or for the test-generation techniques. Formalization of Multiway-Join Algorithms https://www.isa-afp.org/entries/Generic_Join.html https://www.isa-afp.org/entries/Generic_Join.html Thibault Dardinier 16 Sep 2019 00:00:00 +0000 Worst-case optimal multiway-join algorithms are recent seminal achievement of the database community. These algorithms compute the natural join of multiple relational databases and improve in the worst case over traditional query plan optimizations of nested binary joins. In 2014, <a href="https://doi.org/10.1145/2590989.2590991">Ngo, Ré, and Rudra</a> gave a unified presentation of different multi-way join algorithms. We formalized and proved correct their "Generic Join" algorithm and extended it to support negative joins. Verification Components for Hybrid Systems https://www.isa-afp.org/entries/Hybrid_Systems_VCs.html https://www.isa-afp.org/entries/Hybrid_Systems_VCs.html Jonathan Julian Huerta y Munive 10 Sep 2019 00:00:00 +0000 These components formalise a semantic framework for the deductive verification of hybrid systems. They support reasoning about continuous evolutions of hybrid programs in the style of differential dynamics logic. Vector fields or flows model these evolutions, and their verification is done with invariants for the former or orbits for the latter. Laws of modal Kleene algebra or categorical predicate transformers implement the verification condition generation. Examples show the approach at work. Fourier Series https://www.isa-afp.org/entries/Fourier.html https://www.isa-afp.org/entries/Fourier.html Lawrence C Paulson 06 Sep 2019 00:00:00 +0000 This development formalises the square integrable functions over the reals and the basics of Fourier series. It culminates with a proof that every well-behaved periodic function can be approximated by a Fourier series. The material is ported from HOL Light: https://github.com/jrh13/hol-light/blob/master/100/fourier.ml A Case Study in Basic Algebra https://www.isa-afp.org/entries/Jacobson_Basic_Algebra.html https://www.isa-afp.org/entries/Jacobson_Basic_Algebra.html Clemens Ballarin 30 Aug 2019 00:00:00 +0000 The focus of this case study is re-use in abstract algebra. It contains locale-based formalisations of selected parts of set, group and ring theory from Jacobson's <i>Basic Algebra</i> leading to the respective fundamental homomorphism theorems. The study is not intended as a library base for abstract algebra. It rather explores an approach towards abstract algebra in Isabelle. Formalisation of an Adaptive State Counting Algorithm https://www.isa-afp.org/entries/Adaptive_State_Counting.html https://www.isa-afp.org/entries/Adaptive_State_Counting.html Robert Sachtleben 16 Aug 2019 00:00:00 +0000 This entry provides a formalisation of a refinement of an adaptive state counting algorithm, used to test for reduction between finite state machines. The algorithm has been originally presented by Hierons in the paper <a href="https://doi.org/10.1109/TC.2004.85">Testing from a Non-Deterministic Finite State Machine Using Adaptive State Counting</a>. Definitions for finite state machines and adaptive test cases are given and many useful theorems are derived from these. The algorithm is formalised using mutually recursive functions, for which it is proven that the generated test suite is sufficient to test for reduction against finite state machines of a certain fault domain. Additionally, the algorithm is specified in a simple WHILE-language and its correctness is shown using Hoare-logic. Laplace Transform https://www.isa-afp.org/entries/Laplace_Transform.html https://www.isa-afp.org/entries/Laplace_Transform.html Fabian Immler 14 Aug 2019 00:00:00 +0000 This entry formalizes the Laplace transform and concrete Laplace transforms for arithmetic functions, frequency shift, integration and (higher) differentiation in the time domain. It proves Lerch's lemma and uniqueness of the Laplace transform for continuous functions. In order to formalize the foundational assumptions, this entry contains a formalization of piecewise continuous functions and functions of exponential order. Linear Programming https://www.isa-afp.org/entries/Linear_Programming.html https://www.isa-afp.org/entries/Linear_Programming.html Julian Parsert, Cezary Kaliszyk 06 Aug 2019 00:00:00 +0000 We use the previous formalization of the general simplex algorithm to formulate an algorithm for solving linear programs. We encode the linear programs using only linear constraints. Solving these constraints also solves the original linear program. This algorithm is proven to be sound by applying the weak duality theorem which is also part of this formalization. Communicating Concurrent Kleene Algebra for Distributed Systems Specification https://www.isa-afp.org/entries/C2KA_DistributedSystems.html https://www.isa-afp.org/entries/C2KA_DistributedSystems.html Maxime Buyse, Jason Jaskolka 06 Aug 2019 00:00:00 +0000 Communicating Concurrent Kleene Algebra (C²KA) is a mathematical framework for capturing the communicating and concurrent behaviour of agents in distributed systems. It extends Hoare et al.'s Concurrent Kleene Algebra (CKA) with communication actions through the notions of stimuli and shared environments. C²KA has applications in studying system-level properties of distributed systems such as safety, security, and reliability. In this work, we formalize results about C²KA and its application for distributed systems specification. We first formalize the stimulus structure and behaviour structure (CKA). Next, we combine them to formalize C²KA and its properties. Then, we formalize notions and properties related to the topology of distributed systems and the potential for communication via stimuli and via shared environments of agents, all within the algebraic setting of C²KA. Selected Problems from the International Mathematical Olympiad 2019 https://www.isa-afp.org/entries/IMO2019.html https://www.isa-afp.org/entries/IMO2019.html Manuel Eberl 05 Aug 2019 00:00:00 +0000 <p>This entry contains formalisations of the answers to three of the six problem of the International Mathematical Olympiad 2019, namely Q1, Q4, and Q5.</p> <p>The reason why these problems were chosen is that they are particularly amenable to formalisation: they can be solved with minimal use of libraries. The remaining three concern geometry and graph theory, which, in the author's opinion, are more difficult to formalise resp. require a more complex library.</p> Stellar Quorum Systems https://www.isa-afp.org/entries/Stellar_Quorums.html https://www.isa-afp.org/entries/Stellar_Quorums.html Giuliano Losa 01 Aug 2019 00:00:00 +0000 We formalize the static properties of personal Byzantine quorum systems (PBQSs) and Stellar quorum systems, as described in the paper ``Stellar Consensus by Reduction'' (to appear at DISC 2019). A Formal Development of a Polychronous Polytimed Coordination Language https://www.isa-afp.org/entries/TESL_Language.html https://www.isa-afp.org/entries/TESL_Language.html Hai Nguyen Van, Frédéric Boulanger, Burkhart Wolff 30 Jul 2019 00:00:00 +0000 The design of complex systems involves different formalisms for modeling their different parts or aspects. The global model of a system may therefore consist of a coordination of concurrent sub-models that use different paradigms. We develop here a theory for a language used to specify the timed coordination of such heterogeneous subsystems by addressing the following issues: <ul><li>the behavior of the sub-systems is observed only at a series of discrete instants,</li><li>events may occur in different sub-systems at unrelated times, leading to polychronous systems, which do not necessarily have a common base clock,</li><li>coordination between subsystems involves causality, so the occurrence of an event may enforce the occurrence of other events, possibly after a certain duration has elapsed or an event has occurred a given number of times,</li><li>the domain of time (discrete, rational, continuous...) may be different in the subsystems, leading to polytimed systems,</li><li>the time frames of different sub-systems may be related (for instance, time in a GPS satellite and in a GPS receiver on Earth are related although they are not the same).</li></ul> Firstly, a denotational semantics of the language is defined. Then, in order to be able to incrementally check the behavior of systems, an operational semantics is given, with proofs of progress, soundness and completeness with regard to the denotational semantics. These proofs are made according to a setup that can scale up when new operators are added to the language. In order for specifications to be composed in a clean way, the language should be invariant by stuttering (i.e., adding observation instants at which nothing happens). The proof of this invariance is also given. Szpilrajn Extension Theorem https://www.isa-afp.org/entries/Szpilrajn.html https://www.isa-afp.org/entries/Szpilrajn.html Peter Zeller 27 Jul 2019 00:00:00 +0000 We formalize the Szpilrajn extension theorem, also known as order-extension principal: Every strict partial order can be extended to a strict linear order. A Sequent Calculus for First-Order Logic https://www.isa-afp.org/entries/FOL_Seq_Calc1.html https://www.isa-afp.org/entries/FOL_Seq_Calc1.html Andreas Halkjær From 18 Jul 2019 00:00:00 +0000 This work formalizes soundness and completeness of a one-sided sequent calculus for first-order logic. The completeness is shown via a translation from a complete semantic tableau calculus, the proof of which is based on the First-Order Logic According to Fitting theory. The calculi and proof techniques are taken from Ben-Ari's Mathematical Logic for Computer Science. A Verified Code Generator from Isabelle/HOL to CakeML https://www.isa-afp.org/entries/CakeML_Codegen.html https://www.isa-afp.org/entries/CakeML_Codegen.html Lars Hupel 08 Jul 2019 00:00:00 +0000 This entry contains the formalization that accompanies my PhD thesis (see https://lars.hupel.info/research/codegen/). I develop a verified compilation toolchain from executable specifications in Isabelle/HOL to CakeML abstract syntax trees. This improves over the state-of-the-art in Isabelle by providing a trustworthy procedure for code generation. Formalization of a Monitoring Algorithm for Metric First-Order Temporal Logic https://www.isa-afp.org/entries/MFOTL_Monitor.html https://www.isa-afp.org/entries/MFOTL_Monitor.html Joshua Schneider, Dmitriy Traytel 04 Jul 2019 00:00:00 +0000 A monitor is a runtime verification tool that solves the following problem: Given a stream of time-stamped events and a policy formulated in a specification language, decide whether the policy is satisfied at every point in the stream. We verify the correctness of an executable monitor for specifications given as formulas in metric first-order temporal logic (MFOTL), an expressive extension of linear temporal logic with real-time constraints and first-order quantification. The verified monitor implements a simplified variant of the algorithm used in the efficient MonPoly monitoring tool. The formalization is presented in a forthcoming <a href="http://people.inf.ethz.ch/trayteld/papers/rv19-verimon/verimon.pdf">RV 2019 paper</a>, which also compares the output of the verified monitor to that of other monitoring tools on randomly generated inputs. This case study revealed several errors in the optimized but unverified tools. Complete Non-Orders and Fixed Points https://www.isa-afp.org/entries/Complete_Non_Orders.html https://www.isa-afp.org/entries/Complete_Non_Orders.html Akihisa Yamada, Jérémy Dubut 27 Jun 2019 00:00:00 +0000 We develop an Isabelle/HOL library of order-theoretic concepts, such as various completeness conditions and fixed-point theorems. We keep our formalization as general as possible: we reprove several well-known results about complete orders, often without any properties of ordering, thus complete non-orders. In particular, we generalize the Knaster–Tarski theorem so that we ensure the existence of a quasi-fixed point of monotone maps over complete non-orders, and show that the set of quasi-fixed points is complete under a mild condition—attractivity—which is implied by either antisymmetry or transitivity. This result generalizes and strengthens a result by Stauti and Maaden. Finally, we recover Kleene’s fixed-point theorem for omega-complete non-orders, again using attractivity to prove that Kleene’s fixed points are least quasi-fixed points. Priority Search Trees https://www.isa-afp.org/entries/Priority_Search_Trees.html https://www.isa-afp.org/entries/Priority_Search_Trees.html Peter Lammich, Tobias Nipkow 25 Jun 2019 00:00:00 +0000 We present a new, purely functional, simple and efficient data structure combining a search tree and a priority queue, which we call a <em>priority search tree</em>. The salient feature of priority search trees is that they offer a decrease-key operation, something that is missing from other simple, purely functional priority queue implementations. Priority search trees can be implemented on top of any search tree. This entry does the implementation for red-black trees. This entry formalizes the first part of our ITP-2019 proof pearl <em>Purely Functional, Simple and Efficient Priority Search Trees and Applications to Prim and Dijkstra</em>. Purely Functional, Simple, and Efficient Implementation of Prim and Dijkstra https://www.isa-afp.org/entries/Prim_Dijkstra_Simple.html https://www.isa-afp.org/entries/Prim_Dijkstra_Simple.html Peter Lammich, Tobias Nipkow 25 Jun 2019 00:00:00 +0000 We verify purely functional, simple and efficient implementations of Prim's and Dijkstra's algorithms. This constitutes the first verification of an executable and even efficient version of Prim's algorithm. This entry formalizes the second part of our ITP-2019 proof pearl <em>Purely Functional, Simple and Efficient Priority Search Trees and Applications to Prim and Dijkstra</em>. Linear Inequalities https://www.isa-afp.org/entries/Linear_Inequalities.html https://www.isa-afp.org/entries/Linear_Inequalities.html Ralph Bottesch, Alban Reynaud, René Thiemann 21 Jun 2019 00:00:00 +0000 We formalize results about linear inqualities, mainly from Schrijver's book. The main results are the proof of the fundamental theorem on linear inequalities, Farkas' lemma, Carathéodory's theorem, the Farkas-Minkowsky-Weyl theorem, the decomposition theorem of polyhedra, and Meyer's result that the integer hull of a polyhedron is a polyhedron itself. Several theorems include bounds on the appearing numbers, and in particular we provide an a-priori bound on mixed-integer solutions of linear inequalities. Hilbert's Nullstellensatz https://www.isa-afp.org/entries/Nullstellensatz.html https://www.isa-afp.org/entries/Nullstellensatz.html Alexander Maletzky 16 Jun 2019 00:00:00 +0000 This entry formalizes Hilbert's Nullstellensatz, an important theorem in algebraic geometry that can be viewed as the generalization of the Fundamental Theorem of Algebra to multivariate polynomials: If a set of (multivariate) polynomials over an algebraically closed field has no common zero, then the ideal it generates is the entire polynomial ring. The formalization proves several equivalent versions of this celebrated theorem: the weak Nullstellensatz, the strong Nullstellensatz (connecting algebraic varieties and radical ideals), and the field-theoretic Nullstellensatz. The formalization follows Chapter 4.1. of <a href="https://link.springer.com/book/10.1007/978-0-387-35651-8">Ideals, Varieties, and Algorithms</a> by Cox, Little and O'Shea. Gröbner Bases, Macaulay Matrices and Dubé's Degree Bounds https://www.isa-afp.org/entries/Groebner_Macaulay.html https://www.isa-afp.org/entries/Groebner_Macaulay.html Alexander Maletzky 15 Jun 2019 00:00:00 +0000 This entry formalizes the connection between Gröbner bases and Macaulay matrices (sometimes also referred to as `generalized Sylvester matrices'). In particular, it contains a method for computing Gröbner bases, which proceeds by first constructing some Macaulay matrix of the initial set of polynomials, then row-reducing this matrix, and finally converting the result back into a set of polynomials. The output is shown to be a Gröbner basis if the Macaulay matrix constructed in the first step is sufficiently large. In order to obtain concrete upper bounds on the size of the matrix (and hence turn the method into an effectively executable algorithm), Dubé's degree bounds on Gröbner bases are utilized; consequently, they are also part of the formalization. Binary Heaps for IMP2 https://www.isa-afp.org/entries/IMP2_Binary_Heap.html https://www.isa-afp.org/entries/IMP2_Binary_Heap.html Simon Griebel 13 Jun 2019 00:00:00 +0000 In this submission array-based binary minimum heaps are formalized. The correctness of the following heap operations is proved: insert, get-min, delete-min and make-heap. These are then used to verify an in-place heapsort. The formalization is based on IMP2, an imperative program verification framework implemented in Isabelle/HOL. The verified heap functions are iterative versions of the partly recursive functions found in "Algorithms and Data Structures – The Basic Toolbox" by K. Mehlhorn and P. Sanders and "Introduction to Algorithms" by T. H. Cormen, C. E. Leiserson, R. L. Rivest and C. Stein. Differential Game Logic https://www.isa-afp.org/entries/Differential_Game_Logic.html https://www.isa-afp.org/entries/Differential_Game_Logic.html André Platzer 03 Jun 2019 00:00:00 +0000 This formalization provides differential game logic (dGL), a logic for proving properties of hybrid game. In addition to the syntax and semantics, it formalizes a uniform substitution calculus for dGL. Church's uniform substitutions substitute a term or formula for a function or predicate symbol everywhere. The uniform substitutions for dGL also substitute hybrid games for a game symbol everywhere. We prove soundness of one-pass uniform substitutions and the axioms of differential game logic with respect to their denotational semantics. One-pass uniform substitutions are faster by postponing soundness-critical admissibility checks with a linear pass homomorphic application and regain soundness by a variable condition at the replacements. The formalization is based on prior non-mechanized soundness proofs for dGL. Multidimensional Binary Search Trees https://www.isa-afp.org/entries/KD_Tree.html https://www.isa-afp.org/entries/KD_Tree.html Martin Rau 30 May 2019 00:00:00 +0000 This entry provides a formalization of multidimensional binary trees, also known as k-d trees. It includes a balanced build algorithm as well as the nearest neighbor algorithm and the range search algorithm. It is based on the papers <a href="https://dl.acm.org/citation.cfm?doid=361002.361007">Multidimensional binary search trees used for associative searching</a> and <a href="https://dl.acm.org/citation.cfm?doid=355744.355745"> An Algorithm for Finding Best Matches in Logarithmic Expected Time</a>. Formalization of Generic Authenticated Data Structures https://www.isa-afp.org/entries/LambdaAuth.html https://www.isa-afp.org/entries/LambdaAuth.html Matthias Brun, Dmitriy Traytel 14 May 2019 00:00:00 +0000 Authenticated data structures are a technique for outsourcing data storage and maintenance to an untrusted server. The server is required to produce an efficiently checkable and cryptographically secure proof that it carried out precisely the requested computation. <a href="https://doi.org/10.1145/2535838.2535851">Miller et al.</a> introduced &lambda;&bull; (pronounced <i>lambda auth</i>)&mdash;a functional programming language with a built-in primitive authentication construct, which supports a wide range of user-specified authenticated data structures while guaranteeing certain correctness and security properties for all well-typed programs. We formalize &lambda;&bull; and prove its correctness and security properties. With Isabelle's help, we uncover and repair several mistakes in the informal proofs and lemma statements. Our findings are summarized in a <a href="http://people.inf.ethz.ch/trayteld/papers/lambdaauth/lambdaauth.pdf">paper draft</a>. Multi-Party Computation https://www.isa-afp.org/entries/Multi_Party_Computation.html https://www.isa-afp.org/entries/Multi_Party_Computation.html David Aspinall, David Butler 09 May 2019 00:00:00 +0000 We use CryptHOL to consider Multi-Party Computation (MPC) protocols. MPC was first considered by Yao in 1983 and recent advances in efficiency and an increased demand mean it is now deployed in the real world. Security is considered using the real/ideal world paradigm. We first define security in the semi-honest security setting where parties are assumed not to deviate from the protocol transcript. In this setting we prove multiple Oblivious Transfer (OT) protocols secure and then show security for the gates of the GMW protocol. We then define malicious security, this is a stronger notion of security where parties are assumed to be fully corrupted by an adversary. In this setting we again consider OT, as it is a fundamental building block of almost all MPC protocols. HOL-CSP Version 2.0 https://www.isa-afp.org/entries/HOL-CSP.html https://www.isa-afp.org/entries/HOL-CSP.html Safouan Taha, Lina Ye, Burkhart Wolff 26 Apr 2019 00:00:00 +0000 This is a complete formalization of the work of Hoare and Roscoe on the denotational semantics of the Failure/Divergence Model of CSP. It follows essentially the presentation of CSP in Roscoe’s Book ”Theory and Practice of Concurrency” [8] and the semantic details in a joint Paper of Roscoe and Brooks ”An improved failures model for communicating processes". The present work is based on a prior formalization attempt, called HOL-CSP 1.0, done in 1997 by H. Tej and B. Wolff with the Isabelle proof technology available at that time. This work revealed minor, but omnipresent foundational errors in key concepts like the process invariant. The present version HOL-CSP profits from substantially improved libraries (notably HOLCF), improved automated proof techniques, and structured proof techniques in Isar and is substantially shorter but more complete.