Class TraceRelation `{State : Type} `{Event : Type} (step : step_relation State Event) :=
  {
    init : State;
    T : (list Event) -> Prop;
    T_dec : forall l, {T l} + {~ T l};
    R : State -> Prop;
    R_monotonic : forall s s' tr o, refl_trans_1n_trace step init s tr ->
                               step s s' o ->
                               R s ->
                               R s';
    T_false_init : ~ T [];
    T_implies_R : forall tr s s' o,
                    refl_trans_1n_trace step init s tr ->
                    ~ T tr ->
                    step s s' o ->
                    T (tr ++ o) ->
                    R s'
  }.Class TraceRelation `{State : Type} `{Event : Type} (step : step_relation State Event) :=
  {
    init : State;
    T : (list Event) -> Prop;
    T_dec : forall l, {T l} + {~ T l};
    R : State -> Prop;
    R_monotonic : forall s s' tr o, refl_trans_1n_trace step init s tr ->
                               step s s' o ->
                               R s ->
                               R s';
    T_false_init : ~ T [];
    T_implies_R : forall tr s s' o,
                    refl_trans_1n_trace step init s tr ->
                    ~ T tr ->
                    step s s' o ->
                    T (tr ++ o) ->
                    R s'
  }.Class TraceRelation `{State : Type} `{Event : Type} (step : step_relation State Event) :=
  {
    init : State;
    T : (list Event) -> Prop;
    T_dec : forall l, {T l} + {~ T l};
    R : State -> Prop;
    R_monotonic : forall s s' tr o, refl_trans_1n_trace step init s tr ->
                               step s s' o ->
                               R s ->
                               R s';
    T_false_init : ~ T [];
    T_implies_R : forall tr s s' o,
                    refl_trans_1n_trace step init s tr ->
                    ~ T tr ->
                    step s s' o ->
                    T (tr ++ o) ->
                    R s'
  }.Class TraceRelation `{State : Type} `{Event : Type} (step : step_relation State Event) :=
  {
    init : State;
    T : (list Event) -> Prop;
    T_dec : forall l, {T l} + {~ T l};
    R : State -> Prop;
    R_monotonic : forall s s' tr o, refl_trans_1n_trace step init s tr ->
                               step s s' o ->
                               R s ->
                               R s';
    T_false_init : ~ T [];
    T_implies_R : forall tr s s' o,
                    refl_trans_1n_trace step init s tr ->
                    ~ T tr ->
                    step s s' o ->
                    T (tr ++ o) ->
                    R s'
  }.Class TraceRelation `{State : Type} `{Event : Type} (step : step_relation State Event) :=
  {
    init : State;
    T : (list Event) -> Prop;
    T_dec : forall l, {T l} + {~ T l};
    R : State -> Prop;
    R_monotonic : forall s s' tr o, refl_trans_1n_trace step init s tr ->
                               step s s' o ->
                               R s ->
                               R s';
    T_false_init : ~ T [];
    T_implies_R : forall tr s s' o,
                    refl_trans_1n_trace step init s tr ->
                    ~ T tr ->
                    step s s' o ->
                    T (tr ++ o) ->
                    R s'
  }.Class TraceRelation `{State : Type} `{Event : Type} (step : step_relation State Event) :=
  {
    init : State;
    T : (list Event) -> Prop;
    T_dec : forall l, {T l} + {~ T l};
    R : State -> Prop;
    R_monotonic : forall s s' tr o, refl_trans_1n_trace step init s tr ->
                               step s s' o ->
                               R s ->
                               R s';
    T_false_init : ~ T [];
    T_implies_R : forall tr s s' o,
                    refl_trans_1n_trace step init s tr ->
                    ~ T tr ->
                    step s s' o ->
                    T (tr ++ o) ->
                    R s'
  }.Class TraceRelation `{State : Type} `{Event : Type} (step : step_relation State Event) :=
  {
    init : State;
    T : (list Event) -> Prop;
    T_dec : forall l, {T l} + {~ T l};
    R : State -> Prop;
    R_monotonic : forall s s' tr o, refl_trans_1n_trace step init s tr ->
                               step s s' o ->
                               R s ->
                               R s';
    T_false_init : ~ T [];
    T_implies_R : forall tr s s' o,
                    refl_trans_1n_trace step init s tr ->
                    ~ T tr ->
                    step s s' o ->
                    T (tr ++ o) ->
                    R s'
  }.Class TraceRelation `{State : Type} `{Event : Type} (step : step_relation State Event) :=
  {
    init : State;
    T : (list Event) -> Prop;
    T_dec : forall l, {T l} + {~ T l};
    R : State -> Prop;
    R_monotonic : forall s s' tr o, refl_trans_1n_trace step init s tr ->
                               step s s' o ->
                               R s ->
                               R s';
    T_false_init : ~ T [];
    T_implies_R : forall tr s s' o,
                    refl_trans_1n_trace step init s tr ->
                    ~ T tr ->
                    step s s' o ->
                    T (tr ++ o) ->
                    R s'
  }.

Theorem trace_relations_work : forall s tr, refl_trans_1n_trace step init s tr -> T tr -> R s.