Documentation

Mathlib.Computability.TuringMachine

Turing machines #

The files PostTuringMachine.lean and TuringMachine.lean define a sequence of simple machine languages, starting with Turing machines and working up to more complex languages based on Wang B-machines.

PostTuringMachine.lean covers the TM0 model and TM1 model; TuringMachine.lean adds the TM2 model.

Naming conventions #

Each model of computation in this file shares a naming convention for the elements of a model of computation. These are the parameters for the language:

All of these variables denote "essentially finite" types, but for technical reasons it is convenient to allow them to be infinite anyway. When using an infinite type, we will be interested to prove that only finitely many values of the type are ever interacted with.

Given these parameters, there are a few common structures for the model that arise:

The TM2 model #

The TM2 model removes the tape entirely from the TM1 model, replacing it with an arbitrary (finite) collection of stacks, each with elements of different types (the alphabet of stack k : K is Γ k). The statements are:

The configuration is a tuple (l, var, stk) where l : Option Λ is the current label to run or none for the halting state, var : σ is the (finite) internal state, and stk : ∀ k, List (Γ k) is the collection of stacks. (Note that unlike the TM0 and TM1 models, these are not ListBlanks, they have definite ends that can be detected by the pop command.)

Given a designated stack k and a value L : List (Γ k), the initial configuration has all the stacks empty except the designated "input" stack; in eval this designated stack also functions as the output stack.

inductive Turing.TM2.Stmt {K : Type u_1} (Γ : KType u_2) (Λ : Type u_3) (σ : Type u_4) :
Type (max (max (max u_1 u_2) u_3) u_4)

The TM2 model removes the tape entirely from the TM1 model, replacing it with an arbitrary (finite) collection of stacks. The operation push puts an element on one of the stacks, and pop removes an element from a stack (and modifying the internal state based on the result). peek modifies the internal state but does not remove an element.

