We depend on the following external libraries:
"coq" { = "8.18.0" }
"coq-core" { = "8.18.0" }
"coq-elpi" { = "2.0.0" }
"dune" {>= "3.2" & <= "3.13.0"}
"dune-configurator" { = "3.12.1" }
"coq-hierarchy-builder" { = "1.7.0" }
"coq-mathcomp-ssreflect" { = "2.2.0" }
"coq-mathcomp-algebra" { = "2.2.0" }
"coq-mathcomp-fingroup" { = "2.2.0" }
"coq-mathcomp-analysis" { = "1.3.1" }
"coq-mathcomp-real-closed" { = "2.0.0" }
"coq-mathcomp-finmap" { = "2.1.0" }
The easiest way to install the above libraries is via OPAM:
opam switch create \
--yes \
--deps-only \
--repositories=default=https://opam.ocaml.org,coq-released=https://coq.inria.fr/opam/released \
.Then, you can compile the development by just typing make (or opam config exec -- make if you used a local opam switch to install the
dependencies).
Remark: if any unexpected error occurs, please follow the exact version of the
above libraries. It's known that dune-configurator >= 3.13.0 will kill the
compilation (incompatible with coq.8.18.0 if use -(notation) attribute
for importing files).
Our development is made assuming the informative excluded middle and functional extensionality. The axioms are not explicitly stated in our development but inherited from mathcomp analysis.
Our development is based on the CoqQ project [Zhou et al. 2023], including adjusting and extending the existing theory in the original document, as well as formalizing the theory of this work in the 'src/example/refinement' folder.
Part of our development has been merged into the CoqQ project, see CoqQ github.
Light-weight tactic for mathcomp nat based on standard Lia/Nia: dealing with ordinal numbers, divn, modn, half/uphalf and bump. It served as the automated checking for the disjointness of quantum registers (of array variables with indexes).
Module for orthomodular lattice (inherited from CoqQ); establish foundational theories of orthomodular lattices following from [Beran 1985; Gabriëls et al . 2017], prove extensive properties and tactics for determining the equivalence and order relations of free bivariate formulas [Beran 1985].
Extra of hspace.v, formalizing infinite caps and cups of Hilbert subspaces and related theories.
Formalization of quantum registers. define
Formalization of quantum memory model: mapping each quantum variable/register to a tensor Hilbert system (as its semantics). It is consistent with the merging and splitting of quantum registers. A default memory model is established. Related theories that facilitate the use of Dirac notation are re-proved.
Formalize the syntax and semantics of our programming languages (Section 3) as well as the properties of the weakest liberal precondition and strongest postcondition (Section 4).
Formalize the refinement rules and their soundness and completeness (Section 5).
Extra of mathcomp and mathcomp-real-closed
Extra of mathcomp-analysis
Extra of mathcomp/algebra/vector.v
Collecting common notations of CoqQ
Predicate for matrix and their hierarchy theory; modules for vector norm, vector order; Define Lowner order of matrices.
Singular value decomposition; Courant-Fischer theorem for svd decomposition;
prove basic inequality of singular values:
Define
Instantiate extnum.v to complex number.
Simple implementation of convex hull with proof of basic properties.
Theory of majorization, including Hall's perfect-matching theorem, Konig Frobenius theorem, Birkhoff's theorem, etc. Prove basic inequalies of singular values.
define matrix norm includes lpnorm (entry-wise lp-norm), ipqnorm (induced p,q-norm), schattern norm (lp-norm over singular values); prove basic properties such as hoelder's inequality, cauchy's inequality. Instance of norms: i2norm (induced 2-norm), trnorm (trace/nuclear norm/schatten 1 norm), fbnorm (Frobenius norm/schatten 2 norm). Show density matrices form a cpo w.r.t. Lowner order.
Bounded and Summable functions (discrete function maps to normed topological space over real or complex number).
Module for complete partial order.
Hilbert subspace theory based on projection representation; i.e., the theory of projection lattice.
Define the Hermitian space and its instance chsType -- hermitian type with a orthonormal canonical basis. Define and prove correct the Gram–Schmidt process that allows the orthonormalization a set of vectors w.r.t. an inner product. Define outer product and basic operators such as adjoint, transpose, conjugate of linear functions.
Define most of the basic concept of quantum mechanics based on linear function representation (lfun). Concepts includes: normal/hermitian/positive-semidefinite/density/observable/projection/bounded/isometry/unitary linear operators, super-operators and its norms and topology, (partial) orthonormal basis, normalized state, trace-nonincreasing / trace-preserving (quantum measurement) maps, completely-positive super-operators (CP, via choi matrix theory), quantum operation (QO), quantum channel (QC), unital channel (QU). Basic constructs of super-operator (initialization, unitary transformation, if and while, dual super-operator) and their canonical structure to CP/QO/QC/QU.
Define inhabited finite type (ihbFinType), Hilbert space associated to a ihbFinType, tensor product of state/operator in/on associated Hilbert space (for pair, tuple, finite function and dependent finite function)
Utility of quantum data type; includes common 1/2-qubit gates, multiplexer, quantum Fourier bases/transformation, (phase) oracle (i.e., quantum access to a classical function) etc.
Variant of dependent finite function.
Define the tensor product over a family of Hermitian space based on their bases. define multi-linear maps. Prove that the tensor produce of Hermitian/chsType is still a Hermitian/chsType with inner product consistent with each components.
For a given
Labelled Dirac notation, defined as a non-dependent type and have linear algebraic structure. Using canonical structures to trace the domain and codomain of a labelled Dirac notation.
A prove-by-reflection tactic for efficient automated reasoning about set theory goals based on the tableau decision procedure in [Anisimov 2015].
Implementation of commutator and its related theories, including Jacobi's identity, Parallelogram inequality, Heisenberg uncertainty, Maccone-Pati uncertainty, CHSH inequality and its violation.
Formalization of generalized series for R[i] and chsf. Currently, only the natural exponential function has been implemented, as well as its convergence and several properties.
Fixing canonical problem (unexpected coercion from
Make it compatible with mathcomp-analysis/forms.v.