Skip to content

Formalize the finite-dimensional Kalman decomposition - #14

Open
dongxuelian2 wants to merge 8 commits into
AnandGokhale:mainfrom
dongxuelian2:kalman-decomposition
Open

dongxuelian2 wants to merge 8 commits into
AnandGokhale:mainfrom
dongxuelian2:kalman-decomposition

Conversation

@dongxuelian2

@dongxuelian2 dongxuelian2 commented Sep 7, 2026

Copy link
Copy Markdown

Summary

This PR formalizes the classical finite-dimensional Kalman decomposition on top of the existing controllability, observability, and Hautus development.

Main additions

  • A dedicated LeanForControl/LinearSystems/Reachability/ subject-area directory with a living plan.md.
  • A finite-horizon reachable subspace, with its definition separated into DefsReachability.lean and its characterizations and invariance results in Reachability.lean.
  • The relationship between the reachable subspace and controllability, including the Cayley–Hamilton proof of state-matrix invariance.
  • A KalmanDecomposition data structure in Reachability/DefsKalmanDecomposition.lean, separated from its theorem implementation.
  • An adapted direct-sum linear equivalence and bases for the four coordinate sectors cuo, co, uuo, uo.
  • Transported A/B/C maps and an explicit entrywise block-zero theorem for their adapted matrices.
  • Standalone regression examples, including zero-dimensional state spaces, and blueprint integration for the precise reachability-membership equivalence.

Provenance

The mathematical results are classical finite-dimensional linear-systems results. References used in the source are:

  • João P. Hespanha, Linear Systems Theory.
  • R. E. Kalman, “Mathematical Description of Linear Dynamical Systems,” Journal of the Society for Industrial and Applied Mathematics, Series A: Control 1(2), 152–192, 1963. DOI: 10.1137/0301010.
  • Kailath, Linear Systems.

The Lean-specific relative direct-sum construction, coordinate equivalence, basis transport, finite-horizon proof plumbing, and entrywise matrix packaging are marked as original formalization infrastructure for LeanForControl.

Interpretation and limitations

The four named sectors are coordinate sectors adapted to the reachable and unobservable subspaces, in the order cuo, co, uuo, uo. The chosen complements are noncanonical vector-space complements, and they are not individually claimed to be A-invariant. The theorem asserts the forced block-zero pattern; no vanishing claim is made for the starred blocks.

Reachability remains tied to the existing finite-horizon controllability matrix rather than being defined as an invariant closure. The formalization follows the existing complex-matrix convention, treats LTI triples (A, B, C), does not include a feedthrough matrix D, and does not claim a numerical decomposition algorithm.

Validation

  • lake exe cache get — passed
  • lake build — passed
  • lake exe runLinter — passed
  • Standalone build of LeanForControl.LinearSystems.Reachability.KalmanDecompositionExamples — passed
  • lake build :blueprint — passed
  • leanblueprint checkdecls — passed
  • Trust audit of reachable-subspace invariance, Kalman-decomposition existence, and the final block-zero theorem — only propext, Classical.choice, and Quot.sound
  • No executable sorry/admit and no new custom axioms
  • git diff --check — passed

@AnandGokhale

Copy link
Copy Markdown
Owner

Can you please add a reference to a paper which has these results. I believe Joao Hespanha's Linear systems theory book should have what you are looking for!

Thank you!
Anand

@AnandGokhale

Copy link
Copy Markdown
Owner

Another quick comment, I dont think having different files for so many results is a scalable approach. Can you create a directory called Reachability within which your results live?

Comment thread LeanForControl/LinearSystems/Reachability/Reachability.lean
Comment thread LeanForControl/LinearSystems/Reachability/Reachability.lean
Comment thread LeanForControl/LinearSystems/Reachability.lean Outdated
@dongxuelian2

Copy link
Copy Markdown
Author

Thanks for the review. I reorganized the new development under LinearSystems/Reachability/ and added a living plan.md. I also added Hespanha's Linear Systems Theory and Kalman's 1963 paper as references, while retaining Kailath as an additional textbook source. The reachability membership statement now has an explicit blueprint formulation, and the boundary helper names have been cleaned up. All local Lean, linter, blueprint, checkdecls, and axiom checks pass.

AnandGokhale added a commit that referenced this pull request Sep 12, 2026
Formalize the finite-dimensional Kalman decomposition

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AnandGokhale added a commit that referenced this pull request Sep 12, 2026
PR #14 added a public copy of the block-column multiplication identity
already proved private in Controllability.lean. De-privatize the original
instead of carrying two proofs of the same fact: Reachability.lean now
reuses LinearSystems.controllabilityMatrix_mulVec_eq_sum via its existing
transitive import of Controllability.lean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AnandGokhale added a commit that referenced this pull request Sep 12, 2026
Move the pre-existing five files, and both PR #13's and PR #14's new files,
into the target structure from LinearSystems/plan.md in one pass so nothing
moves twice:

  LinearSystems/MatrixLemmas.lean          -> MatrixAlgebra/Rank.lean
  LinearSystems/Controllability.lean       -> LinearSystems/Structure/Controllability.lean
  LinearSystems/Observability.lean         -> LinearSystems/Structure/Observability.lean
  LinearSystems/Hautus.lean                -> LinearSystems/Structure/Hautus.lean
  LinearSystems/Stability/DefsHurwitz.lean -> LinearSystems/Stability/Continuous/DefsHurwitz.lean
  LinearSystems/Stability/Hurwitz.lean     -> LinearSystems/Stability/Continuous/Hurwitz.lean
  LinearSystems/Reachability/*.lean        -> LinearSystems/Structure/*.lean (Kalman-* renamed
                                             to Decomposition* to house future controllable/
                                             observable decompositions too)

Two deliberate renames ride along, both noted in plan.md's migration map:
- MatrixLemmas' namespace changes from `LinearSystems.MatrixLemmas` to bare
  `MatrixAlgebra`, since the file has no system semantics and shouldn't carry
  the LinearSystems prefix. Four call sites updated.
- The per-directory plan.md files added by PR #13 and PR #14 are folded into
  the track-level LinearSystems/plan.md and deleted, rather than kept as a
  third and fourth roadmap for the same track.

lake build, runLinter, mk_all --check, and lake build :blueprint (checkdecls)
all pass unchanged after the move.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@AnandGokhale

Copy link
Copy Markdown
Owner

Okay I was going to figure out a good way to integrate this into the library today, but it seems like you want to continue working on it. If you do want to keep working on it, I am supportive, but I want things to be organized better. I would look into theorem structures in popular linear systems textbooks, and align myself with those structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants