Program Definition jam {A} {JA: Join A}{PA: Perm_alg A}{agA: ageable A}{AgeA: Age_alg A} {B: Type} {S': B -> Prop} (S: forall l, {S' l}+{~ S' l}) (P Q: B -> pred A) : B -> pred A :=
  fun (l: B) m => if S l then P l m else Q l m.

Lemma boxy_jam: forall (m: modality) A (S': A -> Prop) S P Q, (forall (x: A), boxy m (P x)) -> (forall x, boxy m (Q x)) -> forall x, boxy m (@jam rmap _ _ _ _ A S' S P Q x).