(* the mutex stages, excluding undef and unit *)

Inductive mutex := undef | nown | own | mx of T.(* the mutex stages, excluding undef and unit *)

Inductive mutex := undef | nown | own | mx of T.(* the mutex stages, excluding undef and unit *)

Inductive mutex := undef | nown | own | mx of T.(* the mutex stages, excluding undef and unit *)

Inductive mutex := undef | nown | own | mx of T.(* the mutex stages, excluding undef and unit *)

Inductive mutex := undef | nown | own | mx of T.Definition join x y := 
  match x, y with
    undef, _ => undef 
  | _, undef => undef
  | nown, x => x 
  | x, nown => x
  | own, _ => undef
  | _, own => undef
  | mx _, mx _ => undef
  end.Definition valid x := if x is undef then false else true.

(* Specifications: *)
Lemma joinC : commutative join.
Lemma joinA : associative join.
Lemma unitL : left_id nown join.
Lemma validL x y : valid (join x y) -> valid x.
Lemma valid_unit : valid nown.