Inductive match_state:
      forall n,
      nth_index ->
        Values.Val.meminj ->
        ThreadPool (Some 0) -> Memory.Mem.mem -> ThreadPool (Some n) -> Memory.Mem.mem -> Prop:=
    | refl_match: forall j tp m,
        match_state 0 nil j tp m tp m
    | step_match_state:
        forall n ocd ils jn jSn tp0 m0 tpn mn tpSn mSn,
          match_state n ils jn tp0 m0 tpn mn ->
          concur_match n ocd jSn tpn mn tpSn mSn ->
          match_state (S n) (cons ocd ils) (compose_meminj jn jSn) tp0 m0 tpSn mSn.Inductive match_state:
      forall n,
      nth_index ->
        Values.Val.meminj ->
        ThreadPool (Some 0) -> Memory.Mem.mem -> ThreadPool (Some n) -> Memory.Mem.mem -> Prop:=
    | refl_match: forall j tp m,
        match_state 0 nil j tp m tp m
    | step_match_state:
        forall n ocd ils jn jSn tp0 m0 tpn mn tpSn mSn,
          match_state n ils jn tp0 m0 tpn mn ->
          concur_match n ocd jSn tpn mn tpSn mSn ->
          match_state (S n) (cons ocd ils) (compose_meminj jn jSn) tp0 m0 tpSn mSn.Inductive match_state:
      forall n,
      nth_index ->
        Values.Val.meminj ->
        ThreadPool (Some 0) -> Memory.Mem.mem -> ThreadPool (Some n) -> Memory.Mem.mem -> Prop:=
    | refl_match: forall j tp m,
        match_state 0 nil j tp m tp m
    | step_match_state:
        forall n ocd ils jn jSn tp0 m0 tpn mn tpSn mSn,
          match_state n ils jn tp0 m0 tpn mn ->
          concur_match n ocd jSn tpn mn tpSn mSn ->
          match_state (S n) (cons ocd ils) (compose_meminj jn jSn) tp0 m0 tpSn mSn.

(* Specifications: *)
Lemma trivial_self_injection: forall m : option mem, HybridMachine_simulation_properties (HybConcSem (Some 0) m) (HybConcSem (Some 0) m) (match_state 0).
Lemma simulation_inductive_case: forall n : nat, (forall m : option mem, HybridMachine_simulation_properties (HybConcSem (Some 0) m) (HybConcSem (Some n) m) (match_state n)) -> (forall m : option mem, HybridMachine_simulation_properties (HybConcSem (Some n) m) (HybConcSem (Some (S n)) m) (concur_match n)) -> forall m : option mem, HybridMachine_simulation_properties (HybConcSem (Some 0) m) (HybConcSem (Some (S n)) m) (match_state (S n)).
Lemma compile_n_threads: forall n m, HybridMachine_simulation.HybridMachine_simulation_properties (HybConcSem (Some 0) m) (HybConcSem (Some n) m) (match_state n).