Model-checking game for the modal μ-calculus
AbbreviationPosition of the μ-calculus model-checking game#✓fully proved
A position of the μ-calculus model-checking game: the formula, the world, and the stack of enclosing fixpoint binders, innermost first.
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
Uses 1 · Used by 53
AbbreviationPlayer of the μ-calculus model-checking game#✓fully proved
The player to move: true is Verifier, false is Refuter.
abbrev Player := Bool
Used by 18
InductiveMoves of the μ-calculus model-checking game#✓fully proved
Fix a Kripke model \(M\) with accessibility relation \(R\). A game position \((\varphi, w, s)\) consists of a μ-calculus formula \(\varphi\) (with de Bruijn variables), a world \(w\) and a stack \(s\) of fixpoint binders, innermost first. The moves are exactly the following. From \((\varphi \wedge \psi, w, s)\) and from \((\varphi \vee \psi, w, s)\) to \((\varphi, w, s)\) and to \((\psi, w, s)\). From \((\Box \varphi, w, s)\) and from \((\Diamond \varphi, w, s)\) to \((\varphi, v, s)\) for every world \(v\) with \(w R v\). From \((\mu \varphi, w, s)\) to \((\varphi, w, s')\), where \(s'\) is \(s\) with \(\mu \varphi\) pushed on top, and likewise from \((\nu \varphi, w, s)\) to \((\varphi, w, s'')\), where \(s''\) is \(s\) with \(\nu \varphi\) pushed on top. From \((x_n, w, s)\), where \(x_n\) is the variable with de Bruijn index \(n\) and \(n\) is less than the length of \(s\), to \((s_n, w, t)\), where \(s_n\) is the entry of \(s\) at index \(n\) (counting from \(0\)) and \(t\) is \(s\) with its first \(n + 1\) entries removed.
Cslib.Modal.MuCalculus.Game.Move · 29 lines
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Refuter chooses a successor. -/
| box {φ : MuFormula Atom} {w v : World} {st : List (MuFormula Atom)}
(h : M.rel w v) : Move M ⟨.box φ, w, st⟩ ⟨φ, v, st⟩
/-- Verifier chooses a successor. -/
| dia {φ : MuFormula Atom} {w v : World} {st : List (MuFormula Atom)}
(h : M.rel w v) : Move M ⟨.dia φ, w, st⟩ ⟨φ, v, st⟩
/-- Unfold a least fixed point, pushing its binder on the stack. -/
| mu {φ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.mu φ, w, st⟩ ⟨φ, w, .mu φ :: st⟩
/-- Unfold a greatest fixed point, pushing its binder on the stack. -/
| nu {φ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.nu φ, w, st⟩ ⟨φ, w, .nu φ :: st⟩
/-- Jump back to the binder a variable refers to, restoring that binder's stack. -/
| var {n : ℕ} {w : World} {st : List (MuFormula Atom)} (h : n < st.length) :
Move M ⟨.var n, w, st⟩ ⟨st.getD n .bot, w, st.drop (n + 1)⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
Uses 3 · Used by 32
DefinitionOwner of a game position#✓fully proved
The owner of a game position \((\varphi, w, s)\) is Verifier when \(\varphi\) is a disjunction, a diamond formula or a greatest fixed point, and Refuter for every other formula.
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
abbrev Player := Bool
CSLibExt/Logics/Modal/MuCalculusGame.lean:112
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
Uses 3 · Used by 17
DefinitionPriority of a game position#✓fully proved
Only fixpoint-binder positions carry a priority. For a formula \(\varphi\), a world \(w\) and a binder stack \(s\) of length \(k\), the position \((\mu X.\,\varphi, w, s)\), whose formula is the least fixpoint with body \(\varphi\), has priority \(2k+1\), the position \((\nu X.\,\varphi, w, s)\), whose formula is the greatest fixpoint with body \(\varphi\), has priority \(2k+2\), and every other position has no priority. Priorities strictly increase with nesting depth, so the outermost binder regenerated infinitely often has the least priority.
This is the nesting-depth refinement of the alternation-depth priority assignment: same-type nesting counts toward the depth, which only refines the order (outer still strictly below inner) and keeps parity tied to the binder kind. Fixed priorities (\(\mu \mapsto 1\), \(\nu \mapsto 2\)) under the greatest-recurring-priority rule would let an inner vacuous \(\nu\) dominate an outer \(\mu\): in \(\mu X.\,\nu Y.\,X\), whose denotation is empty, Verifier would win the only play.
def prio : GamePosition Atom World → Option ℕ
| ⟨.mu _, _, st⟩ => some (2 * st.length + 1)
| ⟨.nu _, _, st⟩ => some (2 * st.length + 2)
| _ => none
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Sources
- E. A. Emerson and C. S. Jutla, "Tree automata, μ-calculus and determinacy", Proceedings of FOCS 1991, 368-377; C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6; J. A. Bradfield, "The modal μ-calculus alternation hierarchy is strict", Theoretical Computer Science 195 (1998), 133-153 (alternation depth).
Uses 2 · Used by 5
DefinitionPositions with no moves#✓fully proved
In a Kripke model \(M\), a game position \(p\) has no moves when there is no position \(q\) such that going from \(p\) to \(q\) is a move of the model-checking game in \(M\).
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
Uses 3 · Used by 19
DefinitionWinner at a terminal position#✓fully proved
Let \(M\) be a Kripke model and \(\mathit{env}\) an environment assigning a predicate on worlds to every index. At a game position \((\varphi, w, st)\), where \(st\) is the stack of enclosing fixpoint binders and \(|st|\) its length, Verifier wins exactly when \(\varphi\) is an atom \(a\) true at \(w\), a negated atom \(\neg a\) with \(a\) false at \(w\), \(\top\), a box \(\Box\psi\), or a variable with de Bruijn index \(n \ge |st|\) such that \(\mathit{env}(n - |st|)\) holds at \(w\). At every other position (a variable with index \(n < |st|\), \(\bot\), a diamond, a conjunction, a disjunction or a fixpoint) Refuter wins.
The condition is consulted only at positions with no moves: a box with no successors leaves Refuter stuck and a diamond with no successors leaves Verifier stuck, while a bound variable, a conjunction, a disjunction and a fixpoint always have a move. The environment index is shifted by \(|st|\) because each binder on the stack shifts de Bruijn indices by one.
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
Uses 3 · Used by 21
DefinitionParity winning condition#✓fully proved
For an infinite sequence of game positions \(p_0, p_1, \dots\), Verifier wins by the parity condition when there is an even priority \(e\) such that infinitely many positions \(p_n\) have priority \(e\), and every priority \(e' < e\) is the priority of only finitely many positions \(p_n\). Equivalently, some priority occurs infinitely often and the least such priority is even; in particular, if no priority occurs infinitely often, Verifier does not win. Only fixpoint-binder positions carry a priority, so the other positions do not affect the outcome.
The least-priority convention is what makes outer binders dominate: an outer binder has a smaller priority than any binder nested inside it.
def ParityWin (play : ℕ → GamePosition Atom World) : Prop :=
∃ e, Even e ∧ (∀ N, ∃ n, N ≤ n ∧ prio (play n) = some e) ∧
∀ e', e' < e → ∃ N, ∀ n, N ≤ n → prio (play n) ≠ some e'
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
def prio : GamePosition Atom World → Option ℕ
| ⟨.mu _, _, st⟩ => some (2 * st.length + 1)
| ⟨.nu _, _, st⟩ => some (2 * st.length + 2)
| _ => none
CSLibExt/Logics/Modal/MuCalculusGame.lean:168
Sources
- E. A. Emerson and C. S. Jutla, "Tree automata, μ-calculus and determinacy", Proceedings of FOCS 1991, 368-377.
Uses 2 · Used by 6
StructureVerifier strategy#✓fully proved
A Verifier strategy for the model-checking game on a Kripke model \(M\) is a map \(\sigma\) from game positions to game positions such that, at every Verifier-owned position \(p\) from which some move exists, there is a move from \(p\) to \(\sigma(p)\).
The move-respecting condition is what makes Verifier's winning meaningful: without it, a strategy could "win" by choosing a non-move at a Verifier position, leaving no legal play at all.
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
choose : GamePosition Atom World → GamePosition Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:215
Uses 5 · Used by 15
InductiveFinite plays consistent with a strategy#✓fully proved
Fix a Kripke model \(M\) and a Verifier strategy \(\sigma\). The finite plays from a position \(p\) that follow \(\sigma\) are the lists of positions defined inductively: the one-element list \([p]\) is such a play; and if the game has a move from \(p\) to \(q\), where \(q\) is the position chosen by \(\sigma\) at \(p\) whenever Verifier owns \(p\), then \(p\) followed by any such play from \(q\) is such a play from \(p\).
A play need not end at a position with no moves: every finite prefix counts.
inductive PlayFrom (M : KripkeModel World Atom) (σ : Strategy M) :
GamePosition Atom World → List (GamePosition Atom World) → Prop
/-- The trivial play. -/
| single {p : GamePosition Atom World} : PlayFrom M σ p [p]
/-- A move followed by a play from the successor. -/
| cons {p q : GamePosition Atom World} {ps : List (GamePosition Atom World)}
(h : Move M p q) (hσ : Owner p = true → q = σ.choose p) (hps : PlayFrom M σ q ps) :
PlayFrom M σ p (p :: ps)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
Uses 6 · Used by 9
DefinitionLast position of a play#✓fully proved
The last position of a finite list of game positions is its final entry when the list is nonempty; the empty list has no last position.
def playLast (ps : List (GamePosition Atom World)) : Option (GamePosition Atom World) :=
ps.getLast?
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Uses 1 · Used by 9
DefinitionWinning strategy from a position#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment assigning a predicate on worlds to every index, \(\sigma\) a Verifier strategy for the model-checking game on \(M\) and \(p\) a game position. A play is consistent with \(\sigma\) when each step is a move and, at every Verifier-owned position, goes to the position chosen by \(\sigma\). The strategy \(\sigma\) wins from \(p\) in \(\mathit{env}\) when every finite play from \(p\) consistent with \(\sigma\) whose last position has no moves ends in a position that is a terminal win for Verifier in \(\mathit{env}\), and every infinite play from \(p\) consistent with \(\sigma\) satisfies the parity condition.
def StrategyWins (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(σ : Strategy M) (p : GamePosition Atom World) : Prop :=
(∀ ps : List (GamePosition Atom World), PlayFrom M σ p ps →
(∃ q, playLast ps = some q ∧ NoMoves M q) →
∃ q, playLast ps = some q ∧ TerminalWin M env q) ∧
(∀ play : ℕ → GamePosition Atom World, play 0 = p →
(∀ n, Move M (play n) (play (n + 1)) ∧
(Owner (play n) = true → play (n + 1) = σ.choose (play n))) →
ParityWin play)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive PlayFrom (M : KripkeModel World Atom) (σ : Strategy M) :
GamePosition Atom World → List (GamePosition Atom World) → Prop
/-- The trivial play. -/
| single {p : GamePosition Atom World} : PlayFrom M σ p [p]
/-- A move followed by a play from the successor. -/
| cons {p q : GamePosition Atom World} {ps : List (GamePosition Atom World)}
(h : Move M p q) (hσ : Owner p = true → q = σ.choose p) (hps : PlayFrom M σ q ps) :
PlayFrom M σ p (p :: ps)
CSLibExt/Logics/Modal/MuCalculusGame.lean:221
def playLast (ps : List (GamePosition Atom World)) : Option (GamePosition Atom World) :=
ps.getLast?
CSLibExt/Logics/Modal/MuCalculusGame.lean:231
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
CSLibExt/Logics/Modal/MuCalculusGame.lean:174
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
def ParityWin (play : ℕ → GamePosition Atom World) : Prop :=
∃ e, Even e ∧ (∀ N, ∃ n, N ≤ n ∧ prio (play n) = some e) ∧
∀ e', e' < e → ∃ N, ∀ n, N ≤ n → prio (play n) ≠ some e'
CSLibExt/Logics/Modal/MuCalculusGame.lean:204
Uses 11 · Used by 6
DefinitionVerifier has a winning strategy#✓fully proved
For a Kripke model \(M\), an environment \(\mathit{env}\) and a game position \(p\), Verifier wins from \(p\) when some Verifier strategy \(\sigma\) in the model-checking game on \(M\) wins from \(p\) in environment \(\mathit{env}\): every complete finite \(\sigma\)-consistent play from \(p\) ends at a terminal winning position, and every infinite \(\sigma\)-consistent play from \(p\) satisfies the parity condition.
def VerifierWins (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(p : GamePosition Atom World) : Prop :=
∃ σ : Strategy M, StrategyWins M env σ p
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
def StrategyWins (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(σ : Strategy M) (p : GamePosition Atom World) : Prop :=
(∀ ps : List (GamePosition Atom World), PlayFrom M σ p ps →
(∃ q, playLast ps = some q ∧ NoMoves M q) →
∃ q, playLast ps = some q ∧ TerminalWin M env q) ∧
(∀ play : ℕ → GamePosition Atom World, play 0 = p →
(∀ n, Move M (play n) (play (n + 1)) ∧
(Owner (play n) = true → play (n + 1) = σ.choose (play n))) →
ParityWin play)
CSLibExt/Logics/Modal/MuCalculusGame.lean:237
Uses 4 · Used by 4
Closed formulas and the regression for nesting-depth priorities
DefinitionFormulas closed at depth \(d\)#✓fully proved
Closedness of a μ-calculus formula \(\varphi\) (with de Bruijn variables) at a depth \(d \in \mathbb{N}\) is defined by recursion on \(\varphi\): atoms, negated atoms, \(\bot\) and \(\top\) are closed at every depth; the variable with index \(n\) is closed at depth \(d\) exactly when \(n < d\); \(\varphi \wedge \psi\) and \(\varphi \vee \psi\) are closed at depth \(d\) when both \(\varphi\) and \(\psi\) are; \(\Box\varphi\) and \(\Diamond\varphi\) are closed at depth \(d\) when \(\varphi\) is; and \(\mu\varphi\) and \(\nu\varphi\) are closed at depth \(d\) when \(\varphi\) is closed at depth \(d + 1\). Thus every free variable of \(\varphi\) refers to one of \(d\) enclosing binders.
def ClosedAt : MuFormula Atom → ℕ → Prop
| .atom _, _ => True
| .natom _, _ => True
| .var n, d => n < d
| .bot, _ => True
| .top, _ => True
| .and φ ψ, d => ClosedAt φ d ∧ ClosedAt ψ d
| .or φ ψ, d => ClosedAt φ d ∧ ClosedAt ψ d
| .box φ, d => ClosedAt φ d
| .dia φ, d => ClosedAt φ d
| .mu φ, d => ClosedAt φ (d + 1)
| .nu φ, d => ClosedAt φ (d + 1)
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6 (de Bruijn variables).
Uses 1 · Used by 3
DefinitionClosed formulas#✓fully proved
A μ-calculus formula \(\varphi\) is closed when it is closed at depth \(0\), that is, when it has no free variables.
def Closed (φ : MuFormula Atom) : Prop := ClosedAt φ 0
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
def ClosedAt : MuFormula Atom → ℕ → Prop
| .atom _, _ => True
| .natom _, _ => True
| .var n, d => n < d
| .bot, _ => True
| .top, _ => True
| .and φ ψ, d => ClosedAt φ d ∧ ClosedAt ψ d
| .or φ ψ, d => ClosedAt φ d ∧ ClosedAt ψ d
| .box φ, d => ClosedAt φ d
| .dia φ, d => ClosedAt φ d
| .mu φ, d => ClosedAt φ (d + 1)
| .nu φ, d => ClosedAt φ (d + 1)
CSLibExt/Logics/Modal/MuCalculusGame.lean:258
Uses 2 · Used by 1
TheoremClosedness is monotone in the depth#✓fully proved
Let \(\varphi\) be a μ-calculus formula and let \(d \le d'\) be natural numbers. If \(\varphi\) is closed at depth \(d\) (every free variable of \(\varphi\) is less than \(d\)), then \(\varphi\) is closed at depth \(d'\): more enclosing binders can only bind more variables.
theorem ClosedAt.mono {φ : MuFormula Atom} {d d' : ℕ} (h : d ≤ d')
(hc : ClosedAt φ d) : ClosedAt φ d'
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
def ClosedAt : MuFormula Atom → ℕ → Prop
| .atom _, _ => True
| .natom _, _ => True
| .var n, d => n < d
| .bot, _ => True
| .top, _ => True
| .and φ ψ, d => ClosedAt φ d ∧ ClosedAt ψ d
| .or φ ψ, d => ClosedAt φ d ∧ ClosedAt ψ d
| .box φ, d => ClosedAt φ d
| .dia φ, d => ClosedAt φ d
| .mu φ, d => ClosedAt φ (d + 1)
| .nu φ, d => ClosedAt φ (d + 1)
CSLibExt/Logics/Modal/MuCalculusGame.lean:258
Uses 2
TheoremSatisfaction depends only on the environment below the closure depth#✓fully proved
Let \(M\) be a Kripke model, \(\varphi\) a μ-calculus formula and \(d\) a natural number such that \(\varphi\) is closed at depth \(d\): every occurrence of a variable with de Bruijn index \(n\) lying under \(k\) fixpoint binders of \(\varphi\) satisfies \(n < d + k\). If two environments \(\mathit{env}\) and \(\mathit{env}'\), each assigning a predicate on worlds to every index, agree at every index \(n < d\), then for every world \(w\), \(\varphi\) is satisfied at \(w\) in \(M\) under \(\mathit{env}\) if and only if it is satisfied at \(w\) in \(M\) under \(\mathit{env}'\).
In particular, satisfaction of a closed formula is independent of the environment.
theorem sat_eq_of_closedAt (M : KripkeModel World Atom) :
∀ (φ : MuFormula Atom) {env env' : ℕ → World → Prop} {d : ℕ},
(∀ n, n < d → env n = env' n) → ClosedAt φ d → ∀ w,
sat M env φ w ↔ sat M env' φ w
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
def ClosedAt : MuFormula Atom → ℕ → Prop
| .atom _, _ => True
| .natom _, _ => True
| .var n, d => n < d
| .bot, _ => True
| .top, _ => True
| .and φ ψ, d => ClosedAt φ d ∧ ClosedAt ψ d
| .or φ ψ, d => ClosedAt φ d ∧ ClosedAt ψ d
| .box φ, d => ClosedAt φ d
| .dia φ, d => ClosedAt φ d
| .mu φ, d => ClosedAt φ (d + 1)
| .nu φ, d => ClosedAt φ (d + 1)
CSLibExt/Logics/Modal/MuCalculusGame.lean:258
def sat (env : ℕ → World → Prop) : MuFormula Atom → (World → Prop)
| .atom a => fun w => M.valuation w a
| .natom a => fun w => ¬ M.valuation w a
| .var n => env n
| .bot => fun _ => False
| .top => fun _ => True
| .and φ ψ => fun w => sat env φ w ∧ sat env ψ w
| .or φ ψ => fun w => sat env φ w ∨ sat env ψ w
| .box φ => fun w => ∀ v, M.rel w v → sat env φ v
| .dia φ => fun w => ∃ v, M.rel w v ∧ sat env φ v
| .mu φ => fun w => ∀ S : World → Prop,
(∀ v, sat (extendEnv env S) φ v → S v) → S w
⋯
CSLibExt/Logics/Modal/MuCalculus.lean:124
Sources
- D. Kozen, Results on the propositional μ-calculus, Theoretical Computer Science 27 (1983), 333-354.
Uses 5 · Used by 1
TheoremClosed formulas are environment-independent#✓fully proved
Let \(M\) be a Kripke model and \(\varphi\) a closed μ-calculus formula, that is, one with no free variables. For any two environments \(\mathrm{env}\) and \(\mathrm{env}'\), each assigning a set of worlds to every variable index, and every world \(w\), \(\varphi\) is satisfied at \(w\) in \(M\) under \(\mathrm{env}\) if and only if it is satisfied at \(w\) in \(M\) under \(\mathrm{env}'\).
theorem sat_closed (M : KripkeModel World Atom) {φ : MuFormula Atom}
(hφ : Closed φ) (env env' : ℕ → World → Prop) (w : World) :
sat M env φ w ↔ sat M env' φ w
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
def Closed (φ : MuFormula Atom) : Prop := ClosedAt φ 0
CSLibExt/Logics/Modal/MuCalculusGame.lean:272
def sat (env : ℕ → World → Prop) : MuFormula Atom → (World → Prop)
| .atom a => fun w => M.valuation w a
| .natom a => fun w => ¬ M.valuation w a
| .var n => env n
| .bot => fun _ => False
| .top => fun _ => True
| .and φ ψ => fun w => sat env φ w ∧ sat env ψ w
| .or φ ψ => fun w => sat env φ w ∨ sat env ψ w
| .box φ => fun w => ∀ v, M.rel w v → sat env φ v
| .dia φ => fun w => ∃ v, M.rel w v ∧ sat env φ v
| .mu φ => fun w => ∀ S : World → Prop,
(∀ v, sat (extendEnv env S) φ v → S v) → S w
⋯
CSLibExt/Logics/Modal/MuCalculus.lean:124
Uses 5
DefinitionThe one-world reflexive Kripke model#✓fully proved
The Kripke model with a single world, which is related to itself, and a single atom, which is false at that world.
def counterexampleModel : KripkeModel Unit Unit where
nonempty_world := ⟨Unit.unit⟩
rel := fun _ _ => True
valuation := fun _ _ => False
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 1 · Used by 2
DefinitionA least fixpoint over a vacuous greatest fixpoint#✓fully proved
The μ-calculus formula \(\mu X.\, \nu Y.\, X\) over a one-element type of atoms: a least fixpoint whose body is a greatest fixpoint whose body is the variable \(X\) bound by the outer least fixpoint, so the variable \(Y\) bound by the inner greatest fixpoint never occurs.
Its denotation is empty: the outer functional is the identity, and the least fixed point of the identity on predicates is the empty predicate.
def counterexampleFormula : MuFormula Unit := .mu (.nu (.var 1))
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
Uses 1 · Used by 1
DefinitionStarting position of the regression play#✓fully proved
The game position consisting of the formula \(\mu X.\,\nu Y.\,X\), the unique world of the one-world model, and the empty binder stack.
def cePos0 : GamePosition Unit Unit :=
⟨.mu (.nu (.var 1)), Unit.unit, []⟩
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Uses 2 · Used by 8
DefinitionSecond position of the regression play#✓fully proved
The game position consisting of the formula \(\nu Y.\,X\), the unique world of the one-world model, and the binder stack \([\mu X.\,\nu Y.\,X]\). Here \(X\) is the de Bruijn variable \(1\), which refers to the binder \(\mu X\) on the stack.
def cePos1 : GamePosition Unit Unit :=
⟨.nu (.var 1), Unit.unit, [.mu (.nu (.var 1))]⟩
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Uses 2 · Used by 6
DefinitionThird position of the regression play#✓fully proved
The game position consisting of the variable \(X\), the unique world of the one-world model, and the binder stack \([\nu Y.\,X,\ \mu X.\,\nu Y.\,X]\), listed innermost first. Here \(X\) is the de Bruijn variable \(1\), which refers to the outer binder \(\mu X\).
def cePos2 : GamePosition Unit Unit :=
⟨.var 1, Unit.unit, [.nu (.var 1), .mu (.nu (.var 1))]⟩
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Uses 2 · Used by 5
DefinitionStep map of the regression play#✓fully proved
Let \(\Phi = \mu X.\, \nu Y.\, X\) be the regression formula over the one-element type of atoms, and write game positions over the one-element type of worlds as (formula, world, stack of enclosing binders, innermost first). For every world \(w\), the step map sends \((\Phi, w, [\,])\) to \((\nu Y.\, X, w, [\Phi])\), sends \((\nu Y.\, X, w, [\Phi])\) to \((X, w, [\nu Y.\, X, \Phi])\), and sends \((X, w, [\nu Y.\, X, \Phi])\) to \((\Phi, w, [\,])\), where \(X\) is the variable bound by the outer \(\mu\); every other game position is sent to itself.
def ceNext : GamePosition Unit Unit → GamePosition Unit Unit
| ⟨.mu (.nu (.var 1)), w, []⟩ => ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩
| ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩ =>
⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩
| ⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩ =>
⟨.mu (.nu (.var 1)), w, []⟩
| p => p
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Uses 2 · Used by 7
DefinitionThe regression play#✓fully proved
Write \(\ast\) for the unique world, and consider the game positions (formula, world, binder stack listed innermost first) \(P_0 = (\mu X.\,\nu Y.\,X,\ \ast,\ [\,])\), \(P_1 = (\nu Y.\,X,\ \ast,\ [\mu X.\,\nu Y.\,X])\) and \(P_2 = (X,\ \ast,\ [\nu Y.\,X,\ \mu X.\,\nu Y.\,X])\). Let \(s\) be the step map sending \(P_0\) to \(P_1\), \(P_1\) to \(P_2\) and \(P_2\) to \(P_0\), and fixing every other position. The regression play is the sequence of positions \(p_0 = P_0\), \(p_{n+1} = s(p_n)\), which cycles through \(P_0, P_1, P_2\).
These are the successive positions of the model-checking game for \(\mu X.\,\nu Y.\,X\) on the one-world model.
def cePlay : ℕ → GamePosition Unit Unit
| 0 => cePos0
| n + 1 => ceNext (cePlay n)
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
def cePos0 : GamePosition Unit Unit :=
⟨.mu (.nu (.var 1)), Unit.unit, []⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:396
def ceNext : GamePosition Unit Unit → GamePosition Unit Unit
| ⟨.mu (.nu (.var 1)), w, []⟩ => ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩
| ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩ =>
⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩
| ⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩ =>
⟨.mu (.nu (.var 1)), w, []⟩
| p => p
CSLibExt/Logics/Modal/MuCalculusGame.lean:406
Uses 3 · Used by 5
TheoremRegression cycle, first step#✓fully proved
Let \(\Phi = \mu X.\, \nu Y.\, X\) be the regression formula, \(\ast\) the unique world, and write game positions as (formula, world, stack of enclosing binders, innermost first). The step map of the regression play sends the first cycle position \((\Phi, \ast, [\,])\) to the second cycle position \((\nu Y.\, X, \ast, [\Phi])\).
theorem ceNext_cePos0 : ceNext cePos0 = cePos1
def ceNext : GamePosition Unit Unit → GamePosition Unit Unit
| ⟨.mu (.nu (.var 1)), w, []⟩ => ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩
| ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩ =>
⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩
| ⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩ =>
⟨.mu (.nu (.var 1)), w, []⟩
| p => p
CSLibExt/Logics/Modal/MuCalculusGame.lean:406
def cePos0 : GamePosition Unit Unit :=
⟨.mu (.nu (.var 1)), Unit.unit, []⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:396
def cePos1 : GamePosition Unit Unit :=
⟨.nu (.var 1), Unit.unit, [.mu (.nu (.var 1))]⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:399
Uses 4 · Used by 1
TheoremRegression cycle, second step#✓fully proved
Let \(\Phi = \mu X.\, \nu Y.\, X\) be the regression formula, \(\ast\) the unique world, and write game positions as (formula, world, stack of enclosing binders, innermost first). The step map of the regression play sends the second cycle position \((\nu Y.\, X, \ast, [\Phi])\) to the third cycle position \((X, \ast, [\nu Y.\, X, \Phi])\), where \(X\) is the variable bound by the outer \(\mu\).
theorem ceNext_cePos1 : ceNext cePos1 = cePos2
def ceNext : GamePosition Unit Unit → GamePosition Unit Unit
| ⟨.mu (.nu (.var 1)), w, []⟩ => ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩
| ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩ =>
⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩
| ⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩ =>
⟨.mu (.nu (.var 1)), w, []⟩
| p => p
CSLibExt/Logics/Modal/MuCalculusGame.lean:406
def cePos1 : GamePosition Unit Unit :=
⟨.nu (.var 1), Unit.unit, [.mu (.nu (.var 1))]⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:399
def cePos2 : GamePosition Unit Unit :=
⟨.var 1, Unit.unit, [.nu (.var 1), .mu (.nu (.var 1))]⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:402
Uses 4 · Used by 1
TheoremRegression cycle, third step#✓fully proved
Let \(\Phi = \mu X.\, \nu Y.\, X\) be the regression formula, \(\ast\) the unique world, and write game positions as (formula, world, stack of enclosing binders, innermost first). The step map of the regression play sends the third cycle position \((X, \ast, [\nu Y.\, X, \Phi])\), where \(X\) is the variable bound by the outer \(\mu\), back to the first cycle position \((\Phi, \ast, [\,])\).
theorem ceNext_cePos2 : ceNext cePos2 = cePos0
def ceNext : GamePosition Unit Unit → GamePosition Unit Unit
| ⟨.mu (.nu (.var 1)), w, []⟩ => ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩
| ⟨.nu (.var 1), w, [.mu (.nu (.var 1))]⟩ =>
⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩
| ⟨.var 1, w, [.nu (.var 1), .mu (.nu (.var 1))]⟩ =>
⟨.mu (.nu (.var 1)), w, []⟩
| p => p
CSLibExt/Logics/Modal/MuCalculusGame.lean:406
def cePos2 : GamePosition Unit Unit :=
⟨.var 1, Unit.unit, [.nu (.var 1), .mu (.nu (.var 1))]⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:402
def cePos0 : GamePosition Unit Unit :=
⟨.mu (.nu (.var 1)), Unit.unit, []⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:396
Uses 4 · Used by 1
TheoremThe regression play stays on the cycle#✓fully proved
For every \(n \in \mathbb{N}\), the position at step \(n\) of the regression play is the first, the second or the third cycle position.
theorem cePlay_mem (n : ℕ) :
cePlay n = cePos0 ∨ cePlay n = cePos1 ∨ cePlay n = cePos2
def cePlay : ℕ → GamePosition Unit Unit
| 0 => cePos0
| n + 1 => ceNext (cePlay n)
CSLibExt/Logics/Modal/MuCalculusGame.lean:416
def cePos0 : GamePosition Unit Unit :=
⟨.mu (.nu (.var 1)), Unit.unit, []⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:396
def cePos1 : GamePosition Unit Unit :=
⟨.nu (.var 1), Unit.unit, [.mu (.nu (.var 1))]⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:399
def cePos2 : GamePosition Unit Unit :=
⟨.var 1, Unit.unit, [.nu (.var 1), .mu (.nu (.var 1))]⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:402
Uses 9 · Used by 2
TheoremThe regression play has period three#✓fully proved
Number the positions of the regression play from \(0\). For every natural number \(n\), its position number \(n + 3\) equals its position number \(n\).
theorem cePlay_period (n : ℕ) : cePlay (n + 3) = cePlay n
def cePlay : ℕ → GamePosition Unit Unit
| 0 => cePos0
| n + 1 => ceNext (cePlay n)
CSLibExt/Logics/Modal/MuCalculusGame.lean:416
Uses 3 · Used by 1
TheoremThe regression play returns to its start every three steps#✓fully proved
Number the positions of the regression play of \(\mu X.\,\nu Y.\,X\) from \(0\). For every natural number \(k\), its position number \(3k\) is its starting position: the formula \(\mu X.\,\nu Y.\,X\) at the unique world, with the empty binder stack.
theorem cePlay_mul_three (k : ℕ) : cePlay (3 * k) = cePos0
def cePlay : ℕ → GamePosition Unit Unit
| 0 => cePos0
| n + 1 => ceNext (cePlay n)
CSLibExt/Logics/Modal/MuCalculusGame.lean:416
def cePos0 : GamePosition Unit Unit :=
⟨.mu (.nu (.var 1)), Unit.unit, []⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:396
Uses 4 · Used by 1
TheoremThe regression play is a play#✓fully proved
For every \(n \in \mathbb{N}\), in the model-checking game on the one-world regression model there is a move from the position at step \(n\) of the regression play to the position at step \(n + 1\).
theorem cePlay_moves (n : ℕ) :
Move counterexampleModel (cePlay n) (cePlay (n + 1))
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def counterexampleModel : KripkeModel Unit Unit where
nonempty_world := ⟨Unit.unit⟩
rel := fun _ _ => True
valuation := fun _ _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:384
def cePlay : ℕ → GamePosition Unit Unit
| 0 => cePos0
| n + 1 => ceNext (cePlay n)
CSLibExt/Logics/Modal/MuCalculusGame.lean:416
Uses 11
TheoremPriority of the outer binder in the regression play#✓fully proved
The starting position of the regression play, consisting of the formula \(\mu X.\,\nu Y.\,X\), the unique world and the empty binder stack, has priority \(1\): a \(\mu\)-binder position with \(k\) binders on the stack has priority \(2k + 1\), and here \(k = 0\).
Under fixed priorities (\(\mu \mapsto 1\), \(\nu \mapsto 2\)) the greatest priority recurring on this play would be \(2\) (even, Verifier wins); with priorities increasing with nesting depth (the inner \(\nu\) here has priority \(4\)) and the least-priority rule, the least binder priority recurring on this play is \(1\) (odd, Refuter wins).
theorem ce_prio0 : prio (cePos0 : GamePosition Unit Unit) = some 1
def prio : GamePosition Atom World → Option ℕ
| ⟨.mu _, _, st⟩ => some (2 * st.length + 1)
| ⟨.nu _, _, st⟩ => some (2 * st.length + 2)
| _ => none
CSLibExt/Logics/Modal/MuCalculusGame.lean:168
def cePos0 : GamePosition Unit Unit :=
⟨.mu (.nu (.var 1)), Unit.unit, []⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:396
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Uses 2 · Used by 1
TheoremPriority of the inner binder in the regression play#✓fully proved
The second position of the regression play, consisting of the formula \(\nu Y.\,X\), the unique world and the binder stack \([\mu X.\,\nu Y.\,X]\), has priority \(4\): a \(\nu\)-binder position with \(k\) binders on the stack has priority \(2k + 2\), and here \(k = 1\).
theorem ce_prio1 : prio (cePos1 : GamePosition Unit Unit) = some 4
def prio : GamePosition Atom World → Option ℕ
| ⟨.mu _, _, st⟩ => some (2 * st.length + 1)
| ⟨.nu _, _, st⟩ => some (2 * st.length + 2)
| _ => none
CSLibExt/Logics/Modal/MuCalculusGame.lean:168
def cePos1 : GamePosition Unit Unit :=
⟨.nu (.var 1), Unit.unit, [.mu (.nu (.var 1))]⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:399
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
Uses 2 · Used by 1
TheoremVerifier loses the infinite play of \(\mu X.\, \nu Y.\, X\)#✓fully proved
Consider the infinite sequence of positions of the model-checking game for \(\mu X.\, \nu Y.\, X\) (with one-element types of worlds and atoms) that starts at this formula with empty binder stack and repeats three steps: unfold \(\mu X\), unfold \(\nu Y\), and follow the variable \(X\) back to the formula with empty stack. This play does not satisfy the parity condition: it is not the case that the least binder priority occurring infinitely often is even.
theorem counterexample_parityWin_false : ¬ ParityWin cePlay
def ParityWin (play : ℕ → GamePosition Atom World) : Prop :=
∃ e, Even e ∧ (∀ N, ∃ n, N ≤ n ∧ prio (play n) = some e) ∧
∀ e', e' < e → ∃ N, ∀ n, N ≤ n → prio (play n) ≠ some e'
CSLibExt/Logics/Modal/MuCalculusGame.lean:204
def cePlay : ℕ → GamePosition Unit Unit
| 0 => cePos0
| n + 1 => ceNext (cePlay n)
CSLibExt/Logics/Modal/MuCalculusGame.lean:416
Uses 11
Theorem\(\mu X.\, \nu Y.\, X\) is false in the one-world model#✓fully proved
In the Kripke model with a single world, which is related to itself, and a single atom, which is false there, under the environment that assigns the empty set to every variable, the formula \(\mu X.\, \nu Y.\, X\) is not satisfied at the unique world.
This agrees with the model-checking game, where Verifier loses the play of this formula.
theorem counterexample_sat_false :
¬ sat counterexampleModel (fun _ => fun _ => False)
counterexampleFormula Unit.unit
def sat (env : ℕ → World → Prop) : MuFormula Atom → (World → Prop)
| .atom a => fun w => M.valuation w a
| .natom a => fun w => ¬ M.valuation w a
| .var n => env n
| .bot => fun _ => False
| .top => fun _ => True
| .and φ ψ => fun w => sat env φ w ∧ sat env ψ w
| .or φ ψ => fun w => sat env φ w ∨ sat env ψ w
| .box φ => fun w => ∀ v, M.rel w v → sat env φ v
| .dia φ => fun w => ∃ v, M.rel w v ∧ sat env φ v
| .mu φ => fun w => ∀ S : World → Prop,
(∀ v, sat (extendEnv env S) φ v → S v) → S w
⋯
CSLibExt/Logics/Modal/MuCalculus.lean:124
def counterexampleModel : KripkeModel Unit Unit where
nonempty_world := ⟨Unit.unit⟩
rel := fun _ _ => True
valuation := fun _ _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:384
def counterexampleFormula : MuFormula Unit := .mu (.nu (.var 1))
CSLibExt/Logics/Modal/MuCalculusGame.lean:393
The fixpoint-free fragment
InductiveFixpoint-free formulas#✓fully proved
The fixpoint-free formulas over a type of atoms are built from atoms \(p\), negated atoms \(\neg p\), \(\bot\) and \(\top\) by conjunction \(\varphi \land \psi\), disjunction \(\varphi \lor \psi\), necessity \(\Box\varphi\) and possibility \(\Diamond\varphi\).
These are the formulas of basic modal logic in negation normal form: the μ-calculus formulas with no fixpoint operators and no variables.
Cslib.Modal.MuCalculus.Game.FixFreeFormula · 17 lines
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
| or : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Necessity. -/
| box : FixFreeFormula Atom → FixFreeFormula Atom
/-- Possibility. -/
| dia : FixFreeFormula Atom → FixFreeFormula Atom
Used by 45
DefinitionEmbedding of the fixpoint-free fragment into the μ-calculus#✓fully proved
The map from fixpoint-free formulas to μ-calculus formulas defined by recursion: atoms, negated atoms, \(\bot\) and \(\top\) go to the same atom, negated atom, \(\bot\) and \(\top\), and \(\varphi \wedge \psi\), \(\varphi \vee \psi\), \(\Box \varphi\) and \(\Diamond \varphi\) go to the conjunction, disjunction, box and diamond of the images of \(\varphi\) and \(\psi\).
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
Uses 2 · Used by 36
DefinitionBackward-induction winning region of the fixpoint-free fragment#✓fully proved
Let \(M\) be a Kripke model with accessibility relation \(R\). For a fixpoint-free formula \(\varphi\) and a world \(w\), "\(\varphi\) is winning at \(w\)" is defined by recursion on \(\varphi\): an atom \(a\) is winning at \(w\) iff \(a\) is true at \(w\) in \(M\); a negated atom \(\lnot a\) iff \(a\) is not true at \(w\); \(\bot\) is never winning and \(\top\) is always winning; \(\varphi \land \psi\) is winning at \(w\) iff both \(\varphi\) and \(\psi\) are; \(\varphi \lor \psi\) iff \(\varphi\) or \(\psi\) is; \(\Box \varphi\) iff \(\varphi\) is winning at every \(v\) with \(w \mathrel{R} v\); and \(\Diamond \varphi\) iff \(\varphi\) is winning at some \(v\) with \(w \mathrel{R} v\).
Verifier has a winning strategy in the model-checking game from the position \((\varphi, w, [])\) with empty stack exactly when \(\varphi\) is winning at \(w\).
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
Uses 2 · Used by 12
TheoremBackward-induction winning equals satisfaction on the fixpoint-free fragment#✓fully proved
For every Kripke model \(M\), environment \(\mathit{env}\), fixpoint-free formula \(\varphi\) and world \(w\), \(w\) lies in the backward-induction winning region of \(\varphi\) if and only if \(w\) satisfies the μ-calculus embedding of \(\varphi\) in \(M\) under \(\mathit{env}\).
theorem wins_iff_sat (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(φ : FixFreeFormula Atom) (w : World) :
Wins M φ w ↔ sat M env (FixFreeFormula.toMu φ) w
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
def sat (env : ℕ → World → Prop) : MuFormula Atom → (World → Prop)
| .atom a => fun w => M.valuation w a
| .natom a => fun w => ¬ M.valuation w a
| .var n => env n
| .bot => fun _ => False
| .top => fun _ => True
| .and φ ψ => fun w => sat env φ w ∧ sat env ψ w
| .or φ ψ => fun w => sat env φ w ∨ sat env ψ w
| .box φ => fun w => ∀ v, M.rel w v → sat env φ v
| .dia φ => fun w => ∃ v, M.rel w v ∧ sat env φ v
| .mu φ => fun w => ∀ S : World → Prop,
(∀ v, sat (extendEnv env S) φ v → S v) → S w
⋯
CSLibExt/Logics/Modal/MuCalculus.lean:124
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
The Wins-guided strategy
DefinitionSize of a μ-calculus formula#✓fully proved
The size \(|\varphi|\) of a μ-calculus formula \(\varphi\) is the number of nodes of its syntax tree: an atom, a negated atom, a variable, \(\bot\) and \(\top\) have size \(1\); \(|\varphi \wedge \psi| = |\varphi \vee \psi| = |\varphi| + |\psi| + 1\); and \(|\Box\varphi| = |\Diamond\varphi| = |\mu\varphi| = |\nu\varphi| = |\varphi| + 1\).
def MuFormula.size : MuFormula Atom → ℕ
| .atom _ | .natom _ | .var _ | .bot | .top => 1
| .and φ ψ | .or φ ψ => MuFormula.size φ + MuFormula.size ψ + 1
| .box φ | .dia φ | .mu φ | .nu φ => MuFormula.size φ + 1
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
Uses 1 · Used by 5
DefinitionPartial inverse of the fixpoint-free embedding#✓fully proved
The partial map from μ-calculus formulas to fixpoint-free formulas defined by recursion: an atom, a negated atom, \(\bot\) and \(\top\) are sent to the same formula; a conjunction or disjunction is sent to the conjunction or disjunction of the values at its two parts, and \(\Box\psi\), \(\Diamond\psi\) to the box or diamond of the value at \(\psi\), whenever those values are defined; the map is undefined at variables and at least and greatest fixpoints, and at every formula with a part where it is undefined.
It inverts the embedding of fixpoint-free formulas into μ-calculus formulas on its image.
def toMuInv : MuFormula Atom → Option (FixFreeFormula Atom)
| .atom a => some (.atom a)
| .natom a => some (.natom a)
| .bot => some .bot
| .top => some .top
| .and φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.and φ')
| .or φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.or φ')
| .box φ => (toMuInv φ).map FixFreeFormula.box
| .dia φ => (toMuInv φ).map FixFreeFormula.dia
| _ => none
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
Uses 2 · Used by 9
TheoremThe partial inverse recovers fixpoint-free formulas#✓fully proved
For every fixpoint-free formula \(\varphi\), the partial inverse of the embedding of fixpoint-free formulas into μ-calculus formulas is defined at the image of \(\varphi\) under the embedding, with value \(\varphi\).
theorem toMuInv_toMu (φ : FixFreeFormula Atom) :
toMuInv (FixFreeFormula.toMu φ) = some φ
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def toMuInv : MuFormula Atom → Option (FixFreeFormula Atom)
| .atom a => some (.atom a)
| .natom a => some (.natom a)
| .bot => some .bot
| .top => some .top
| .and φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.and φ')
| .or φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.or φ')
| .box φ => (toMuInv φ).map FixFreeFormula.box
| .dia φ => (toMuInv φ).map FixFreeFormula.dia
| _ => none
CSLibExt/Logics/Modal/MuCalculusGame.lean:593
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Uses 4 · Used by 4
TheoremThe embedding inverts the partial inverse#✓fully proved
For every μ-calculus formula \(\psi\) and every fixpoint-free formula \(\varphi\): if the partial inverse of the embedding of fixpoint-free formulas into μ-calculus formulas is defined at \(\psi\) with value \(\varphi\), then the embedding sends \(\varphi\) to \(\psi\).
theorem toMu_toMuInv {φ : FixFreeFormula Atom} {ψ : MuFormula Atom}
(h : toMuInv ψ = some φ) : FixFreeFormula.toMu φ = ψ
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
def toMuInv : MuFormula Atom → Option (FixFreeFormula Atom)
| .atom a => some (.atom a)
| .natom a => some (.natom a)
| .bot => some .bot
| .top => some .top
| .and φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.and φ')
| .or φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.or φ')
| .box φ => (toMuInv φ).map FixFreeFormula.box
| .dia φ => (toMuInv φ).map FixFreeFormula.dia
| _ => none
CSLibExt/Logics/Modal/MuCalculusGame.lean:593
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Uses 4 · Used by 1
TheoremThe fixpoint-free embedding is injective#✓fully proved
The embedding of fixpoint-free formulas into μ-calculus formulas is injective: distinct fixpoint-free formulas have distinct images.
This is what lets the canonical fragment game recover a fragment formula from an embedded game position.
theorem FixFreeFormula.toMu_injective :
Function.Injective (FixFreeFormula.toMu (Atom := Atom))
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Uses 5 · Used by 1
DefinitionWins-guided move#✓fully proved
Let \(M\) be a Kripke model, and identify each fixpoint-free formula with its embedding into the μ-calculus. For a μ-calculus formula \(\psi\), a world \(w\) and a stack \(s\) of fixpoint binders, the Wins-guided move at the game position \((\psi, w, s)\) is the following position. If \(s\) is empty and \(\psi\) is a fixpoint-free disjunction \(\psi_1 \lor \psi_2\), it is \((\psi_1, w, [])\) when \(\psi_1\) is winning at \(w\) (in the backward-induction winning region of the fixpoint-free fragment) and \((\psi_2, w, [])\) otherwise. If \(s\) is empty and \(\psi\) is a fixpoint-free formula \(\Diamond \psi_1\), it is \((\psi_1, v, [])\) for a chosen successor \(v\) of \(w\) at which \(\psi_1\) is winning, if one exists; otherwise \((\psi_1, v, [])\) for a chosen successor \(v\) of \(w\), if one exists; otherwise \((\psi, w, [])\). In every other case: at a disjunction \(\varphi_1 \lor \varphi_2\) it is \((\varphi_1, w, s)\); at \(\Diamond \varphi_1\) it is \((\varphi_1, v, s)\) for a chosen successor \(v\) of \(w\) if one exists, and \((\psi, w, s)\) otherwise; at \(\nu \varphi_1\) it is \((\varphi_1, w, s')\), where \(s'\) is \(s\) with \(\nu \varphi_1\) pushed on top; and at every remaining formula (the positions owned by Refuter) it is \((\psi, w, s)\).
Only the left disjunct is tested: if a fixpoint-free disjunction is winning at \(w\) and its left disjunct is not, then its right disjunct is.
Cslib.Modal.MuCalculus.Game.winsMove · 29 lines
noncomputable def winsMove (M : KripkeModel World Atom) (ψ : MuFormula Atom) (w : World)
(st : List (MuFormula Atom)) : GamePosition Atom World :=
match ψ, st with
| .or φ₁ φ₂, [] =>
match toMuInv (.or φ₁ φ₂) with
| some (.or ψ₁ ψ₂) =>
if _ : Wins M ψ₁ w then
(⟨FixFreeFormula.toMu ψ₁, w, []⟩ : GamePosition Atom World)
else (⟨FixFreeFormula.toMu ψ₂, w, []⟩ : GamePosition Atom World)
| _ => (⟨φ₁, w, []⟩ : GamePosition Atom World)
| .dia φ₁, [] =>
match toMuInv (.dia φ₁) with
| some (.dia ψ₁) =>
if h : ∃ v, M.rel w v ∧ Wins M ψ₁ v then
(⟨FixFreeFormula.toMu ψ₁, Classical.choose h, []⟩ : GamePosition Atom World)
else if hsucc : ∃ v, M.rel w v then
(⟨φ₁, Classical.choose hsucc, []⟩ : GamePosition Atom World)
else (⟨.dia φ₁, w, []⟩ : GamePosition Atom World)
| _ =>
if h : ∃ v, M.rel w v then
(⟨φ₁, Classical.choose h, []⟩ : GamePosition Atom World)
else (⟨.dia φ₁, w, []⟩ : GamePosition Atom World)
| .or φ₁ _, st => (⟨φ₁, w, st⟩ : GamePosition Atom World)
| .dia φ₁, st =>
if h : ∃ v, M.rel w v then
(⟨φ₁, Classical.choose h, st⟩ : GamePosition Atom World)
else (⟨.dia φ₁, w, st⟩ : GamePosition Atom World)
| .nu φ₁, st => (⟨φ₁, w, .nu φ₁ :: st⟩ : GamePosition Atom World)
| _, _ => (⟨ψ, w, st⟩ : GamePosition Atom World)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
def toMuInv : MuFormula Atom → Option (FixFreeFormula Atom)
| .atom a => some (.atom a)
| .natom a => some (.natom a)
| .bot => some .bot
| .top => some .top
| .and φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.and φ')
| .or φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.or φ')
| .box φ => (toMuInv φ).map FixFreeFormula.box
| .dia φ => (toMuInv φ).map FixFreeFormula.dia
| _ => none
CSLibExt/Logics/Modal/MuCalculusGame.lean:593
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
Uses 7 · Used by 5
TheoremThe Wins-guided move at a disjunction#✓fully proved
Let \(M\) be a Kripke model, \(\varphi_1\) and \(\varphi_2\) fixpoint-free formulas and \(w\) a world in the backward-induction winning region of \(\varphi_1 \vee \varphi_2\). Then for some \(i \in \{1, 2\}\), \(w\) lies in the backward-induction winning region of \(\varphi_i\) and the Wins-guided move at the position made of the embedding of \(\varphi_1 \vee \varphi_2\), the world \(w\) and the empty binder stack is the position made of the embedding of \(\varphi_i\), the world \(w\) and the empty stack.
theorem winsMove_or {M : KripkeModel World Atom} {φ₁ φ₂ : FixFreeFormula Atom} {w : World}
(hW : Wins M (.or φ₁ φ₂) w) :
(winsMove M (FixFreeFormula.toMu (.or φ₁ φ₂)) w [] =
⟨FixFreeFormula.toMu φ₁, w, []⟩ ∧ Wins M φ₁ w) ∨
(winsMove M (FixFreeFormula.toMu (.or φ₁ φ₂)) w [] =
⟨FixFreeFormula.toMu φ₂, w, []⟩ ∧ Wins M φ₂ w)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
noncomputable def winsMove (M : KripkeModel World Atom) (ψ : MuFormula Atom) (w : World)
(st : List (MuFormula Atom)) : GamePosition Atom World :=
match ψ, st with
| .or φ₁ φ₂, [] =>
match toMuInv (.or φ₁ φ₂) with
| some (.or ψ₁ ψ₂) =>
if _ : Wins M ψ₁ w then
(⟨FixFreeFormula.toMu ψ₁, w, []⟩ : GamePosition Atom World)
else (⟨FixFreeFormula.toMu ψ₂, w, []⟩ : GamePosition Atom World)
| _ => (⟨φ₁, w, []⟩ : GamePosition Atom World)
| .dia φ₁, [] =>
match toMuInv (.dia φ₁) with
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:704
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Uses 9 · Used by 1
TheoremThe Wins-guided move at a diamond#✓fully proved
Let \(M\) be a Kripke model, \(\varphi\) a fixpoint-free formula and \(w\) a world in the backward-induction winning region of \(\Diamond \varphi\). Then there is a successor \(v\) of \(w\) in \(M\) lying in the backward-induction winning region of \(\varphi\) such that the Wins-guided move at the position made of the embedding of \(\Diamond \varphi\), the world \(w\) and the empty binder stack is the position made of the embedding of \(\varphi\), the world \(v\) and the empty stack.
theorem winsMove_dia {M : KripkeModel World Atom} {φ₁ : FixFreeFormula Atom} {w : World}
(hW : Wins M (.dia φ₁) w) :
∃ v, winsMove M (FixFreeFormula.toMu (.dia φ₁)) w [] =
⟨FixFreeFormula.toMu φ₁, v, []⟩ ∧ M.rel w v ∧ Wins M φ₁ v
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
noncomputable def winsMove (M : KripkeModel World Atom) (ψ : MuFormula Atom) (w : World)
(st : List (MuFormula Atom)) : GamePosition Atom World :=
match ψ, st with
| .or φ₁ φ₂, [] =>
match toMuInv (.or φ₁ φ₂) with
| some (.or ψ₁ ψ₂) =>
if _ : Wins M ψ₁ w then
(⟨FixFreeFormula.toMu ψ₁, w, []⟩ : GamePosition Atom World)
else (⟨FixFreeFormula.toMu ψ₂, w, []⟩ : GamePosition Atom World)
| _ => (⟨φ₁, w, []⟩ : GamePosition Atom World)
| .dia φ₁, [] =>
match toMuInv (.dia φ₁) with
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:704
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Uses 9 · Used by 1
TheoremThe Wins-guided move is legal#✓fully proved
For a Kripke model \(M\) and a game position \(p\) owned by Verifier from which some move exists, the Wins-guided move at \(p\) is a legal move of the model-checking game on \(M\) from \(p\).
theorem winsMove_isMove (M : KripkeModel World Atom) (p : GamePosition Atom World)
(hOwn : Owner p = true) (hExists : ∃ q, Move M p q) :
Move M p (winsMove M p.1 p.2.1 p.2.2)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
noncomputable def winsMove (M : KripkeModel World Atom) (ψ : MuFormula Atom) (w : World)
(st : List (MuFormula Atom)) : GamePosition Atom World :=
match ψ, st with
| .or φ₁ φ₂, [] =>
match toMuInv (.or φ₁ φ₂) with
| some (.or ψ₁ ψ₂) =>
if _ : Wins M ψ₁ w then
(⟨FixFreeFormula.toMu ψ₁, w, []⟩ : GamePosition Atom World)
else (⟨FixFreeFormula.toMu ψ₂, w, []⟩ : GamePosition Atom World)
| _ => (⟨φ₁, w, []⟩ : GamePosition Atom World)
| .dia φ₁, [] =>
match toMuInv (.dia φ₁) with
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:704
Uses 12 · Used by 1
DefinitionWins-guided strategy#✓fully proved
For a Kripke model \(M\), the Wins-guided strategy is the Verifier strategy of the model-checking game on \(M\) that chooses, at each game position \((\psi, w, s)\), the Wins-guided move at \((\psi, w, s)\). At every Verifier-owned position that has a move, this choice is a legal move.
noncomputable def winsStrategy (M : KripkeModel World Atom) : Strategy M where
choose p := winsMove M p.1 p.2.1 p.2.2
choose_move p hOwn hExists := winsMove_isMove M p hOwn hExists
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
choose : GamePosition Atom World → GamePosition Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:215
noncomputable def winsMove (M : KripkeModel World Atom) (ψ : MuFormula Atom) (w : World)
(st : List (MuFormula Atom)) : GamePosition Atom World :=
match ψ, st with
| .or φ₁ φ₂, [] =>
match toMuInv (.or φ₁ φ₂) with
| some (.or ψ₁ ψ₂) =>
if _ : Wins M ψ₁ w then
(⟨FixFreeFormula.toMu ψ₁, w, []⟩ : GamePosition Atom World)
else (⟨FixFreeFormula.toMu ψ₂, w, []⟩ : GamePosition Atom World)
| _ => (⟨φ₁, w, []⟩ : GamePosition Atom World)
| .dia φ₁, [] =>
match toMuInv (.dia φ₁) with
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:704
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:217
theorem winsMove_isMove (M : KripkeModel World Atom) (p : GamePosition Atom World)
(hOwn : Owner p = true) (hExists : ∃ q, Move M p q) :
Move M p (winsMove M p.1 p.2.1 p.2.2)
CSLibExt/Logics/Modal/MuCalculusGame.lean:769
Uses 9 · Used by 3
Play lemmas
TheoremFinite plays are nonempty#✓fully proved
Let \(M\) be a Kripke model, \(\sigma\) a Verifier strategy and \(p\) a game position. Every finite play from \(p\) consistent with \(\sigma\) is a nonempty list of positions.
theorem PlayFrom.ne_nil {M : KripkeModel World Atom} {σ : Strategy M}
{p : GamePosition Atom World} {ps : List (GamePosition Atom World)}
(h : PlayFrom M σ p ps) : ps ≠ []
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive PlayFrom (M : KripkeModel World Atom) (σ : Strategy M) :
GamePosition Atom World → List (GamePosition Atom World) → Prop
/-- The trivial play. -/
| single {p : GamePosition Atom World} : PlayFrom M σ p [p]
/-- A move followed by a play from the successor. -/
| cons {p q : GamePosition Atom World} {ps : List (GamePosition Atom World)}
(h : Move M p q) (hσ : Owner p = true → q = σ.choose p) (hps : PlayFrom M σ q ps) :
PlayFrom M σ p (p :: ps)
CSLibExt/Logics/Modal/MuCalculusGame.lean:221
Uses 7 · Used by 2
TheoremPrepending to a nonempty play keeps the last position#✓fully proved
For a game position \(p\) and a nonempty list \(ps\) of game positions, the list obtained by prepending \(p\) to \(ps\) has the same last position as \(ps\).
theorem playLast_cons {p : GamePosition Atom World} {ps : List (GamePosition Atom World)}
(hne : ps ≠ []) : playLast (p :: ps) = playLast ps
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
def playLast (ps : List (GamePosition Atom World)) : Option (GamePosition Atom World) :=
ps.getLast?
CSLibExt/Logics/Modal/MuCalculusGame.lean:231
TheoremFragment moves decrease the formula size#✓fully proved
Let \(M\) be a Kripke model, \(\varphi\) a fixpoint-free formula and \(w\) a world. Every move of the model-checking game in \(M\) from the position \((\varphi, w, [\,])\), with \(\varphi\) embedded in the μ-calculus and the empty stack, leads to a position \((\varphi', w', [\,])\) for some fixpoint-free formula \(\varphi'\) and world \(w'\), and the size of \(\varphi'\) is strictly smaller than the size of \(\varphi\) (sizes of the embedded μ-calculus formulas).
theorem move_of_toMu {M : KripkeModel World Atom} {φ : FixFreeFormula Atom} {w : World}
{q : GamePosition Atom World} (h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩ q) :
∃ φ' : FixFreeFormula Atom, ∃ w' : World, q = ⟨FixFreeFormula.toMu φ', w', []⟩ ∧
MuFormula.size (FixFreeFormula.toMu φ') < MuFormula.size (FixFreeFormula.toMu φ)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def MuFormula.size : MuFormula Atom → ℕ
| .atom _ | .natom _ | .var _ | .bot | .top => 1
| .and φ ψ | .or φ ψ => MuFormula.size φ + MuFormula.size ψ + 1
| .box φ | .dia φ | .mu φ | .nu φ => MuFormula.size φ + 1
CSLibExt/Logics/Modal/MuCalculusGame.lean:587
TheoremNo infinite play from a fragment position#✓fully proved
Let \(M\) be a Kripke model, \(\varphi\) a fixpoint-free formula and \(w\) a world. There is no sequence of game positions \(p_0, p_1, p_2, \dots\) with \(p_0 = (\varphi, w, [\,])\) (the embedded formula with the empty stack) such that each step from \(p_n\) to \(p_{n+1}\) is a move of the model-checking game in \(M\). The reason is that every move strictly decreases the formula size.
theorem no_infinite_play_of_fixFree {M : KripkeModel World Atom} {φ : FixFreeFormula Atom}
{w : World} {play : ℕ → GamePosition Atom World}
(h0 : play 0 = ⟨FixFreeFormula.toMu φ, w, []⟩)
(hsteps : ∀ n, Move M (play n) (play (n + 1))) : False
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
TheoremWinning strategies stay winning along consistent moves#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment and \(\sigma\) a Verifier strategy for the model-checking game on \(M\). If \(\sigma\) wins from a position \(p\) in \(\mathit{env}\), and \(q\) is a position reachable from \(p\) by one move that is the position chosen by \(\sigma\) at \(p\) whenever Verifier owns \(p\), then \(\sigma\) also wins from \(q\) in \(\mathit{env}\).
theorem strategyWins_of_move {M : KripkeModel World Atom} {env : ℕ → World → Prop}
{σ : Strategy M} {p q : GamePosition Atom World} (hW : StrategyWins M env σ p)
(hmove : Move M p q) (hσ : Owner p = true → q = σ.choose p) :
StrategyWins M env σ q
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
def StrategyWins (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(σ : Strategy M) (p : GamePosition Atom World) : Prop :=
(∀ ps : List (GamePosition Atom World), PlayFrom M σ p ps →
(∃ q, playLast ps = some q ∧ NoMoves M q) →
∃ q, playLast ps = some q ∧ TerminalWin M env q) ∧
(∀ play : ℕ → GamePosition Atom World, play 0 = p →
(∀ n, Move M (play n) (play (n + 1)) ∧
(Owner (play n) = true → play (n + 1) = σ.choose (play n))) →
ParityWin play)
CSLibExt/Logics/Modal/MuCalculusGame.lean:237
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
Uses 15 · Used by 1
TheoremWins-guided strategy wins finite plays (auxiliary induction)#✓fully proved
The Wins-guided strategy wins every complete finite play from a winning fragment position.
theorem winsStrategy_wins_finite_aux (M : KripkeModel World Atom)
{env : ℕ → World → Prop} {p : GamePosition Atom World}
{ps : List (GamePosition Atom World)}
(hplay : PlayFrom M (winsStrategy M) p ps) :
(∀ (φ : FixFreeFormula Atom) (w : World), p = ⟨FixFreeFormula.toMu φ, w, []⟩ →
Wins M φ w → (∃ q, playLast ps = some q ∧ NoMoves M q) →
∃ q, playLast ps = some q ∧ TerminalWin M env q)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive PlayFrom (M : KripkeModel World Atom) (σ : Strategy M) :
GamePosition Atom World → List (GamePosition Atom World) → Prop
/-- The trivial play. -/
| single {p : GamePosition Atom World} : PlayFrom M σ p [p]
/-- A move followed by a play from the successor. -/
| cons {p q : GamePosition Atom World} {ps : List (GamePosition Atom World)}
(h : Move M p q) (hσ : Owner p = true → q = σ.choose p) (hps : PlayFrom M σ q ps) :
PlayFrom M σ p (p :: ps)
CSLibExt/Logics/Modal/MuCalculusGame.lean:221
noncomputable def winsStrategy (M : KripkeModel World Atom) : Strategy M where
choose p := winsMove M p.1 p.2.1 p.2.2
choose_move p hOwn hExists := winsMove_isMove M p hOwn hExists
CSLibExt/Logics/Modal/MuCalculusGame.lean:855
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
def playLast (ps : List (GamePosition Atom World)) : Option (GamePosition Atom World) :=
ps.getLast?
CSLibExt/Logics/Modal/MuCalculusGame.lean:231
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
CSLibExt/Logics/Modal/MuCalculusGame.lean:174
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
Uses 20 · Used by 1
TheoremWins-guided strategy wins every complete finite play#✓fully proved
The Wins-guided strategy wins every complete finite play from a winning fragment position.
theorem winsStrategy_wins_finite (M : KripkeModel World Atom)
{env : ℕ → World → Prop} :
∀ (φ : FixFreeFormula Atom) (w : World), Wins M φ w →
∀ ps : List (GamePosition Atom World),
PlayFrom M (winsStrategy M) ⟨FixFreeFormula.toMu φ, w, []⟩ ps →
(∃ q, playLast ps = some q ∧ NoMoves M q) →
∃ q, playLast ps = some q ∧ TerminalWin M env q
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive PlayFrom (M : KripkeModel World Atom) (σ : Strategy M) :
GamePosition Atom World → List (GamePosition Atom World) → Prop
/-- The trivial play. -/
| single {p : GamePosition Atom World} : PlayFrom M σ p [p]
/-- A move followed by a play from the successor. -/
| cons {p q : GamePosition Atom World} {ps : List (GamePosition Atom World)}
(h : Move M p q) (hσ : Owner p = true → q = σ.choose p) (hps : PlayFrom M σ q ps) :
PlayFrom M σ p (p :: ps)
CSLibExt/Logics/Modal/MuCalculusGame.lean:221
noncomputable def winsStrategy (M : KripkeModel World Atom) : Strategy M where
choose p := winsMove M p.1 p.2.1 p.2.2
choose_move p hOwn hExists := winsMove_isMove M p hOwn hExists
CSLibExt/Logics/Modal/MuCalculusGame.lean:855
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def playLast (ps : List (GamePosition Atom World)) : Option (GamePosition Atom World) :=
ps.getLast?
CSLibExt/Logics/Modal/MuCalculusGame.lean:231
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
CSLibExt/Logics/Modal/MuCalculusGame.lean:174
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
Uses 12 · Used by 1
TheoremGame-vs-satisfaction, strategy direction#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment assigning a set of worlds to each variable index, \(\varphi\) a fixpoint-free formula and \(w\) a world in the backward-induction winning region of \(\varphi\). Then Verifier has a winning strategy, in environment \(\mathit{env}\), in the model-checking game on \(M\) from the position made of the μ-calculus embedding of \(\varphi\), the world \(w\) and the empty binder stack.
theorem wins_implies_verifierWins (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (φ : FixFreeFormula Atom)
(w : World) (hW : Wins M φ w) :
VerifierWins M env ⟨FixFreeFormula.toMu φ, w, []⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
def VerifierWins (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(p : GamePosition Atom World) : Prop :=
∃ σ : Strategy M, StrategyWins M env σ p
CSLibExt/Logics/Modal/MuCalculusGame.lean:248
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
Uses 20 · Used by 2
TheoremInversion for disjunction moves#✓fully proved
Let \(M\) be a Kripke model, \(\varphi\) and \(\psi\) μ-calculus formulas, \(w\) a world and \(s\) a stack of fixpoint binders. If going from the game position \((\varphi \vee \psi, w, s)\) to a position \(q\) is a move of the model-checking game in \(M\), then \(q\) is \((\varphi, w, s)\) or \((\psi, w, s)\): the world and the stack are unchanged.
theorem Move.or_cases {M : KripkeModel World Atom} {φ ψ : MuFormula Atom} {w : World}
{st : List (MuFormula Atom)} {q : GamePosition Atom World}
(h : Move M ⟨.or φ ψ, w, st⟩ q) : q = ⟨φ, w, st⟩ ∨ q = ⟨ψ, w, st⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
TheoremMoves from a diamond position#✓fully proved
In the model-checking game on a Kripke model \(M\), every move from the position with formula \(\Diamond\varphi\), world \(w\) and binder stack \(s\) goes to the position with formula \(\varphi\), world \(v\) and the same stack \(s\), for some world \(v\) accessible from \(w\) in \(M\).
theorem Move.dia_cases {M : KripkeModel World Atom} {φ : MuFormula Atom} {w : World}
{st : List (MuFormula Atom)} {q : GamePosition Atom World}
(h : Move M ⟨.dia φ, w, st⟩ q) :
∃ v, M.rel w v ∧ q = ⟨φ, v, st⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive MuFormula (Atom : Type u) : Type u where
| atom : Atom → MuFormula Atom
| natom : Atom → MuFormula Atom
| var : ℕ → MuFormula Atom
| bot : MuFormula Atom
| top : MuFormula Atom
| and : MuFormula Atom → MuFormula Atom → MuFormula Atom
| or : MuFormula Atom → MuFormula Atom → MuFormula Atom
| box : MuFormula Atom → MuFormula Atom
| dia : MuFormula Atom → MuFormula Atom
| mu : MuFormula Atom → MuFormula Atom
| nu : MuFormula Atom → MuFormula Atom
CSLibExt/Logics/Modal/MuCalculus.lean:55
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
TheoremGame-vs-satisfaction, converse direction#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment assigning a set of worlds to each variable index, \(\varphi\) a fixpoint-free formula and \(w\) a world. If Verifier has a winning strategy, in environment \(\mathit{env}\), in the model-checking game on \(M\) from the position made of the μ-calculus embedding of \(\varphi\), the world \(w\) and the empty binder stack, then \(w\) lies in the backward-induction winning region of \(\varphi\).
theorem verifierWins_implies_wins (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (φ : FixFreeFormula Atom)
(w : World) (hW : VerifierWins M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
Wins M φ w
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def VerifierWins (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(p : GamePosition Atom World) : Prop :=
∃ σ : Strategy M, StrategyWins M env σ p
CSLibExt/Logics/Modal/MuCalculusGame.lean:248
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
Uses 20 · Used by 1
TheoremBackward-induction winning equals game winning on the fixpoint-free fragment#✓fully proved
For every Kripke model \(M\), environment \(\mathit{env}\), fixpoint-free formula \(\varphi\) and world \(w\), \(w\) lies in the backward-induction winning region of \(\varphi\) if and only if Verifier has a winning strategy, in environment \(\mathit{env}\), in the model-checking game on \(M\) from the position made of the μ-calculus embedding of \(\varphi\), the world \(w\) and the empty binder stack.
theorem wins_iff_verifierWins (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (φ : FixFreeFormula Atom) (w : World) :
Wins M φ w ↔ VerifierWins M env ⟨FixFreeFormula.toMu φ, w, []⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
def VerifierWins (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(p : GamePosition Atom World) : Prop :=
∃ σ : Strategy M, StrategyWins M env σ p
CSLibExt/Logics/Modal/MuCalculusGame.lean:248
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
The fragment game as a canonical parity game
InductivePositions of the totalized fragment game#✓fully proved
A position of the totalized fragment game, over a type of atoms and a type of worlds, is either an embedded position \((\varphi, w)\) of a fixpoint-free formula \(\varphi\) and a world \(w\), standing for the model-checking game position \((\varphi, w, [])\) with \(\varphi\) embedded as a μ-calculus formula and the empty fixpoint stack, or one of two absorbing states: the winning state, where Verifier has won, and the losing state, where Refuter has won.
Since the arena contains no fixpoint positions and every move between embedded positions strictly decreases the formula, priority \(0\) on embedded positions is sound. An embedded position with no moves leads to the winning state if it is a terminal win for Verifier and to the losing state otherwise, and both absorbing states loop to themselves, so the game has no dead ends and is a parity game.
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
Uses 1 · Used by 34
DefinitionProjection of game positions onto the fragment arena#✓fully proved
A game position with empty binder stack whose formula is the μ-calculus reading of a fixpoint-free formula \(\varphi\), at world \(w\), is sent to the embedded position \((\varphi, w)\). Every other game position (one whose formula contains a fixpoint operator or a variable, or one with a nonempty stack) is sent to the losing state.
The losing state is a default that is never reached on plays that stay in the arena, since every move from an embedded position lands on an embedded position.
def fragOfGamePos : GamePosition Atom World → FragPos Atom World
| ⟨ψ, w, []⟩ =>
match toMuInv ψ with
| some φ => .pos φ w
| none => .lose
| ⟨_, _, _ :: _⟩ => .lose
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
def toMuInv : MuFormula Atom → Option (FixFreeFormula Atom)
| .atom a => some (.atom a)
| .natom a => some (.natom a)
| .bot => some .bot
| .top => some .top
| .and φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.and φ')
| .or φ ψ => (toMuInv φ).bind fun φ' => (toMuInv ψ).map (FixFreeFormula.or φ')
| .box φ => (toMuInv φ).map FixFreeFormula.box
| .dia φ => (toMuInv φ).map FixFreeFormula.dia
| _ => none
CSLibExt/Logics/Modal/MuCalculusGame.lean:593
Sources
- C. Stirling, Modal and Temporal Properties of Processes, Springer 2001, Chapter 6.
TheoremProjection of an embedded position#✓fully proved
For every fixpoint-free formula \(\varphi\) and world \(w\), projecting the game position with formula \(\varphi\) (read as a μ-calculus formula), world \(w\) and empty binder stack onto the fragment arena gives the embedded position \((\varphi, w)\).
theorem fragOfGamePos_toMu (φ : FixFreeFormula Atom) (w : World) :
fragOfGamePos (⟨FixFreeFormula.toMu φ, w, []⟩ : GamePosition Atom World) =
FragPos.pos φ w
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def fragOfGamePos : GamePosition Atom World → FragPos Atom World
| ⟨ψ, w, []⟩ =>
match toMuInv ψ with
| some φ => .pos φ w
| none => .lose
| ⟨_, _, _ :: _⟩ => .lose
CSLibExt/Logics/Modal/MuCalculusGame.lean:1220
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
Uses 7 · Used by 1
InductiveMoves of the totalized fragment game#✓fully proved
Let \(M\) be a Kripke model and \(e\) an environment, and read each fixpoint-free formula \(\varphi\) as a μ-calculus formula. The totalized fragment game of \(M\) and \(e\) has these moves: from an embedded position \((\varphi, w)\) to \((\varphi', w')\) whenever the model-checking game of \(M\) has a move from \((\varphi, w)\) to \((\varphi', w')\) with empty binder stacks; from \((\varphi, w)\) to the winning state when the game position \((\varphi, w)\) with empty stack has no moves and is won by Verifier in environment \(e\); from \((\varphi, w)\) to the losing state when that game position has no moves and is not won by Verifier; and from each of the winning and losing states to itself.
Cslib.Modal.MuCalculus.Game.FragMove · 21 lines
inductive FragMove (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
FragPos Atom World → FragPos Atom World → Prop
/-- A game move between embedded fragment positions. -/
| pos_move {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
FragMove M env (.pos φ w) (.pos φ' w')
/-- A terminal winning position moves to the absorbing win state. -/
| toWin {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .win
/-- A terminal losing position moves to the absorbing lose state. -/
| toLose {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hLose : ¬ TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .lose
/-- The win state loops. -/
| win_self : FragMove M env .win .win
/-- The lose state loops. -/
| lose_self : FragMove M env .lose .lose
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
CSLibExt/Logics/Modal/MuCalculusGame.lean:174
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
Uses 8 · Used by 15
DefinitionOwners in the totalized fragment game#✓fully proved
In the totalized fragment game, an embedded position \((\varphi, w)\) of a fixpoint-free formula \(\varphi\) at a world \(w\) is owned by the even player if Verifier owns the model-checking game position \((\varphi, w, [])\) (with \(\varphi\) embedded as a μ-calculus formula and the empty fixpoint stack), and by the odd player otherwise, that is, when Refuter owns it. The absorbing winning and losing states are both owned by the even player.
Verifier plays the even player; the moves at the absorbing states are forced, so their owner does not matter.
def fragOwner : FragPos Atom World → Cslib.Games.Player
| .pos φ w =>
if Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true then
Cslib.Games.Player.even
else Cslib.Games.Player.odd
| .win => Cslib.Games.Player.even
| .lose => Cslib.Games.Player.even
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
DefinitionPriorities in the totalized fragment game#✓fully proved
In the totalized fragment game, every embedded position \((\varphi, w)\) of a fixpoint-free formula \(\varphi\) at a world \(w\) has priority \(0\), the absorbing winning state has priority \(0\), and the absorbing losing state has priority \(1\).
So an infinite play that eventually stays at the winning state is won by the even player, and one that eventually stays at the losing state by the odd player. Priority \(0\) on embedded positions is sound because the arena contains no fixpoint positions and every move between embedded positions strictly decreases the formula, so no infinite play visits only embedded positions.
def fragPriority : FragPos Atom World → ℕ
| .pos _ _ => 0
| .win => 0
| .lose => 1
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
DefinitionFragment parity game#✓fully proved
Let \(M\) be a Kripke model and \(\rho\) an environment, and write \((\varphi, w, [])\) for the game position with formula \(\varphi\), world \(w\) and empty binder stack. The fragment game of \(M\) and \(\rho\) is the parity game on the totalized fragment positions defined as follows. An embedded position \((\varphi, w)\) moves to \((\varphi', w')\) when \((\varphi, w, [])\) has a move to \((\varphi', w', [])\) in the model-checking game on \(M\); if \((\varphi, w, [])\) has no moves, \((\varphi, w)\) moves to the winning state when \((\varphi, w, [])\) is a terminal win in \(\rho\) and to the losing state otherwise; the winning and losing states move only to themselves. The even player owns both absorbing states and the embedded positions \((\varphi, w)\) such that Verifier owns \((\varphi, w, [])\); the odd player owns the other embedded positions. Embedded positions and the winning state have priority \(0\); the losing state has priority \(1\).
Cslib.Modal.MuCalculus.Game.fragmentGame · 22 lines
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⟨FixFreeFormula.toMu φ, w, []⟩ ⟨FixFreeFormula.toMu φ', w', []⟩
· obtain ⟨φ', w', hq⟩ := hExists
exact ⟨.pos φ' w', FragMove.pos_move hq⟩
· have hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩ := by
intro q hq
obtain ⟨φ', w', hq', -⟩ := move_of_toMu hq
exact hExists ⟨φ', w', by rwa [hq'] at hq⟩
by_cases hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩
· exact ⟨.win, FragMove.toWin hNo hWin⟩
· exact ⟨.lose, FragMove.toLose hNo hWin⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure ParityGame (Pos : Type*) where
/-- The player choosing the move at each position. -/
owner : Pos → Player
/-- The moves: `Move v w` iff the owner of `v` may move from `v` to `w`. -/
Move : Pos → Pos → Prop
/-- The priority of each position. -/
priority : Pos → ℕ
/-- Every position has a move. -/
serial : ∀ v, ∃ w, Move v w
CSLibExt/Computability/Games/Parity.lean:94
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
def fragOwner : FragPos Atom World → Cslib.Games.Player
| .pos φ w =>
if Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true then
Cslib.Games.Player.even
else Cslib.Games.Player.odd
| .win => Cslib.Games.Player.even
| .lose => Cslib.Games.Player.even
CSLibExt/Logics/Modal/MuCalculusGame.lean:1260
inductive FragMove (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
FragPos Atom World → FragPos Atom World → Prop
/-- A game move between embedded fragment positions. -/
| pos_move {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
FragMove M env (.pos φ w) (.pos φ' w')
/-- A terminal winning position moves to the absorbing win state. -/
| toWin {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .win
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1235
def fragPriority : FragPos Atom World → ℕ
| .pos _ _ => 0
| .win => 0
| .lose => 1
CSLibExt/Logics/Modal/MuCalculusGame.lean:1274
Uses 16 · Used by 11
TheoremThe absorbing win state#✓fully proved
In the totalized fragment game on a Kripke model \(M\) with environment \(\mathit{env}\), every move from the absorbing Verifier-wins state \(\mathrm{win}\) leads back to it: if \(\mathrm{win}\) moves to \(v\), then \(v = \mathrm{win}\).
theorem FragMove.win_eq {M : KripkeModel World Atom} {env : ℕ → World → Prop}
{v : FragPos Atom World} (h : FragMove M env .win v) : v = .win
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
inductive FragMove (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
FragPos Atom World → FragPos Atom World → Prop
/-- A game move between embedded fragment positions. -/
| pos_move {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
FragMove M env (.pos φ w) (.pos φ' w')
/-- A terminal winning position moves to the absorbing win state. -/
| toWin {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .win
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1235
Uses 9 · Used by 1
TheoremThe losing state is absorbing#✓fully proved
In the fragment game of a Kripke model \(M\) and an environment \(\rho\), every move from the losing state goes to the losing state.
theorem FragMove.lose_eq {M : KripkeModel World Atom} {env : ℕ → World → Prop}
{v : FragPos Atom World} (h : FragMove M env .lose v) : v = .lose
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
inductive FragMove (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
FragPos Atom World → FragPos Atom World → Prop
/-- A game move between embedded fragment positions. -/
| pos_move {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
FragMove M env (.pos φ w) (.pos φ' w')
/-- A terminal winning position moves to the absorbing win state. -/
| toWin {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .win
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1235
Uses 9 · Used by 1
TheoremFragment moves between embedded positions are game moves#✓fully proved
Let \(M\) be a Kripke model, \(\mathrm{env}\) an environment, \(\varphi, \varphi'\) fixpoint-free formulas and \(w, w'\) worlds. If the totalized fragment game has a move from the embedded position \((\varphi, w)\) to the embedded position \((\varphi', w')\), then the model-checking game has a move from \((\varphi, w, [])\) to \((\varphi', w', [])\), where the fixpoint-free formulas are viewed as μ-calculus formulas and \([]\) is the empty binder stack.
theorem FragMove.pos_move_iff {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : FragMove M env (.pos φ w) (.pos φ' w')) :
Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive FragMove (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
FragPos Atom World → FragPos Atom World → Prop
/-- A game move between embedded fragment positions. -/
| pos_move {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
FragMove M env (.pos φ w) (.pos φ' w')
/-- A terminal winning position moves to the absorbing win state. -/
| toWin {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .win
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1235
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Uses 9 · Used by 2
TheoremMoves to the winning state come from terminal winning positions#✓fully proved
Let \(M\) be a Kripke model, \(\mathrm{env}\) an environment, \(\varphi\) a fixpoint-free formula and \(w\) a world. If the totalized fragment game has a move from the embedded position \((\varphi, w)\) to the absorbing winning state, then the game position \((\varphi, w, [])\), with \(\varphi\) viewed as a μ-calculus formula and an empty binder stack, has no moves, and Verifier wins there as a terminal position in the environment \(\mathrm{env}\).
theorem FragMove.pos_toWin {M : KripkeModel World Atom} {env : ℕ → World → Prop}
{φ : FixFreeFormula Atom} {w : World}
(h : FragMove M env (.pos φ w) .win) :
NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩ ∧
TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive FragMove (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
FragPos Atom World → FragPos Atom World → Prop
/-- A game move between embedded fragment positions. -/
| pos_move {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
FragMove M env (.pos φ w) (.pos φ' w')
/-- A terminal winning position moves to the absorbing win state. -/
| toWin {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .win
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1235
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
CSLibExt/Logics/Modal/MuCalculusGame.lean:174
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
TheoremMoves to the losing state come from terminal losing positions#✓fully proved
Let \(M\) be a Kripke model, \(\mathrm{env}\) an environment, \(\varphi\) a fixpoint-free formula and \(w\) a world. If the totalized fragment game has a move from the embedded position \((\varphi, w)\) to the absorbing losing state, then the game position \((\varphi, w, [])\), with \(\varphi\) viewed as a μ-calculus formula and an empty binder stack, has no moves, and Verifier does not win there as a terminal position in the environment \(\mathrm{env}\).
theorem FragMove.pos_toLose {M : KripkeModel World Atom} {env : ℕ → World → Prop}
{φ : FixFreeFormula Atom} {w : World}
(h : FragMove M env (.pos φ w) .lose) :
NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩ ∧
¬ TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive FragMove (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
FragPos Atom World → FragPos Atom World → Prop
/-- A game move between embedded fragment positions. -/
| pos_move {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
FragMove M env (.pos φ w) (.pos φ' w')
/-- A terminal winning position moves to the absorbing win state. -/
| toWin {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .win
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1235
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
CSLibExt/Logics/Modal/MuCalculusGame.lean:174
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
Uses 9 · Used by 1
TheoremOwner of an embedded position in the totalized fragment game#✓fully proved
For every fixpoint-free formula \(\varphi\) and world \(w\), the even player owns the embedded position \((\varphi, w)\) of the totalized fragment game if and only if Verifier owns the model-checking game position \((\varphi, w, [])\), with \(\varphi\) embedded as a μ-calculus formula and the empty fixpoint stack.
theorem fragOwner_pos_eq_even {φ : FixFreeFormula Atom} {w : World} :
fragOwner (FragPos.pos φ w : FragPos Atom World) = Cslib.Games.Player.even ↔
Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def fragOwner : FragPos Atom World → Cslib.Games.Player
| .pos φ w =>
if Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true then
Cslib.Games.Player.even
else Cslib.Games.Player.odd
| .win => Cslib.Games.Player.even
| .lose => Cslib.Games.Player.even
CSLibExt/Logics/Modal/MuCalculusGame.lean:1260
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Uses 8 · Used by 2
DefinitionCanonical next move induced by a bespoke strategy#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment and \(\sigma\) a Verifier strategy for the model-checking game on \(M\). Write \(\langle \psi, v \rangle\) for the game position with the embedding of a fixpoint-free formula \(\psi\), the world \(v\) and the empty binder stack. The canonical next move is the map on positions of the fragment arena defined as follows. The absorbing states \(\mathrm{win}\) and \(\mathrm{lose}\) are sent to themselves. A fragment position \((\varphi, w)\) such that \(\langle \varphi, w \rangle\) has a move to some \(\langle \varphi', w' \rangle\) is sent, if Verifier owns \(\langle \varphi, w \rangle\), to the projection into the fragment arena of the position that \(\sigma\) chooses there (an embedded position \(\langle \varphi', w' \rangle\) projects to \((\varphi', w')\), every other game position to \(\mathrm{lose}\)), and otherwise to a fragment position \((\varphi', w')\) chosen, by the axiom of choice, among those with a move from \(\langle \varphi, w \rangle\) to \(\langle \varphi', w' \rangle\). A fragment position \((\varphi, w)\) with no such move is sent to \(\mathrm{win}\) if \(\langle \varphi, w \rangle\) satisfies the terminal winning condition for Verifier in environment \(\mathit{env}\), and to \(\mathrm{lose}\) otherwise.
noncomputable def canonicalNext (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (σ : Strategy M) : FragPos Atom World → FragPos Atom World
| .win => .win
| .lose => .lose
| .pos φ w =>
if hExists : ∃ φ' w', Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩ then
if Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true then
fragOfGamePos (σ.choose ⟨FixFreeFormula.toMu φ, w, []⟩)
else
.pos (Classical.choose hExists)
(Classical.choose (Classical.choose_spec hExists))
else if TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩ then .win else .lose
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
def fragOfGamePos : GamePosition Atom World → FragPos Atom World
| ⟨ψ, w, []⟩ =>
match toMuInv ψ with
| some φ => .pos φ w
| none => .lose
| ⟨_, _, _ :: _⟩ => .lose
CSLibExt/Logics/Modal/MuCalculusGame.lean:1220
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
Uses 12 · Used by 3
TheoremThe canonical move follows the bespoke strategy at Verifier positions with a move#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment and \(\sigma\) a Verifier strategy for the model-checking game on \(M\). Write \(\langle \psi, v \rangle\) for the game position with the embedding of a fixpoint-free formula \(\psi\), the world \(v\) and the empty binder stack. Let \(\varphi\) be a fixpoint-free formula and \(w\) a world such that Verifier owns \(\langle \varphi, w \rangle\) and \(\langle \varphi, w \rangle\) has a move to some \(\langle \varphi'', w'' \rangle\). Then there are a fixpoint-free formula \(\varphi'\) and a world \(w'\) such that the canonical next move induced by \(\sigma\) (in environment \(\mathit{env}\)) sends the fragment position \((\varphi, w)\) to the fragment position \((\varphi', w')\), and \(\sigma\) chooses \(\langle \varphi', w' \rangle\) at \(\langle \varphi, w \rangle\).
theorem canonicalNext_pos_of_owner {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {σ : Strategy M} {φ : FixFreeFormula Atom}
{w : World}
(hOwn : Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true)
(hExists : ∃ φ' w', Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
∃ φ' w', canonicalNext M env σ (.pos φ w) = .pos φ' w' ∧
σ.choose ⟨FixFreeFormula.toMu φ, w, []⟩ = ⟨FixFreeFormula.toMu φ', w', []⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def Owner : GamePosition Atom World → Player
| ⟨.or _ _, _, _⟩ | ⟨.dia _, _, _⟩ | ⟨.nu _, _, _⟩ => true
| _ => false
CSLibExt/Logics/Modal/MuCalculusGame.lean:149
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
noncomputable def canonicalNext (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (σ : Strategy M) : FragPos Atom World → FragPos Atom World
| .win => .win
| .lose => .lose
| .pos φ w =>
if hExists : ∃ φ' w', Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩ then
if Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true then
fragOfGamePos (σ.choose ⟨FixFreeFormula.toMu φ, w, []⟩)
else
.pos (Classical.choose hExists)
(Classical.choose (Classical.choose_spec hExists))
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1360
Uses 16 · Used by 2
DefinitionPositional strategy induced by a bespoke strategy#✓fully proved
The canonical positional strategy induced by a bespoke strategy.
Cslib.Modal.MuCalculus.Game.fragStrategy · 60 lines
noncomputable def fragStrategy (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (σ : Strategy M) :
(fragmentGame M env).PositionalStrategy Cslib.Games.Player.even where
next := canonicalNext M env σ
legal := by
intro v hv
cases v with
| win =>
show FragMove M env .win (canonicalNext M env σ .win)
rw [show canonicalNext M env σ (FragPos.win : FragPos Atom World) = .win from rfl]
exact FragMove.win_self
| lose =>
show FragMove M env .lose (canonicalNext M env σ .lose)
rw [show canonicalNext M env σ (FragPos.lose : FragPos Atom World) = .lose from rfl]
exact FragMove.lose_self
| pos φ w =>
have hOwn : Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true :=
(fragOwner_pos_eq_even).mp hv
show FragMove M env (.pos φ w) (canonicalNext M env σ (.pos φ w))
by_cases hExists : ∃ φ' w', Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩
· obtain ⟨φ', w', hNext, heq⟩ := canonicalNext_pos_of_owner hOwn hExists
obtain ⟨φ₀, w₀, h₀⟩ := hExists
have hChoose : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩ := by
rw [← heq]
exact σ.choose_move _ hOwn ⟨⟨FixFreeFormula.toMu φ₀, w₀, []⟩, h₀⟩
rw [hNext]
exact FragMove.pos_move hChoose
· have hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩ := by
intro q hq
obtain ⟨φ', w', hq', -⟩ := move_of_toMu hq
exact hExists ⟨φ', w', by rwa [hq'] at hq⟩
by_cases hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩
· have hNext : canonicalNext M env σ (.pos φ w) = FragPos.win := by
classical
show (if h : ∃ φ' w', Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩ then
(if Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true then
fragOfGamePos (σ.choose ⟨FixFreeFormula.toMu φ, w, []⟩)
else .pos (Classical.choose h)
(Classical.choose (Classical.choose_spec h)))
else if TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩ then
FragPos.win else FragPos.lose) = FragPos.win
rw [dite_eq_right hExists, ite_eq_left hWin]
rw [hNext]
exact FragMove.toWin hNo hWin
· have hNext : canonicalNext M env σ (.pos φ w) = FragPos.lose := by
classical
show (if h : ∃ φ' w', Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩ then
(if Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true then
fragOfGamePos (σ.choose ⟨FixFreeFormula.toMu φ, w, []⟩)
else .pos (Classical.choose h)
(Classical.choose (Classical.choose_spec h)))
else if TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩ then
FragPos.win else FragPos.lose) = FragPos.lose
rw [dite_eq_right hExists, ite_eq_right hWin]
rw [hNext]
exact FragMove.toLose hNo hWin
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
noncomputable def canonicalNext (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (σ : Strategy M) : FragPos Atom World → FragPos Atom World
| .win => .win
| .lose => .lose
| .pos φ w =>
if hExists : ∃ φ' w', Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩ then
if Owner ⟨FixFreeFormula.toMu φ, w, []⟩ = true then
fragOfGamePos (σ.choose ⟨FixFreeFormula.toMu φ, w, []⟩)
else
.pos (Classical.choose hExists)
(Classical.choose (Classical.choose_spec hExists))
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1360
Uses 24 · Used by 3
DefinitionGame position of a fragment position#✓fully proved
Given a default game position \(p_0\), an embedded fragment position \((\varphi, w)\) is sent to the game position with formula \(\varphi\), world \(w\) and empty binder stack, and the absorbing winning and losing states are both sent to \(p_0\).
The default is never used on plays that stay among embedded positions.
def fragToPos (p0 : GamePosition Atom World) : FragPos Atom World → GamePosition Atom World
| .pos φ w => ⟨FixFreeFormula.toMu φ, w, []⟩
| _ => p0
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
DefinitionSegment of a fragment play as game positions#✓fully proved
Let \(p_0\) be a game position and let \(\pi = \pi_0 \pi_1 \pi_2 \dots\) be an infinite sequence of positions of the totalized fragment game. For natural numbers \(s\) and \(k\), the segment of \(\pi\) from \(s\) of length \(k + 1\) is the list of game positions obtained from \(\pi_s, \pi_{s+1}, \dots, \pi_{s+k}\), in this order, by sending each embedded position \((\varphi, w)\) to the game position with formula \(\varphi\), world \(w\) and empty binder stack, and each of the absorbing winning and losing states to \(p_0\).
def fragSegment (p0 : GamePosition Atom World) (π : ωSequence (FragPos Atom World))
(start : ℕ) : ℕ → List (GamePosition Atom World)
| 0 => [fragToPos p0 (π start)]
| k + 1 => fragToPos p0 (π start) :: fragSegment p0 π (start + 1) k
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
def fragToPos (p0 : GamePosition Atom World) : FragPos Atom World → GamePosition Atom World
| .pos φ w => ⟨FixFreeFormula.toMu φ, w, []⟩
| _ => p0
CSLibExt/Logics/Modal/MuCalculusGame.lean:1466
Uses 3 · Used by 5
TheoremSplitting off the head of a segment#✓fully proved
Let \(p_0\) be a model-checking game position and \(\pi\) an infinite sequence of positions of the totalized fragment game. For each \(i\), let \(\hat\pi_i\) be \(p_0\) if \(\pi_i\) is an absorbing state; if \(\pi_i\) is the embedded position \((\varphi, w)\) of a fixpoint-free formula \(\varphi\) and a world \(w\), let \(\hat\pi_i\) be the game position \((\varphi, w, [])\), with \(\varphi\) embedded as a μ-calculus formula and the empty fixpoint stack. For all natural numbers \(s\) and \(k\), the segment \([\hat\pi_s, \dots, \hat\pi_{s+k+1}]\) of \(\pi\) is the list with head \(\hat\pi_s\) followed by the segment \([\hat\pi_{s+1}, \dots, \hat\pi_{s+k+1}]\).
theorem fragSegment_cons (p0 : GamePosition Atom World)
(π : ωSequence (FragPos Atom World)) (start k : ℕ) :
fragSegment p0 π start (k + 1) =
fragToPos p0 (π start) :: fragSegment p0 π (start + 1) k
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
def fragSegment (p0 : GamePosition Atom World) (π : ωSequence (FragPos Atom World))
(start : ℕ) : ℕ → List (GamePosition Atom World)
| 0 => [fragToPos p0 (π start)]
| k + 1 => fragToPos p0 (π start) :: fragSegment p0 π (start + 1) k
CSLibExt/Logics/Modal/MuCalculusGame.lean:1471
def fragToPos (p0 : GamePosition Atom World) : FragPos Atom World → GamePosition Atom World
| .pos φ w => ⟨FixFreeFormula.toMu φ, w, []⟩
| _ => p0
CSLibExt/Logics/Modal/MuCalculusGame.lean:1466
Uses 4 · Used by 2
TheoremSegments of canonical plays through fragment positions are bespoke plays#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment and \(\sigma\) a Verifier strategy for the model-checking game on \(M\). Write \(\langle \psi, v \rangle\) for the game position with the embedding of a fixpoint-free formula \(\psi\), the world \(v\) and the empty binder stack. Let \(\pi\) be a play of the fragment game of \(M\) and \(\mathit{env}\) that conforms to the canonical positional strategy induced by \(\sigma\), and let \(s, k \in \mathbb{N}\). Suppose every \(\pi_i\) with \(s \le i \le s + k\) is a fragment position \((\varphi_i, w_i)\), not \(\mathrm{win}\) or \(\mathrm{lose}\). Then the list \(\langle \varphi_s, w_s \rangle, \langle \varphi_{s+1}, w_{s+1} \rangle, \dots, \langle \varphi_{s+k}, w_{s+k} \rangle\) is a finite play from \(\langle \varphi_s, w_s \rangle\) consistent with \(\sigma\): each position has a game move to the next, and at Verifier-owned positions the next position is the one \(\sigma\) chooses.
theorem canonical_playFrom_segment {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {σ : Strategy M} {π : ωSequence (FragPos Atom World)}
(p0 : GamePosition Atom World) (start k : ℕ)
(φ : FixFreeFormula Atom) (w : World)
(hplay : (fragmentGame M env).IsPlay π)
(hconf : Cslib.Games.ParityGame.Conforms (fragStrategy M env σ) π)
(hstart : π start = .pos φ w)
(hpos : ∀ i, start ≤ i → i ≤ start + k → ∃ φ' w', π i = .pos φ' w') :
PlayFrom M σ ⟨FixFreeFormula.toMu φ, w, []⟩ (fragSegment p0 π start k)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
def Conforms {p : Player} (σ : G.PositionalStrategy p) (π : ωSequence Pos) : Prop :=
∀ i, G.owner (π i) = p → π (i + 1) = σ.next (π i)
CSLibExt/Computability/Games/Parity.lean:131
noncomputable def fragStrategy (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (σ : Strategy M) :
(fragmentGame M env).PositionalStrategy Cslib.Games.Player.even where
next := canonicalNext M env σ
legal := by
intro v hv
cases v with
| win =>
show FragMove M env .win (canonicalNext M env σ .win)
rw [show canonicalNext M env σ (FragPos.win : FragPos Atom World) = .win from rfl]
exact FragMove.win_self
| lose =>
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1403
inductive PlayFrom (M : KripkeModel World Atom) (σ : Strategy M) :
GamePosition Atom World → List (GamePosition Atom World) → Prop
/-- The trivial play. -/
| single {p : GamePosition Atom World} : PlayFrom M σ p [p]
/-- A move followed by a play from the successor. -/
| cons {p q : GamePosition Atom World} {ps : List (GamePosition Atom World)}
(h : Move M p q) (hσ : Owner p = true → q = σ.choose p) (hps : PlayFrom M σ q ps) :
PlayFrom M σ p (p :: ps)
CSLibExt/Logics/Modal/MuCalculusGame.lean:221
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def fragSegment (p0 : GamePosition Atom World) (π : ωSequence (FragPos Atom World))
(start : ℕ) : ℕ → List (GamePosition Atom World)
| 0 => [fragToPos p0 (π start)]
| k + 1 => fragToPos p0 (π start) :: fragSegment p0 π (start + 1) k
CSLibExt/Logics/Modal/MuCalculusGame.lean:1471
Uses 27 · Used by 1
TheoremPlays of the totalized fragment game stay at the winning state#✓fully proved
Let \(M\) be a Kripke model and \(\mathit{env}\) an environment assigning a set of worlds to each free-variable index. If \(\pi\) is a play of the totalized fragment game of \(M\) and \(\mathit{env}\) and \(\pi_k\) is the absorbing winning state, then \(\pi_n\) is the winning state for every \(n \ge k\).
theorem fragPlay_eq_win_of_le {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {π : ωSequence (FragPos Atom World)} {k n : ℕ}
(hplay : (fragmentGame M env).IsPlay π) (hk : π k = .win) (hn : k ≤ n) :
π n = .win
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
Uses 6 · Used by 1
TheoremPlays of the totalized fragment game stay at the losing state#✓fully proved
Let \(M\) be a Kripke model and \(\mathit{env}\) an environment assigning a set of worlds to each free-variable index. If \(\pi\) is a play of the totalized fragment game of \(M\) and \(\mathit{env}\) and \(\pi_k\) is the absorbing losing state, then \(\pi_n\) is the losing state for every \(n \ge k\).
theorem fragPlay_eq_lose_of_le {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {π : ωSequence (FragPos Atom World)} {k n : ℕ}
(hplay : (fragmentGame M env).IsPlay π) (hk : π k = .lose) (hn : k ≤ n) :
π n = .lose
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
Uses 6
TheoremSequences that stay at the win state are won by the even player#✓fully proved
Let \(M\) be a Kripke model and \(\mathit{env}\) an environment for free variables. If an infinite sequence \(\pi_0 \pi_1 \pi_2 \dots\) of positions of the totalized fragment game of \(M\) and \(\mathit{env}\) has a \(k_0\) such that \(\pi_n\) is the absorbing winning state for all \(n \ge k_0\), then \(\pi\) is won by the even player in that game.
theorem wonBy_even_of_eventually_win {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {π : ωSequence (FragPos Atom World)} {k0 : ℕ}
(hwin : ∀ n, k0 ≤ n → π n = .win) :
(fragmentGame M env).WonBy Cslib.Games.Player.even π
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
Uses 7 · Used by 1
TheoremSequences that stay at the lose state are won by the odd player#✓fully proved
Let \(M\) be a Kripke model and \(\mathit{env}\) an environment for free variables. If an infinite sequence \(\pi_0 \pi_1 \pi_2 \dots\) of positions of the totalized fragment game of \(M\) and \(\mathit{env}\) has a \(k_0\) such that \(\pi_n\) is the absorbing losing state for all \(n \ge k_0\), then \(\pi\) is won by the odd player in that game.
theorem wonBy_odd_of_eventually_lose {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {π : ωSequence (FragPos Atom World)} {k0 : ℕ}
(hlose : ∀ n, k0 ≤ n → π n = .lose) :
(fragmentGame M env).WonBy Cslib.Games.Player.odd π
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
Uses 7 · Used by 1
TheoremSegments are nonempty#✓fully proved
Let \(p_0\) be a model-checking game position and \(\pi\) an infinite sequence of positions of the totalized fragment game. For all natural numbers \(s\) and \(k\), the segment of \(\pi\) from index \(s\) to index \(s + k\), read as a list of model-checking game positions with \(p_0\) standing for the absorbing states, is not the empty list.
theorem fragSegment_ne_nil (p0 : GamePosition Atom World)
(π : ωSequence (FragPos Atom World)) (start k : ℕ) :
fragSegment p0 π start k ≠ []
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
def fragSegment (p0 : GamePosition Atom World) (π : ωSequence (FragPos Atom World))
(start : ℕ) : ℕ → List (GamePosition Atom World)
| 0 => [fragToPos p0 (π start)]
| k + 1 => fragToPos p0 (π start) :: fragSegment p0 π (start + 1) k
CSLibExt/Logics/Modal/MuCalculusGame.lean:1471
Uses 4 · Used by 1
TheoremLast position of a segment#✓fully proved
Let \(p_0\) be a model-checking game position and \(\pi\) an infinite sequence of positions of the totalized fragment game. For each \(i\), let \(\hat\pi_i\) be \(p_0\) if \(\pi_i\) is an absorbing state; if \(\pi_i\) is the embedded position \((\varphi, w)\) of a fixpoint-free formula \(\varphi\) and a world \(w\), let \(\hat\pi_i\) be the game position \((\varphi, w, [])\), with \(\varphi\) embedded as a μ-calculus formula and the empty fixpoint stack. For all natural numbers \(s\) and \(k\), the segment \([\hat\pi_s, \dots, \hat\pi_{s+k}]\) has a last position, and it is \(\hat\pi_{s+k}\).
theorem fragSegment_playLast (p0 : GamePosition Atom World)
(π : ωSequence (FragPos Atom World)) (start k : ℕ) :
playLast (fragSegment p0 π start k) = some (fragToPos p0 (π (start + k)))
abbrev GamePosition (Atom World : Type u) :=
MuFormula Atom × World × List (MuFormula Atom)
CSLibExt/Logics/Modal/MuCalculusGame.lean:108
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
def playLast (ps : List (GamePosition Atom World)) : Option (GamePosition Atom World) :=
ps.getLast?
CSLibExt/Logics/Modal/MuCalculusGame.lean:231
def fragSegment (p0 : GamePosition Atom World) (π : ωSequence (FragPos Atom World))
(start : ℕ) : ℕ → List (GamePosition Atom World)
| 0 => [fragToPos p0 (π start)]
| k + 1 => fragToPos p0 (π start) :: fragSegment p0 π (start + 1) k
CSLibExt/Logics/Modal/MuCalculusGame.lean:1471
def fragToPos (p0 : GamePosition Atom World) : FragPos Atom World → GamePosition Atom World
| .pos φ w => ⟨FixFreeFormula.toMu φ, w, []⟩
| _ => p0
CSLibExt/Logics/Modal/MuCalculusGame.lean:1466
Uses 8 · Used by 1
TheoremWinning Verifier strategies transfer to the fragment game#✓fully proved
Let \(M\) be a Kripke model, \(\rho\) an environment, \(\sigma\) a Verifier strategy of the model-checking game on \(M\), \(\varphi\) a fixpoint-free formula and \(w\) a world. If \(\sigma\) wins in environment \(\rho\) from the game position with formula \(\varphi\), world \(w\) and empty binder stack, then the positional strategy of the even player induced by \(\sigma\) wins from the embedded position \((\varphi, w)\) in the fragment game of \(M\) and \(\rho\).
Every play conforming to the induced strategy reaches the absorbing winning state: it cannot reach the losing state, by the finite-play clause for \(\sigma\) applied to the segment before the first losing state, and it cannot stay among embedded positions forever, since fragment moves strictly decrease the formula.
theorem fragment_bespoke_to_canonical {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {σ : Strategy M} {φ : FixFreeFormula Atom}
{w : World}
(hσ : StrategyWins M env σ ⟨FixFreeFormula.toMu φ, w, []⟩) :
(fragmentGame M env).WinsFrom (fragStrategy M env σ)
(.pos φ w)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
structure Strategy (M : KripkeModel World Atom) where
/-- The chosen successor at a Verifier-owned position. -/
choose : GamePosition Atom World → GamePosition Atom World
/-- The chosen successor is a legal move whenever one exists. -/
choose_move : ∀ p, Owner p = true → (∃ q, Move M p q) → Move M p (choose p)
CSLibExt/Logics/Modal/MuCalculusGame.lean:213
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def StrategyWins (M : KripkeModel World Atom) (env : ℕ → World → Prop)
(σ : Strategy M) (p : GamePosition Atom World) : Prop :=
(∀ ps : List (GamePosition Atom World), PlayFrom M σ p ps →
(∃ q, playLast ps = some q ∧ NoMoves M q) →
∃ q, playLast ps = some q ∧ TerminalWin M env q) ∧
(∀ play : ℕ → GamePosition Atom World, play 0 = p →
(∀ n, Move M (play n) (play (n + 1)) ∧
(Owner (play n) = true → play (n + 1) = σ.choose (play n))) →
ParityWin play)
CSLibExt/Logics/Modal/MuCalculusGame.lean:237
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
noncomputable def fragStrategy (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (σ : Strategy M) :
(fragmentGame M env).PositionalStrategy Cslib.Games.Player.even where
next := canonicalNext M env σ
legal := by
intro v hv
cases v with
| win =>
show FragMove M env .win (canonicalNext M env σ .win)
rw [show canonicalNext M env σ (FragPos.win : FragPos Atom World) = .win from rfl]
exact FragMove.win_self
| lose =>
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1403
Uses 33 · Used by 1
TheoremMoves of the totalized fragment game, by cases#✓fully proved
Let \(M\) be a Kripke model and \(e\) an environment, and read each fixpoint-free formula \(\varphi\) as a μ-calculus formula. Every move from \(a\) to \(b\) in the totalized fragment game of \(M\) and \(e\) is of one of five kinds: \(a\) and \(b\) are embedded positions \((\varphi, w)\) and \((\varphi', w')\) and the model-checking game of \(M\) has a move from \((\varphi, w)\) to \((\varphi', w')\) with empty binder stacks; or \(a = (\varphi, w)\), \(b\) is the winning state, and the game position \((\varphi, w)\) with empty stack has no moves and is won by Verifier in environment \(e\); or \(a = (\varphi, w)\), \(b\) is the losing state, and that game position has no moves and is not won by Verifier; or \(a\) and \(b\) are both the winning state; or \(a\) and \(b\) are both the losing state.
theorem fragMove_cases {M : KripkeModel World Atom} {env : ℕ → World → Prop}
{a b : FragPos Atom World} (h : FragMove M env a b) :
(∃ φ w φ' w', a = .pos φ w ∧ b = .pos φ' w' ∧
Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) ∨
(∃ φ w, a = .pos φ w ∧ b = .win ∧
NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩ ∧
TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) ∨
(∃ φ w, a = .pos φ w ∧ b = .lose ∧
NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩ ∧
¬ TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) ∨
(a = .win ∧ b = .win) ∨ (a = .lose ∧ b = .lose)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
inductive FragMove (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
FragPos Atom World → FragPos Atom World → Prop
/-- A game move between embedded fragment positions. -/
| pos_move {φ φ' : FixFreeFormula Atom} {w w' : World}
(h : Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
FragMove M env (.pos φ w) (.pos φ' w')
/-- A terminal winning position moves to the absorbing win state. -/
| toWin {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hWin : TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
FragMove M env (.pos φ w) .win
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1235
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
CSLibExt/Logics/Modal/MuCalculusGame.lean:174
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
Uses 9 · Used by 2
TheoremVerifier's positional strategies make a game move at Verifier positions that have one#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment, and \(\sigma\) any positional strategy of the even player (Verifier) in the fragment game of \(M\) and \(\mathit{env}\). Write \(\langle \psi, v \rangle\) for the game position with the embedding of a fixpoint-free formula \(\psi\), the world \(v\) and the empty binder stack. Let \(\varphi\) be a fixpoint-free formula and \(w\) a world such that the even player owns the fragment position \((\varphi, w)\) and, in the model-checking game on \(M\), \(\langle \varphi, w \rangle\) has a move to some \(\langle \varphi'', w'' \rangle\). Then \(\sigma\) sends \((\varphi, w)\) to a fragment position \((\varphi', w')\) such that \(\langle \varphi, w \rangle\) has a move to \(\langle \varphi', w' \rangle\); in particular \(\sigma\) does not move to the absorbing state \(\mathrm{win}\) or \(\mathrm{lose}\).
theorem canonical_next_pos {M : KripkeModel World Atom} {env : ℕ → World → Prop}
{σ : (fragmentGame M env).PositionalStrategy Cslib.Games.Player.even}
{φ : FixFreeFormula Atom} {w : World}
(hown : (fragmentGame M env).owner (.pos φ w) = Cslib.Games.Player.even)
(hExists : ∃ φ' w', Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩) :
∃ φ' w', σ.next (.pos φ w) = .pos φ' w' ∧
Move M ⟨FixFreeFormula.toMu φ, w, []⟩
⟨FixFreeFormula.toMu φ', w', []⟩
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive Move (M : KripkeModel World Atom) :
GamePosition Atom World → GamePosition Atom World → Prop
/-- Refuter chooses a conjunct. -/
| andLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Refuter chooses a conjunct. -/
| andRight {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.and φ ψ, w, st⟩ ⟨ψ, w, st⟩
/-- Verifier chooses a disjunct. -/
| orLeft {φ ψ : MuFormula Atom} {w : World} {st : List (MuFormula Atom)} :
Move M ⟨.or φ ψ, w, st⟩ ⟨φ, w, st⟩
/-- Verifier chooses a disjunct. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:116
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
Uses 14 · Used by 1
DefinitionThe lose play#✓fully proved
For a fixpoint-free formula \(\varphi\) and a world \(w\), the lose play is the infinite sequence of positions of the fragment arena that is at the position \((\varphi, w)\) at time \(0\) and at the absorbing losing state at every later time. It is used for terminal losing positions \((\varphi, w)\).
def losePlay (φ : FixFreeFormula Atom) (w : World) :
ωSequence (FragPos Atom World) :=
⟨fun n => if n = 0 then FragPos.pos φ w else FragPos.lose⟩
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
TheoremThe lose play starts at its fragment position#✓fully proved
For a fixpoint-free formula \(\varphi\) and a world \(w\), the lose play from \((\varphi, w)\) is at the fragment-arena position \((\varphi, w)\) at time \(0\).
theorem losePlay_zero (φ : FixFreeFormula Atom) (w : World) :
losePlay φ w 0 = .pos φ w
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def losePlay (φ : FixFreeFormula Atom) (w : World) :
ωSequence (FragPos Atom World) :=
⟨fun n => if n = 0 then FragPos.pos φ w else FragPos.lose⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:1769
Uses 3 · Used by 1
TheoremThe lose play stays at the losing state#✓fully proved
For every fixpoint-free formula \(\varphi\), world \(w\) and natural number \(n\), the lose play from \((\varphi, w)\) is at the losing state at time \(n + 1\).
theorem losePlay_succ (φ : FixFreeFormula Atom) (w : World) (n : ℕ) :
losePlay φ w (n + 1) = .lose
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def losePlay (φ : FixFreeFormula Atom) (w : World) :
ωSequence (FragPos Atom World) :=
⟨fun n => if n = 0 then FragPos.pos φ w else FragPos.lose⟩
CSLibExt/Logics/Modal/MuCalculusGame.lean:1769
Uses 3 · Used by 1
TheoremTerminal losing positions are not won by the even player#✓fully proved
Let \(M\) be a Kripke model, \(\mathit{env}\) an environment assigning a set of worlds to each free-variable index, \(\varphi\) a fixpoint-free formula and \(w\) a world. If the model-checking game position \((\varphi, w, [])\), with \(\varphi\) embedded as a μ-calculus formula and the empty fixpoint stack, has no moves in \(M\) and is not a terminal win for Verifier in \(M\) under \(\mathit{env}\), then the embedded position \((\varphi, w)\) of the totalized fragment game of \(M\) and \(\mathit{env}\) is not in the winning region of the even player.
The play that moves from \((\varphi, w)\) to the losing state and stays there conforms to every strategy of the even player and is won by the odd player.
theorem fragPos_not_mem_winningRegion_of_terminal_lose {M : KripkeModel World Atom}
{env : ℕ → World → Prop} {φ : FixFreeFormula Atom} {w : World}
(hNo : NoMoves M ⟨FixFreeFormula.toMu φ, w, []⟩)
(hLose : ¬ TerminalWin M env ⟨FixFreeFormula.toMu φ, w, []⟩) :
(.pos φ w : FragPos Atom World) ∉
(fragmentGame M env).WinningRegion Cslib.Games.Player.even
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def NoMoves (M : KripkeModel World Atom) (p : GamePosition Atom World) : Prop :=
∀ q, ¬ Move M p q
CSLibExt/Logics/Modal/MuCalculusGame.lean:174
def toMu : FixFreeFormula Atom → MuFormula Atom
| .atom a => .atom a
| .natom a => .natom a
| .bot => .bot
| .top => .top
| .and φ ψ => .and (toMu φ) (toMu ψ)
| .or φ ψ => .or (toMu φ) (toMu ψ)
| .box φ => .box (toMu φ)
| .dia φ => .dia (toMu φ)
CSLibExt/Logics/Modal/MuCalculusGame.lean:536
def TerminalWin (M : KripkeModel World Atom) (env : ℕ → World → Prop) :
GamePosition Atom World → Prop
| ⟨.atom a, w, _⟩ => M.valuation w a
| ⟨.natom a, w, _⟩ => ¬ M.valuation w a
| ⟨.var n, w, st⟩ => if n < st.length then False else env (n - st.length) w
| ⟨.top, _, _⟩ => True
| ⟨.bot, _, _⟩ => False
| ⟨.box _, _, _⟩ => True
| ⟨.dia _, _, _⟩ => False
| _ => False
CSLibExt/Logics/Modal/MuCalculusGame.lean:186
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
Uses 25 · Used by 1
TheoremThe fragment game's winning region is contained in Wins#✓fully proved
Let \(M\) be a Kripke model, \(\rho\) an environment, \(\varphi\) a fixpoint-free formula and \(w\) a world. If the embedded position \((\varphi, w)\) lies in the winning region of the even player in the fragment game of \(M\) and \(\rho\), then the backward-induction winning condition \(\mathrm{Wins}_M(\varphi, w)\) holds.
The proof is by induction on \(\varphi\), using that the winning region is closed under the opponent's moves and under the moves of a winning strategy, so no strategy composition is needed.
theorem fragment_canonical_to_wins (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (φ : FixFreeFormula Atom) (w : World)
(h : (.pos φ w : FragPos Atom World) ∈
(fragmentGame M env).WinningRegion Cslib.Games.Player.even) :
Wins M φ w
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
Uses 24 · Used by 1
TheoremWins is the winning region of the fragment game#✓fully proved
Let \(M\) be a Kripke model, \(\rho\) an environment, \(\varphi\) a fixpoint-free formula and \(w\) a world. Then the backward-induction winning condition \(\mathrm{Wins}_M(\varphi, w)\) holds if and only if the embedded position \((\varphi, w)\) lies in the winning region of the even player in the fragment game of \(M\) and \(\rho\).
theorem fragmentWins_iff_winningRegion (M : KripkeModel World Atom)
(env : ℕ → World → Prop) (φ : FixFreeFormula Atom) (w : World) :
Wins M φ w ↔ (.pos φ w : FragPos Atom World) ∈
(fragmentGame M env).WinningRegion Cslib.Games.Player.even
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive FixFreeFormula (Atom : Type u) : Type u where
/-- An atom. -/
| atom : Atom → FixFreeFormula Atom
/-- A negated atom. -/
| natom : Atom → FixFreeFormula Atom
/-- Falsity. -/
| bot : FixFreeFormula Atom
/-- Truth. -/
| top : FixFreeFormula Atom
/-- Conjunction. -/
| and : FixFreeFormula Atom → FixFreeFormula Atom → FixFreeFormula Atom
/-- Disjunction. -/
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:515
def Wins (M : KripkeModel World Atom) : FixFreeFormula Atom → World → Prop
| .atom a, w => M.valuation w a
| .natom a, w => ¬ M.valuation w a
| .bot, _ => False
| .top, _ => True
| .and φ ψ, w => Wins M φ w ∧ Wins M ψ w
| .or φ ψ, w => Wins M φ w ∨ Wins M ψ w
| .box φ, w => ∀ v, M.rel w v → Wins M φ v
| .dia φ, w => ∃ v, M.rel w v ∧ Wins M φ v
CSLibExt/Logics/Modal/MuCalculusGame.lean:550
inductive FragPos (Atom World : Type u) where
/-- An embedded fragment position `(φ, w)`, standing for `⟨toMu φ, w, []⟩`. -/
| pos : FixFreeFormula Atom → World → FragPos Atom World
/-- Absorbing Verifier-wins state. -/
| win : FragPos Atom World
/-- Absorbing Refuter-wins state. -/
| lose : FragPos Atom World
CSLibExt/Logics/Modal/MuCalculusGame.lean:1205
noncomputable def fragmentGame (M : KripkeModel World Atom)
(env : ℕ → World → Prop) : Cslib.Games.ParityGame (FragPos Atom World) where
owner := fragOwner
Move := FragMove M env
priority := fragPriority
serial := by
intro v
cases v with
| win => exact ⟨.win, FragMove.win_self⟩
| lose => exact ⟨.lose, FragMove.lose_self⟩
| pos φ w =>
by_cases hExists : ∃ φ' w', Move M
⋯
CSLibExt/Logics/Modal/MuCalculusGame.lean:1280
inductive Player where
/-- The player who wins plays whose maximal recurring priority is even. -/
| even
/-- The player who wins plays whose maximal recurring priority is odd. -/
| odd
deriving DecidableEq, Repr
CSLibExt/Computability/Games/Parity.lean:56
Uses 18
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.