Local Arguments getThreadR {_} {_} {_} _ _ _.
Local Arguments getThreadC {_} {_} {_} _ _ _.
Local Arguments personal_mem : clear implicits.
Local Arguments updThread {_} {_} {_} _ _ _ _ _.
Local Arguments updThreadR {_} {_} {_} _ _ _ _.
Local Arguments updThreadC {_} {_} {_} _ _ _ _.
Local Arguments juicyRestrict : clear implicits.
Set Bullet Behavior "Strict Subproofs".
Open Scope string_scope.

Lemma resource_decay_join_all ge {tp : jstate ge} {m Phi} c' {phi' i} {cnti : containsThread tp i}:
rmap_bound (Mem.nextblock m) Phi ->
resource_decay (Mem.nextblock m) (getThreadR i tp cnti) phi' /\
level (getThreadR i tp cnti) = S (level phi') /\
ghost_of phi' = ghost_fmap (approx (level phi')) (approx (level phi')) (ghost_of (getThreadR i tp cnti)) ->
join_all tp Phi ->
exists Phi',
join_all (updThread i (age_tp_to (level phi') tp) (cnt_age' cnti) c' phi') Phi' /\
resource_decay (Mem.nextblock m) Phi Phi' /\
ghost_of Phi' = own.ghost_approx Phi' (ghost_of Phi) /\
level Phi = S (level Phi').