Towards a Formalised Framework for Analog Electronics and Circuit Theory
Yaohua Zhang, Zhi Kai Pong
eess.SY
Nov 23, 2026 · v1
TL;DR
Formalises an ideal RC low-pass filter in Lean 4 with Mathlib, defining impedance and component models and proving voltage division and transfer-function theorems.
Abstract
Circuit theory provides the mathematical foundation for the analysis and design of electronic circuits. However, conventional circuit derivations often rely on assumptions and mathematical relationships that are not explicitly recorded, making their verification and reuse challenging. In this paper, we present the first step towards a formalised framework for circuit theory and analog electronics using the Lean 4 interactive theorem prover. As a proof of concept, we formalise an ideal RC low-pass filter, establishing reusable definitions for component impedance and circuit connections, and machine-checked theorems for voltage division, the transfer function, and low-pass behaviour. Building upon this demonstration, we outline a broader vision for an extensible library of circuit models, definitions, and verified results. Our long-term aim is to digitise, standardise, and verify circuit theory, enabling established knowledge to be systematically checked, shared, and reused across different circuit analyses.
Problem
Circuit-theory derivations often rely on assumptions and mathematical relationships that are never written down. This makes the results hard to verify and reuse across analyses.
Approach
A Lean 4 framework built on Mathlib models component impedance with an inductive type that separates finite impedance from an open circuit, which avoids Lean's 1/0=0 convention. Resistor and capacitor models with non-negative real parameters and series connections are defined in sinusoidal steady state using complex phasors. Circuit-level results are derived from these definitions rather than assumed.
Results
Machine-checked theorems cover voltage division, the RC transfer function H(jω)=1/(1+jωRC), and low-pass behaviour. The authors outline a broader extensible circuit-theory library and plan an open-source release.