Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3.9, p. 15:16 — M_Φ outputs exactly the regular violation set (¬Φ)^(D̄,τ̄,i) whenever it executes line 9, and reaches every time point

Proved
MFOTLMon.Monitor.theorem_3_9

by mikedeng1 · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

automatic-structurescorrectnessmonitoringp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1runtime-verificationtemporal-logic

Let (Dˉ,τˉ)(\bar{\mathcal D},\bar\tau)(Dˉ,τˉ) be a temporal structure with domain N\mathbb NN, natural-number time stamps that are monotone and make progress, whose structures Di\mathcal D_iDi​ are automatic with respect to one fixed constant domain representation (L,ν)(\mathcal L,\nu)(L,ν) of N\mathbb NN, and which has a binary predicate ≺\prec≺ interpreted as <<< (the restrictions of §3.1). Let Φ\PhiΦ be a bounded MFOTL formula in which every temporal subformula occurs once and the two direct subformulas of every SI\mathsf S_ISI​ and UI\mathsf U_IUI​ subformula have the same free variables. Then the monitoring algorithm MΦ\mathsf M_\PhiMΦ​ of Fig. 2 has the following properties.

  1. Whenever MΦ\mathsf M_\PhiMΦ​ executes line 9 with counter value iii, the output set OOO and time stamp satisfy
O=(¬Φ)(Dˉ,τˉ,i),O is regular,the time stamp output is τi.O=(\neg\Phi)^{(\bar{\mathcal D},\bar\tau,i)},\qquad O\text{ is regular},\qquad\text{the time stamp output is }\tau_i.O=(¬Φ)(Dˉ,τˉ,i),O is regular,the time stamp output is τi​.
  1. For each n∈Nn\in\mathbb Nn∈N, MΦ\mathsf M_\PhiMΦ​ eventually sets the counter iii to nnn.

So the monitor reports, for every time point and with no omission, exactly the tuples violating Φ\PhiΦ, i.e. the violations of □Φ\square\Phi□Φ, as regular sets over the fixed representation.

Formalization Note. The monitor is the state machine run D Φ k (state on entering the (k+1)(k+1)(k+1)st iteration); its output log holds every (i,O,τi)(i,O,\tau_i)(i,O,τi​) emitted by line 9 during the first kkk iterations, so "whenever line 9 is executed" ranges over all entries of all logs. The monitor computes only from its store and never consults the semantics. Part (2) records the line-11 increment to n>0n>0n>0 by the preceding output at index n−1n-1n−1; n=0n=0n=0 is the initial value (line 2). A single iteration can advance the counter several times, so loop-entry values alone would omit intermediate values. "Effectively computable" in part (1) is a claim about automata constructions and is not formalized. The two conditions on Φ\PhiΦ besides boundedness are the paper's "without loss of generality" assumptions (§3.4, §3.6). The repaired until construction (R1, R2) is used.

Preamble
import Mathlib
import Definitions.Def_MFOTLMon_Monitor_Algorithm
Formal statement
namespace MFOTLMon.Monitor

/-- Theorem 3.9 (p. 15:16). Let `(D̄, τ̄)` be a temporal structure with domain `ℕ` whose structures are
automatic with the common domain representation `rep` and interpret a binary `≺ ∈ R` as `<`, and let
`Φ` be bounded (each temporal subformula occurring once; the direct subformulas of each `S_I`, `U_I`
having the same free variables). The monitor `M_Φ` (Fig. 2) satisfies:
(i) whenever it executes line 9, the output set is regular and equal to `(¬Φ)^{(D̄,τ̄,i)}` (and the
output time stamp is `τᵢ`);
(ii) for each `n ∈ ℕ`, `M_Φ` eventually sets the counter `i` to `n`. For `n > 0`, the
line-11 increment is recorded by the output at index `n - 1`; `n = 0` is the initial value. -/
theorem theorem_3_9 {S : Signature} {Γ : Type} [Fintype Γ] (rep : DomainRep Γ)
    (D : TempStruct S) (hD : IsAutomatic rep D) (hlt : HasOrderPred D) (Φ : Formula S)
    (hΦ : Bounded Φ) (huniq : TemporalSubformulasOnce Φ) (hfree : DirectFreeAligned Φ) :
    (∀ (k n : ℕ) (O : Set (List ℕ)) (t : ℕ), (n, O, t) ∈ (run D Φ k).out →
        O = satSet D (Formula.neg Φ) n ∧ RegularRel rep (freeList Φ).length O ∧ t = D.τ n) ∧
    (∀ n : ℕ, n = 0 ∨ ∃ (k : ℕ) (O : Set (List ℕ)) (t : ℕ),
      (n - 1, O, t) ∈ (run D Φ k).out) := by sorry

end MFOTLMon.Monitor
Source
Basin, Klaedtke, Müller, Zălinescu, Monitoring metric first-order temporal properties, J. ACM 62(2), Article 15 (2015), p. 15:16, Theorem 3.9 and Fig. 2 (p. 15:15)
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 8, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me