Instances For
    instance Turing.TM2.Stmt.inhabited {K : Type u_1} (Γ : KType u_2) (Λ : Type u_3) (σ : Type u_4) :
    Inhabited (Stmt Γ Λ σ)
    Equations
    structure Turing.TM2.Cfg {K : Type u_1} (Γ : KType u_2) (Λ : Type u_3) (σ : Type u_4) :
    Type (max (max (max u_1 u_2) u_3) u_4)

    A configuration in the TM2 model is a label (or none for the halt state), the state of local variables, and the stacks. (Note that the stacks are not ListBlanks, they have a definite size.)

    • l : Option Λ

      The current label to run (or none for the halting state)

    • var : σ

      The internal state

    • stk (k : K) : List (Γ k)

      The (finite) collection of internal stacks

    Instances For
      instance Turing.TM2.Cfg.inhabited {K : Type u_1} (Γ : KType u_2) (Λ : Type u_3) (σ : Type u_4) [Inhabited σ] :
      Inhabited (Cfg Γ Λ σ)
      Equations
      def Turing.TM2.stepAux {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] :
      Stmt Γ Λ σσ((k : K) → List (Γ k))Cfg Γ Λ σ

      The step function for the TM2 model.

      Equations
      Instances For
        def Turing.TM2.step {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛStmt Γ Λ σ) :
        Cfg Γ Λ σOption (Cfg Γ Λ σ)

        The step function for the TM2 model.

        Equations
        Instances For
          def Turing.TM2.Reaches {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛStmt Γ Λ σ) :
          Cfg Γ Λ σCfg Γ Λ σProp

          The (reflexive) reachability relation for the TM2 model.

          Equations
          Instances For
            theorem Turing.TM2.stmts₁_self {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} {q : Stmt Γ Λ σ} :
            theorem Turing.TM2.stmts₁_trans {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} {q₁ q₂ : Stmt Γ Λ σ} :
            q₁ stmts₁ q₂stmts₁ q₁ stmts₁ q₂
            theorem Turing.TM2.stmts₁_supportsStmt_mono {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} {S : Finset Λ} {q₁ q₂ : Stmt Γ Λ σ} (h : q₁ stmts₁ q₂) (hs : SupportsStmt S q₂) :
            noncomputable def Turing.TM2.stmts {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} (M : ΛStmt Γ Λ σ) (S : Finset Λ) :
            Finset (Option (Stmt Γ Λ σ))

            The set of statements accessible from initial set S of labels.

            Equations
            Instances For
              theorem Turing.TM2.stmts_trans {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} {M : ΛStmt Γ Λ σ} {S : Finset Λ} {q₁ q₂ : Stmt Γ Λ σ} (h₁ : q₁ stmts₁ q₂) :
              some q₂ stmts M Ssome q₁ stmts M S
              def Turing.TM2.Supports {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [Inhabited Λ] (M : ΛStmt Γ Λ σ) (S : Finset Λ) :

              Given a TM2 machine M and a set S of states, Supports M S means that all states in S jump only to other states in S.

              Equations
              Instances For
                theorem Turing.TM2.stmts_supportsStmt {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [Inhabited Λ] {M : ΛStmt Γ Λ σ} {S : Finset Λ} {q : Stmt Γ Λ σ} (ss : Supports M S) :
                some q stmts M SSupportsStmt S q
                theorem Turing.TM2.step_supports {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [Inhabited Λ] [DecidableEq K] (M : ΛStmt Γ Λ σ) {S : Finset Λ} (ss : Supports M S) {c c' : Cfg Γ Λ σ} :
                def Turing.TM2.init {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [Inhabited Λ] [DecidableEq K] [Inhabited σ] (k : K) (L : List (Γ k)) :
                Cfg Γ Λ σ

                The initial state of the TM2 model. The input is provided on a designated stack.

                Equations
                Instances For
                  def Turing.TM2.eval {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [Inhabited Λ] [DecidableEq K] [Inhabited σ] (M : ΛStmt Γ Λ σ) (k : K) (L : List (Γ k)) :
                  Part (List (Γ k))

                  Evaluates a TM2 program to completion, with the output on the same stack as the input.

                  Equations
                  Instances For

                    TM2 emulator in TM1 #

                    To prove that TM2 computable functions are TM1 computable, we need to reduce each TM2 program to a TM1 program. So suppose a TM2 program is given. This program has to maintain a whole collection of stacks, but we have only one tape, so we must "multiplex" them all together. Pictorially, if stack 1 contains [a, b] and stack 2 contains [c, d, e, f] then the tape looks like this:

                     bottom:  ... | _ | T | _ | _ | _ | _ | ...
                     stack 1: ... | _ | b | a | _ | _ | _ | ...
                     stack 2: ... | _ | f | e | d | c | _ | ...
                    

                    where a tape element is a vertical slice through the diagram. Here the alphabet is Γ' := Bool × ∀ k, Option (Γ k), where:

                    In "resting" position, the TM is sitting at the position marked bottom. For non-stack actions, it operates in place, but for the stack actions push, peek, and pop, it must shuttle to the end of the appropriate stack, make its changes, and then return to the bottom. So the states are:

                    Because of the shuttling, emulation overhead is O(n), where n is the current maximum of the length of all stacks. Therefore a program that takes k steps to run in TM2 takes O((m+k)k) steps to run when emulated in TM1, where m is the length of the input.

                    theorem Turing.TM2to1.stk_nth_val {K : Type u_1} {Γ : KType u_2} {L : ListBlank ((k : K) → Option (Γ k))} {k : K} {S : List (Γ k)} (n : ) (hL : ListBlank.map (proj k) L = ListBlank.mk (List.map some S).reverse) :
                    L.nth n k = S.reverse[n]?
                    def Turing.TM2to1.Γ' (K : Type u_1) (Γ : KType u_2) :
                    Type (max u_1 u_2)

                    The alphabet of the TM2 simulator on TM1 is a marker for the stack bottom, plus a vector of stack elements for each stack, or none if the stack does not extend this far.

                    Equations
                    Instances For
                      instance Turing.TM2to1.Γ'.inhabited {K : Type u_1} {Γ : KType u_2} :
                      Inhabited (Γ' K Γ)
                      Equations
                      instance Turing.TM2to1.Γ'.fintype {K : Type u_1} {Γ : KType u_2} [DecidableEq K] [Fintype K] [(k : K) → Fintype (Γ k)] :
                      Fintype (Γ' K Γ)
                      Equations
                      def Turing.TM2to1.addBottom {K : Type u_1} {Γ : KType u_2} (L : ListBlank ((k : K) → Option (Γ k))) :
                      ListBlank (Γ' K Γ)

                      The bottom marker is fixed throughout the calculation, so we use the addBottom function to express the program state in terms of a tape with only the stacks themselves.

                      Equations
                      Instances For
                        theorem Turing.TM2to1.addBottom_map {K : Type u_1} {Γ : KType u_2} (L : ListBlank ((k : K) → Option (Γ k))) :
                        ListBlank.map { f := Prod.snd, map_pt' := } (addBottom L) = L
                        theorem Turing.TM2to1.addBottom_modifyNth {K : Type u_1} {Γ : KType u_2} (f : ((k : K) → Option (Γ k))(k : K) → Option (Γ k)) (L : ListBlank ((k : K) → Option (Γ k))) (n : ) :
                        ListBlank.modifyNth (fun (a : Bool × ((k : K) → Option (Γ k))) => (a.1, f a.2)) n (addBottom L) = addBottom (ListBlank.modifyNth f n L)
                        theorem Turing.TM2to1.addBottom_nth_snd {K : Type u_1} {Γ : KType u_2} (L : ListBlank ((k : K) → Option (Γ k))) (n : ) :
                        ((addBottom L).nth n).2 = L.nth n
                        theorem Turing.TM2to1.addBottom_nth_succ_fst {K : Type u_1} {Γ : KType u_2} (L : ListBlank ((k : K) → Option (Γ k))) (n : ) :
                        ((addBottom L).nth (n + 1)).1 = false
                        theorem Turing.TM2to1.addBottom_head_fst {K : Type u_1} {Γ : KType u_2} (L : ListBlank ((k : K) → Option (Γ k))) :
                        inductive Turing.TM2to1.StAct (K : Type u_1) (Γ : KType u_2) (σ : Type u_4) (k : K) :
                        Type (max u_2 u_4)

                        A stack action is a command that interacts with the top of a stack. Our default position is at the bottom of all the stacks, so we have to hold on to this action while going to the end to modify the stack.

                        • push {K : Type u_1} {Γ : KType u_2} {σ : Type u_4} {k : K} : (σΓ k)StAct K Γ σ k
                        • peek {K : Type u_1} {Γ : KType u_2} {σ : Type u_4} {k : K} : (σOption (Γ k)σ)StAct K Γ σ k
                        • pop {K : Type u_1} {Γ : KType u_2} {σ : Type u_4} {k : K} : (σOption (Γ k)σ)StAct K Γ σ k
                        Instances For
                          instance Turing.TM2to1.StAct.inhabited {K : Type u_1} {Γ : KType u_2} {σ : Type u_4} {k : K} :
                          Inhabited (StAct K Γ σ k)
                          Equations
                          def Turing.TM2to1.stRun {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} {k : K} :
                          StAct K Γ σ kTM2.Stmt Γ Λ σTM2.Stmt Γ Λ σ

                          The TM2 statement corresponding to a stack action.

                          Equations
                          Instances For
                            def Turing.TM2to1.stVar {K : Type u_1} {Γ : KType u_2} {σ : Type u_4} {k : K} (v : σ) (l : List (Γ k)) :
                            StAct K Γ σ kσ

                            The effect of a stack action on the local variables, given the value of the stack.

                            Equations
                            Instances For
                              def Turing.TM2to1.stWrite {K : Type u_1} {Γ : KType u_2} {σ : Type u_4} {k : K} (v : σ) (l : List (Γ k)) :
                              StAct K Γ σ kList (Γ k)

                              The effect of a stack action on the stack.

                              Equations
                              Instances For
                                def Turing.TM2to1.stmtStRec {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} {C : TM2.Stmt Γ Λ σSort l} (H₁ : (k : K) → (s : StAct K Γ σ k) → (q : TM2.Stmt Γ Λ σ) → C qC (stRun s q)) (H₂ : (a : σσ) → (q : TM2.Stmt Γ Λ σ) → C qC (TM2.Stmt.load a q)) (H₃ : (p : σBool) → (q₁ q₂ : TM2.Stmt Γ Λ σ) → C q₁C q₂C (TM2.Stmt.branch p q₁ q₂)) (H₄ : (l : σΛ) → C (TM2.Stmt.goto l)) (H₅ : C TM2.Stmt.halt) (n : TM2.Stmt Γ Λ σ) :
                                C n

                                We have partitioned the TM2 statements into "stack actions", which require going to the end of the stack, and all other actions, which do not. This is a modified recursor which lumps the stack actions into one.

                                Equations
                                Instances For
                                  theorem Turing.TM2to1.supports_run {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} (S : Finset Λ) {k : K} (s : StAct K Γ σ k) (q : TM2.Stmt Γ Λ σ) :
                                  inductive Turing.TM2to1.Λ' (K : Type u_1) (Γ : KType u_2) (Λ : Type u_3) (σ : Type u_4) :
                                  Type (max (max (max u_1 u_2) u_3) u_4)

                                  The machine states of the TM2 emulator. We can either be in a normal state when waiting for the next TM2 action, or we can be in the "go" and "return" states to go to the top of the stack and return to the bottom, respectively.

                                  Instances For
                                    instance Turing.TM2to1.Λ'.inhabited {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [Inhabited Λ] :
                                    Inhabited (Λ' K Γ Λ σ)
                                    Equations
                                    def Turing.TM2to1.trStAct {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] {k : K} (q : TM1.Stmt (Γ' K Γ) (Λ' K Γ Λ σ) σ) :
                                    StAct K Γ σ kTM1.Stmt (Γ' K Γ) (Λ' K Γ Λ σ) σ

                                    The program corresponding to state transitions at the end of a stack. Here we start out just after the top of the stack, and should end just after the new top of the stack.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def Turing.TM2to1.trInit {K : Type u_1} {Γ : KType u_2} [DecidableEq K] (k : K) (L : List (Γ k)) :
                                      List (Γ' K Γ)

                                      The initial state for the TM2 emulator, given an initial TM2 state. All stacks start out empty except for the input stack, and the stack bottom mark is set at the head.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Turing.TM2to1.step_run {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] {k : K} (q : TM2.Stmt Γ Λ σ) (v : σ) (S : (k : K) → List (Γ k)) (s : StAct K Γ σ k) :
                                        TM2.stepAux (stRun s q) v S = TM2.stepAux q (stVar v (S k) s) (Function.update S k (stWrite v (S k) s))
                                        def Turing.TM2to1.trNormal {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} :
                                        TM2.Stmt Γ Λ σTM1.Stmt (Γ' K Γ) (Λ' K Γ Λ σ) σ

                                        The translation of TM2 statements to TM1 statements. regular actions have direct equivalents, but stack actions are deferred by going to the corresponding go state, so that we can find the appropriate stack top.

                                        Equations
                                        Instances For
                                          theorem Turing.TM2to1.trNormal_run {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} {k : K} (s : StAct K Γ σ k) (q : TM2.Stmt Γ Λ σ) :
                                          trNormal (stRun s q) = TM1.Stmt.goto fun (x : Γ' K Γ) (x : σ) => Λ'.go k s q
                                          theorem Turing.TM2to1.trStmts₁_run {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} {k : K} {s : StAct K Γ σ k} {q : TM2.Stmt Γ Λ σ} :
                                          theorem Turing.TM2to1.tr_respects_aux₂ {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] {k : K} {q : TM1.Stmt (Γ' K Γ) (Λ' K Γ Λ σ) σ} {v : σ} {S : (k : K) → List (Γ k)} {L : ListBlank ((k : K) → Option (Γ k))} (hL : ∀ (k : K), ListBlank.map (proj k) L = ListBlank.mk (List.map some (S k)).reverse) (o : StAct K Γ σ k) :
                                          let v' := stVar v (S k) o; let Sk' := stWrite v (S k) o; let S' := Function.update S k Sk'; ∃ (L' : ListBlank ((k : K) → Option (Γ k))), (∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.map some (S' k)).reverse) TM1.stepAux (trStAct q o) v ((Tape.move Dir.right)^[(S k).length] (Tape.mk' (addBottom L))) = TM1.stepAux q v' ((Tape.move Dir.right)^[(S' k).length] (Tape.mk' (addBottom L')))
                                          def Turing.TM2to1.tr {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛTM2.Stmt Γ Λ σ) :
                                          Λ' K Γ Λ σTM1.Stmt (Γ' K Γ) (Λ' K Γ Λ σ) σ

                                          The TM2 emulator machine states written as a TM1 program. This handles the go and ret states, which shuttle to and from a stack top.

                                          Equations
                                          Instances For
                                            inductive Turing.TM2to1.TrCfg {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} :
                                            TM2.Cfg Γ Λ σTM1.Cfg (Γ' K Γ) (Λ' K Γ Λ σ) σProp

                                            The relation between TM2 configurations and TM1 configurations of the TM2 emulator.

                                            Instances For
                                              theorem Turing.TM2to1.tr_respects_aux₁ {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛTM2.Stmt Γ Λ σ) {k : K} (o : StAct K Γ σ k) (q : TM2.Stmt Γ Λ σ) (v : σ) {S : List (Γ k)} {L : ListBlank ((k : K) → Option (Γ k))} (hL : ListBlank.map (proj k) L = ListBlank.mk (List.map some S).reverse) (n : ) (H : n S.length) :
                                              Reaches₀ (TM1.step (tr M)) { l := some (Λ'.go k o q), var := v, Tape := Tape.mk' (addBottom L) } { l := some (Λ'.go k o q), var := v, Tape := (Tape.move Dir.right)^[n] (Tape.mk' (addBottom L)) }
                                              theorem Turing.TM2to1.tr_respects_aux₃ {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛTM2.Stmt Γ Λ σ) {q : TM2.Stmt Γ Λ σ} {v : σ} {L : ListBlank ((k : K) → Option (Γ k))} (n : ) :
                                              Reaches₀ (TM1.step (tr M)) { l := some (Λ'.ret q), var := v, Tape := (Tape.move Dir.right)^[n] (Tape.mk' (addBottom L)) } { l := some (Λ'.ret q), var := v, Tape := Tape.mk' (addBottom L) }
                                              theorem Turing.TM2to1.tr_respects_aux {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛTM2.Stmt Γ Λ σ) {q : TM2.Stmt Γ Λ σ} {v : σ} {T : ListBlank ((i : K) → Option (Γ i))} {k : K} {S : (k : K) → List (Γ k)} (hT : ∀ (k : K), ListBlank.map (proj k) T = ListBlank.mk (List.map some (S k)).reverse) (o : StAct K Γ σ k) (IH : ∀ {v : σ} {S : (k : K) → List (Γ k)} {T : ListBlank ((k : K) → Option (Γ k))}, (∀ (k : K), ListBlank.map (proj k) T = ListBlank.mk (List.map some (S k)).reverse)∃ (b : TM1.Cfg (Γ' K Γ) (Λ' K Γ Λ σ) σ), TrCfg (TM2.stepAux q v S) b Reaches (TM1.step (tr M)) (TM1.stepAux (trNormal q) v (Tape.mk' (addBottom T))) b) :
                                              ∃ (b : TM1.Cfg (Γ' K Γ) (Λ' K Γ Λ σ) σ), TrCfg (TM2.stepAux (stRun o q) v S) b Reaches (TM1.step (tr M)) (TM1.stepAux (trNormal (stRun o q)) v (Tape.mk' (addBottom T))) b
                                              theorem Turing.TM2to1.tr_respects {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛTM2.Stmt Γ Λ σ) :
                                              theorem Turing.TM2to1.trCfg_init {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] [Inhabited Λ] [Inhabited σ] (k : K) (L : List (Γ k)) :
                                              theorem Turing.TM2to1.tr_eval_dom {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛTM2.Stmt Γ Λ σ) [Inhabited Λ] [Inhabited σ] (k : K) (L : List (Γ k)) :
                                              (TM1.eval (tr M) (trInit k L)).Dom (TM2.eval M k L).Dom
                                              theorem Turing.TM2to1.tr_eval {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛTM2.Stmt Γ Λ σ) [Inhabited Λ] [Inhabited σ] (k : K) (L : List (Γ k)) {L₁ : ListBlank (Γ' K Γ)} {L₂ : List (Γ k)} (H₁ : L₁ TM1.eval (tr M) (trInit k L)) (H₂ : L₂ TM2.eval M k L) :
                                              ∃ (S : (k : K) → List (Γ k)) (L' : ListBlank ((k : K) → Option (Γ k))), addBottom L' = L₁ (∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.map some (S k)).reverse) S k = L₂
                                              noncomputable def Turing.TM2to1.trSupp {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} (M : ΛTM2.Stmt Γ Λ σ) (S : Finset Λ) :
                                              Finset (Λ' K Γ Λ σ)

                                              The support of a set of TM2 states in the TM2 emulator.

                                              Equations
                                              Instances For
                                                theorem Turing.TM2to1.tr_supports {K : Type u_1} {Γ : KType u_2} {Λ : Type u_3} {σ : Type u_4} [DecidableEq K] (M : ΛTM2.Stmt Γ Λ σ) [Inhabited Λ] {S : Finset Λ} (ss : TM2.Supports M S) :