Skip to content

feat(LTS): labeled transition systems as coalgebras#603

Open
tannerduve wants to merge 1 commit into
leanprover:mainfrom
tannerduve:feat-lts-coalgebra
Open

feat(LTS): labeled transition systems as coalgebras#603
tannerduve wants to merge 1 commit into
leanprover:mainfrom
tannerduve:feat-lts-coalgebra

Conversation

@tannerduve
Copy link
Copy Markdown
Contributor

This PR adds Cslib/Foundations/Semantics/LTS/LTSCat/Coalgebra.lean, which defines labelled transition systems with a fixed label set L as coalgebras of the endofunctor F_L X = Set (L × X) on Type u.

LTS.Endo Label is the endofunctor F_L : Type u ⥤ Type u. LTS.Coalgebra Label is the category of F_L-coalgebras, defined as Endofunctor.Coalgebra (Endo Label), using Mathlib's Coalgebra. LTS.Coalgebra.toLTSCat is a faithful functor from the coalgebra category to LTSCat.

The main result of this file is that coalgebra morphisms coincide with functional bisimulations. More precisely, we have an equivalence graphBisimEquiv, stating that morphisms V ⟶ W are in bijection with the state maps V.V → W.V whose graph is a functional bisimulation between the underlying LTSs

This construction does not give an equivalence between categories, as LTSCat is strictly larger. Its objects can have different label sets and its morphisms can rename labels via labelMap, drop them to silent steps, and need only be one-way simulations, while coalgebra morphisms fix the label set.

@tannerduve tannerduve force-pushed the feat-lts-coalgebra branch 3 times, most recently from f1ea11b to 80106c2 Compare May 28, 2026 04:42
Adds Cslib/Foundations/Semantics/LTS/LTSCat/Coalgebra.lean, which exhibits
labelled transition systems with a fixed label set as coalgebras of the
Set-endofunctor F_L X = Set (L × X) on Type u.

LTS.Endo Label is the endofunctor F_L. LTS.Coalgebra Label is the category
of F_L-coalgebras, defined as Endofunctor.Coalgebra (Endo Label), reusing
Mathlib's existing notion. LTS.Coalgebra.toLTS extracts the LTS underlying
a coalgebra, and LTS.Coalgebra.toLTSCat is the functor from Coalgebra Label
to LTSCat sending a functional bisimulation to its underlying simulation.

LTS.Coalgebra.toLTSCat is faithful. The theorem graph_isBisimulation shows
that every coalgebra morphism is, as the graph of its underlying state
map, a functional bisimulation between the underlying LTSs. The dual
construction homOfGraphBisim lifts every functional bisimulation to a
coalgebra morphism, and graphBisimEquiv packages both directions into a
bijection between coalgebra morphisms V ⟶ W and state maps V.V → W.V whose
graph is a functional bisimulation.

This is not an equivalence of categories, as LTSCat is strictly larger
(objects can carry different label sets, morphisms can rename labels, drop
them to silent steps, and need only be one-way simulations); graphBisimEquiv
exhibits LTS.Coalgebra Label as a non-full subcategory of LTSCat, namely
the label-preserving functional bisimulations between same-label LTSs.

Cslib/Foundations/Semantics/LTS/LTSCat/Basic.lean is made universe
polymorphic for LTS.Morphism, LTS.Morphism.id, LTS.Morphism.comp, and the
Category LTSCat instance, and @[ext] is added on LTS.Morphism.
references.bib adds the Rutten2000 entry. Cslib.lean imports the new file.
@tannerduve tannerduve force-pushed the feat-lts-coalgebra branch from 80106c2 to b59d893 Compare May 28, 2026 19:30
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.

1 participant