Documentation

FormaleSystemeInLean.Exercise2

This file contains the formalisation of exercise 2.3 c and d which deals with simulations between NFAs. The exercise sheet is available at https://iccl.inf.tu-dresden.de/w/images/2/28/FS2025-Blatt-02.pdf.

structure NFASimulation {Sigma : Type u} {Q1 : Type u1} {Q2 : Type u2} [Fintype Q1] [Fintype Q2] [Fintype Sigma] (nfa1 : NFA Q1 Sigma) (nfa2 : NFA Q2 Sigma) :
Type (max u1 u2)
Instances For
    theorem part_a {Sigma : Type u} {Q1 : Type u1} {Q2 : Type u2} [Fintype Q1] [Fintype Q2] [Fintype Sigma] {nfa1 : NFA Q1 Sigma} {nfa2 : NFA Q2 Sigma} (sim : NFASimulation nfa1 nfa2) :

    If there is a simulation between nfa1 and nfa2 then the language of nfa1 is a subset of the language of nfa2.

    How about the other direction - does language inclusion also imply a simulation between the NFAs recognising the languages? We can show that this is not true by giving a counterexample. In order to define NFAs we first need Fintypes for Q and Sigma. We cannot just use strings because there are infinitely many of those. Instead we use a subtype of String defined by a list of strings (statesList and sigma).

    Equations
    Instances For
      Equations
      Instances For
        def Q :
        Equations
        Instances For
          def :
          Equations
          Instances For
            def 𝓜 :

            Finally we can define the NFA 𝓜.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              For our counterexample we will use 𝓜 and its powerset DFA 𝓜'. Their languages are equal but there is not simulation between 𝓜 and 𝓜'. Simulations are defined for NFAs so we convert 𝓜' back into an NFA 𝓜''.