Search arXiv⌕ Search

arXiv · 2611.40581

Normal Forms and Complete Relations for Circuits in Agda

Abstract

A set of equations between circuits is complete if it derives every true equation. Normal-form proofs of completeness must show how to reduce a normal form after adjoining one more gate. Recent proofs have appendices hundreds of pages long, produced and checked by hand. We present an Agda library that mechanizes monoid and group presentations by generators and relations, normal forms, and completeness of finite relation sets for wire-indexed circuits. The library represents presented monoids as inductively generated congruences on free monoids of words and normal forms as standard-library function bundles (injections, right inverses, bijections) out of the word setoid. A single generic lemma derives completeness from soundness and a unique normal form witness. A constructive, monoid-level Reidemeister--Schreier method builds normal forms: a tower of verified coset tables adds one digit per level, as in a mixed-radix number system. We give presentation theorems for direct, semidirect, and amalgamated free products and group extensions, with corresponding semantic constructions intended for the Agda standard library. Verified examples include symmetric groups as circuits (sound and complete for both endofunction and permutation semantics), cyclic groups, wreath products $\mathbb{Z}_N \wr S_n$ (signed permutations at $N=2$), and Pauli groups modulo phases in all prime dimensions. We also verify alternating normal forms for the single-qubit and single-qutrit Clifford+$T$ monoids and for $U_3(\mathbb{Z}[\tfrac12,i])$ as amalgamated free products. A single index module collects the main results. The development is safe, axiom-free Agda. We compare formalizations of group presentations, normal forms, and quantum circuits in Agda, Lean, Rocq, and Isabelle.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Xiaoning Bian, Yuan Feng. 2026-11-30. Normal Forms and Complete Relations for Circuits in Agda. https://doi.org/10.1145/3871791. https://searcharxiv.org/abs/2611.40581

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

Directed Proof-Relevant Logical Relations in Simplicial HoTT

Some intrinsically typed presentations of type theory use equality types in the meta-language to represent object-language judgmental equality. In such equational syntax, one can define logical relations by assigning proof-relevant computability predicates to judgmental equivalence classes of types and terms. This approach, however, accounts for judgmental equality but not for reduction, which plays a central role in many logical-relations arguments. This paper develops a directed version of proof-relevant logical relations in simplicial homotopy type theory, a directed type theory with an \emph{inequality} type. In simplicial type theory, we use inequality types to internalize object-language reductions and construct object syntax as a directed quotient inductive type. The central observation is that contravariant families in simplicial type theory provide exactly the proof-relevant form of closure under expansion for logical relations: computability evidence can be transported backward along reductions, with the required functoriality and universal property built in. Using this observation, we construct a unary logical relations model with contravariant computability predicates and prove directed Boolean canonicity: every closed Boolean term reduces to either true or false. We then generalize the construction to dependent type formers and universes, where a comonadic flat modality provides the discreteness needed for type conversion and universe predicates. Finally, we extend the method to binary logical relations, separating vertical reduction from horizontal parametricity and obtaining a proof-relevant account of representation independence.

cs.LO↗

LinCbO for data with grades: computing the Duquenne-Guigues basis of a fuzzy formal context

We adapt LinCbO, our fast algorithm for computing the Duquenne-Guigues basis of a formal context, to contexts with graded attributes over a finite residuated lattice with globalization. Graded attribute sets are represented by crisp sets of attribute-degree pairs, so the tree traversal and the canonicity test of CbO carry over unchanged, while the closures are computed by an extended version of Belohlavek & Vychodil's graded LinClosure. We prove the correctness of the algorithm, including the behavior of the incrementally built theory on the rejected candidates. We observe that the strict-subsethood bookkeeping of graded LinClosure is unnecessary in the lectic enumeration of the basis, and that the approach does not require a linearly ordered scale: buckets indexed by the degrees replace the sorted lists without increasing the complexity bound of the linear case. The LCM-like pruning of LinCbO transfers as well. On real datasets scaled ordinally into grades, the algorithm is faster than the graded NextClosure with graded LinClosure and an early stop by a median factor of 9.8 (3 to 25 on runs of at least 100 ms). A controlled ablation shows that the reuse of the counters is decisive: without it, our CbO traversal is slower than the baseline. We show that the graded basis is the ordinary basis of the thresholded binary table relative to background implications, so that the ordinary LinCbO with these implications computes it as well, already 4.9 times faster than the baseline; the graded algorithm is faster by a median factor of 2.0 (and by 1.5 to 1.7 when LinCbO uses the best of ten orders of the columns), and by 2.2 than our own code on the thresholded table with explicit background implications. On random contexts over chains and non-linear lattices, this advantage grows with the height of the lattice, up to 8.4 for a chain with 17 degrees.

cs.LO↗

BLIP: Bernstein-Lifted Iterative p-ROA Verification for Stochastic Neural Control Systems with Nonsmooth Controllers

Certifying probabilistic regions of attraction (p-ROAs) for stochastic neural control systems with nonsmooth neural controllers is challenging. Physics-informed neural network (PINN) methods can yield less conservative p-ROA estimates by approximating stochastic Zubov solutions with a pair of local and outer certification. However, the nonsmooth activation functions in neural controllers, like ReLU, can violate the smoothness assumptions of existing local second-order verification, while direct satisfiability modulo theories (SMT) encoding is costly. We present BLIP (Bernstein-Lifted Iterative p-ROA Verification), a sound abstraction-and-refinement framework using certified controller Taylor models (TMs) built through layerwise Bernstein approximation. Composing these TMs with stochastic plant dynamics provides generator upper bounds for local and outer certification. For difficult near-equilibrium tasks unresolved by these bounds, BLIP lifts controller remainders into auxiliary variables, yielding a smooth generator for second-order certification. Network-derived incremental quadratic constraints reintroduce certified state--remainder coupling lost during lifting, restricting spurious near-equilibrium combinations. Propagation-aware refinement selectively increases Bernstein orders at influential nodes, with Direct-SMT fallback. Combining verified local and outer certificates yields the certified p-ROA inner approximations without modifying the controller. Experiments on five benchmarks demonstrate successful certification and lower verification costs than Direct-SMT in all completed whole-task comparisons.

cs.LO↗