Section Own.
Variable inv : Type.
Inductive own : Type :=
| NO
| VAL' : forall sh, Share.nonempty sh -> own
| LK : forall sh, Share.nonempty sh -> Share.t -> inv -> own
| CT : forall sh, Share.nonempty sh -> own
| FUN: forall sh, Share.nonempty sh -> inv -> own.
Definition own_join (a b c: own) : Prop :=
match a , b , c with
| NO , _ , _ =>  b=c
| _ , NO , _ =>  a=c
| @VAL' sa _, @VAL' sb _, @VAL' sc _ => Share.j.(join) sa sb sc
| @LK sa pa ha fa, @LK sb pb hb fb, @LK sc pc hc fc =>
Share.j.(join) sa sb sc /\
Share.j.(join) ha hb hc /\
fa=fc /\
fb=fc
| @CT sa pa , @CT sb pb, @CT sc pc => Share.j.(join) sa sb sc
| @FUN sa pa fa, @FUN sb pb fb, @FUN sc pc fc =>
Share.j.(join) sa sb sc /\ fa=fc /\ fb=fc
| _ , _ , _ => False
end.
Definition own_is_empty (a: own) := a=NO.
Definition jown : joinable own :=
Joinable own_is_empty own_join
ADMIT ADMIT  ADMIT  ADMIT  ADMIT  ADMIT  ADMIT  ADMIT .
End Own.
Fixpoint sinv (n: nat) : Type :=
match n with
| O => unit
| S n => prodT (sinv n) (own (sinv n) -> unit -> Prop)
end.
Parameter address: Set.
Definition jm (n: nat) := mkJoinmap address (jown (sinv n)).
Definition worldfun (n: nat) := (jm n).(jm_t).
Inductive world : Type :=
mk_world: forall n, worldfun n -> world.

Lemma test: forall n1 w1 n2 w2, mk_world n1 w1 = mk_world n2 w2 ->
n1 = n2.