Skip to content

Commit 3746532

Browse files
authored
fix: add a missing where to correct a vacuous class (#431)
Previously this class said "Given an LTS with finite image and finite outgoing labels, we say it is finitely branching if \<empty condition\>`. This was nonsense, and also made it impossible to state that something was _not_ finitely branching. This adds the missing `where` keyword such that it instead as "Given an LTS, we say it is finitely branching if it has finite image and finite outgoing labels".
1 parent 7fc2afd commit 3746532

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

Cslib/Foundations/Semantics/LTS/Basic.lean

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,7 @@ theorem LTS.mem_foldl_setImage (lts : LTS State Label) :
677677
exact LTS.mem_setImageMultistep
678678

679679
/-- An lts is image-finite if all images of its states are finite. -/
680-
@[scoped grind]
681-
class LTS.ImageFinite [image_finite : ∀ s μ, Finite (lts.image s μ)]
680+
abbrev LTS.ImageFinite := ∀ s μ, Finite (lts.image s μ)
682681

683682
/-- In a deterministic LTS, if a state has a `μ`-derivative, then it can have no other
684683
`μ`-derivative. -/
@@ -710,11 +709,11 @@ instance [lts.Deterministic] (s : State) (μ : Label) : Finite (lts.image s μ)
710709
apply Set.finite_empty
711710

712711
/-- Every deterministic LTS is also image-finite. -/
713-
instance LTS.deterministic_imageFinite [lts.Deterministic] : lts.ImageFinite := {}
712+
instance LTS.deterministic_imageFinite [lts.Deterministic] : lts.ImageFinite := inferInstance
714713

715714
/-- Every finite-state LTS is also image-finite. -/
716715
@[scoped grind .]
717-
instance LTS.finiteState_imageFinite [Finite State] : lts.ImageFinite := {}
716+
instance LTS.finiteState_imageFinite [Finite State] : lts.ImageFinite := inferInstance
718717

719718
/-- A state has an outgoing label `μ` if it has a `μ`-derivative. -/
720719
def LTS.HasOutLabel (s : State) (μ : Label) : Prop :=
@@ -725,14 +724,14 @@ def LTS.outgoingLabels (s : State) := { μ | lts.HasOutLabel s μ }
725724

726725
/-- An LTS is finitely branching if it is image-finite and all states have finite sets of
727726
outgoing labels. -/
728-
class LTS.FinitelyBranching
729-
[image_finite : ∀ s μ, Finite (lts.image s μ)]
727+
class LTS.FinitelyBranching where
728+
[image_finite : lts.ImageFinite]
730729
[finite_state : ∀ s, Finite (lts.outgoingLabels s)]
731730

731+
attribute [instance] LTS.FinitelyBranching.image_finite LTS.FinitelyBranching.finite_state
732+
732733
/-- Every LTS with finite types for states and labels is also finitely branching. -/
733-
@[scoped grind .]
734-
instance LTS.finiteState_finitelyBranching [Finite State] [Finite Label] : lts.FinitelyBranching :=
735-
{}
734+
instance LTS.FinitelyBranching.of_finite [Finite State] [Finite Label] : lts.FinitelyBranching where
736735

737736
/-- An LTS is acyclic if there are no infinite multistep transitions. -/
738737
class LTS.Acyclic (lts : LTS State Label) where

0 commit comments

Comments
 (0)