feat(LTS/Spectrum): van Glabbeek spectrum as a Galois connection#713
feat(LTS/Spectrum): van Glabbeek spectrum as a Galois connection#713patchwright wants to merge 4 commits into
Conversation
Organise behavioural equivalences as the fixed points of an antitone Galois
connection (polarity) between test classes (⊆) and equivalences (refinement).
The Galois-closed (testable) equivalences are exactly the image of 'induced';
they form a lattice, not a chain. CSLib's HomTraceEq is exhibited as a concrete
closed element.
New module Cslib.Foundations.Semantics.LTS.Spectrum (3 files):
* Galois.lean — polarity, cl closure operator, induced_testable,
spectrum_eq_closed_elements (Mathlib/Cslib.Init only).
* TracePoint.lean — HomTraceEq_testable: trace equivalence is Galois-closed,
via the trace-set observer test class.
* Antichain.lean — exists_incomparable_closed: the closed-element lattice
has an antichain (lattice, not chain).
Builds clean, 0 sorry / 0 axiom. Additive to CSLib (does not redefine bisim/
sim/trace/HML). Does not require the Hennessy-Milner theorem (not yet in CSLib).
…ing + authors Add Spectrum.BisimPoint: HomBisimilarity_testable — bisimilarity is Galois-closed for image-finite LTS, via CSLib's Hennessy-Milner theorem (theoryEq_eq_bisimilarity). This is the non-trivial spectrum point: bisimilarity is not a kernel by definition (unlike trace equivalence); the HM theorem is what makes it one. Correct the false claim in TracePoint.lean that 'CSLib does not yet mechanise HM' — CSLib does mechanise it (Cslib.Logic.HML.theoryEq_eq_bisimilarity). TracePoint now points to BisimPoint for the HM-mediated companion. Set Authors/Copyright to patchwright in all four files (were TODO). With trace (kernel-trivial bottom) and bisimilarity (HM-mediated top) as two closed elements of the same polarity, the framework now unites two genuinely different behavioural equivalences — the actual 'spectrum as Galois' statement.
CI's lake lint found one error: T2 was missing a documentation string (the shared 'Test classes' doc comment attached only to T1). Give T1 and T2 separate docstrings. All other declarations + 14 other linters passed.
ctchou
left a comment
There was a problem hiding this comment.
It would be helpful if you can provide a reference for the theory formalized in this PR.
|
Thanks for taking a look. Two references for the theory here:
This PR mechanizes that polarity and closure operator, and instantiates the |
|
You can add those papers to |
Addresses ctchou's review on leanprover#713: add the spectrum and polarity references to references.bib and refer to them from the Galois module doc, matching CSLib's [Author, *Title*][Key] convention (cf. Cslib/Foundations/Semantics/LTS/Basic.lean). - references.bib: Glabbeek1990 (CONCUR '90, LNCS 458), Glabbeek1993 (Spectrum II), Beohar2022 (arXiv:2207.05407). - Spectrum/Galois.lean: ## References block citing both.
|
Thanks @ctchou — done in d83c14e: the two papers are now in |
ctchou
left a comment
There was a problem hiding this comment.
Your code never defines what a Galois connection is, even though the comments talk about it all the time. Mathlib already contains a lot of stuff about Galois connection:
https://leanprover-community.github.io/mathlib4_docs/Mathlib/Order/GaloisConnection/Defs.html
https://leanprover-community.github.io/mathlib4_docs/Mathlib/Order/GaloisConnection/Basic.html
You should make connection with mathlib's definitions and leverage its theorems as much as possible.
I'm not sure "Galois-closed" is a standard terminology and your code doesn't seem to define it, either. Please clarify what it means, in terms of the theory of Galois connection in mathlib.
The content of Antichain.lean seems to consist of examples. Such a file should be named ExampleXXX.lean.
| (The *named* van Glabbeek antichain — simulation vs failures equivalence — | ||
| requires failures semantics, not yet in CSLib; that named instance is separate | ||
| from the structural result here.) |
There was a problem hiding this comment.
I don't understand this comment. Please clarify.
Summary
Organises behavioural equivalences as the fixed points of an antitone Galois connection ("polarity") between test classes (ordered by ⊆) and equivalences (ordered by refinement). The Galois-closed equivalences — the "testable" ones — are exactly the image of
induced. Two named behavioural equivalences are exhibited as closed elements of the SAME polarity: trace equivalence (kernel-trivial) and bisimilarity (Hennessy–Milner-mediated) — the actual "spectrum as Galois" statement.What's added
New module
Cslib.Foundations.Semantics.LTS.Spectrum(4 files):Galois.lean— the framework (Cslib.Initonly):induced Ω T,respects Ω E, closure operatorcl Ω,polarity(the antitone Galois connection),induced_testable,spectrum_eq_closed_elements.TracePoint.lean—HomTraceEq_testable: homogeneous trace equivalence is Galois-closed, via the trace-set observer test class. (Kernel-trivial bottom point.)BisimPoint.lean—HomBisimilarity_testable: homogeneous bisimilarity is Galois-closed for image-finite LTS, via the Hennessy–Milner theorem (theoryEq_eq_bisimilarity). (Non-trivial top point — bisimilarity is not a kernel by definition; HM makes it one.)Antichain.lean—exists_incomparable_closed: the closed-element lattice contains an antichain (a lattice, not a chain).Why it's additive
CSLib has
Bisimilarity,Simulation/SimulationEquiv,TraceEq, HML, and the Hennessy–Milner theorem (theoryEq_eq_bisimilarity), but no organisation of the spectrum as a Galois structure. This provides that organisation, reusing CSLib's existing equivalences + HM as named closed instances. It does not redefine any existing equivalence.Scope notes / honesty
induced = HomTraceEqis near-definitional. It's the honest bottom point; the per-traceBool-test refinement (decidability-gated) is a finer witness for the same closed element.theoryEq_eq_bisimilarity) to connect bisimilarity to the HML-theory kernel. That step does real work — it's what earns the word "spectrum."Cslib.Logic.HML.Basic.)Verification
Builds clean (Lean v4.32.0-rc1), 0 sorry / 0 axiom. All four modules compile and reach
Cslib.Inittransitively. Full-lib CI runs on this PR.AI use disclosure
Per CSLib's AI policy (following Mathlib): this contribution was developed with AI assistance. An AI coding assistant (Claude Code, glm-5.2 model) wrote the Lean definitions and proofs under the contributor's direction; the contributor designed the approach, reviewed each definition and proof, and accepts responsibility for the content. All proofs are verified by the Lean compiler (0 sorry / 0 axiom), which mitigates the AI-typical errors this disclosure helps reviewers spot. Please flag anything that looks off.
Open questions for maintainers
Cslib/Foundations/Semantics/LTS/Spectrum/— appropriate, or preferred elsewhere?