intros until o.
cut
match fsecmat (secmat s) o with
| Some y => set_In (o, y) (secmat s)
| None => ~ set_In o (DOM OBJeq_dec (secmat s))
end.
unfold close_sm in |- *.
elim (fsecmat (secmat s) o); intros.
elim (set_remove SUBeq_dec Sub (ActReaders a));
elim (set_remove SUBeq_dec Sub (ActWriters a)).
replace (fsecmat (set_remove SECMATeq_dec (o, a) (secmat s)) o) with
(None (A:=ReadersWriters)).
auto.
symmetry  in |- *; unfold fsecmat in |- *; unfold FuncPre5 in H; auto.
intros.
replace
(fsecmat
(set_add SECMATeq_dec (o, NEWRW Sub o a)
(set_remove SECMATeq_dec (o, a) (secmat s))) o) with
(Some (NEWRW Sub o a)).
unfold NEWRW in |- *; simpl in |- *.
split;
[ intro;
eapply
(Set_remove2 (A:=SUBJECT) (Aeq_dec:=SUBeq_dec) (B:=
ActReaders a) (x:=u0) (y:=Sub)); auto
| intro;
eapply
(Set_remove2 (A:=SUBJECT) (Aeq_dec:=SUBeq_dec) (B:=
ActWriters a) (x:=u0) (y:=Sub)); auto ].
unfold fsecmat in |- *; apply AddEq1.
auto.
intros.
replace
(fsecmat
(set_add SECMATeq_dec (o, NEWRW Sub o a)
(set_remove SECMATeq_dec (o, a) (secmat s))) o) with
(Some (NEWRW Sub o a)).
unfold NEWRW in |- *; simpl in |- *.
split;
[ intro;
eapply
(Set_remove2 (A:=SUBJECT) (Aeq_dec:=SUBeq_dec) (B:=
ActReaders a) (x:=u0) (y:=Sub)); auto
| intro;
eapply
(Set_remove2 (A:=SUBJECT) (Aeq_dec:=SUBeq_dec) (B:=
ActWriters a) (x:=u0) (y:=Sub)); auto ].
unfold fsecmat in |- *; apply AddEq1.
auto.
intros.
replace
(fsecmat
(set_add SECMATeq_dec (o, NEWRW Sub o a)
(set_remove SECMATeq_dec (o, a) (secmat s))) o) with
(Some (NEWRW Sub o a)).
unfold NEWRW in |- *; simpl in |- *.
split;
[ intro;
eapply
(Set_remove2 (A:=SUBJECT) (Aeq_dec:=SUBeq_dec) (B:=
ActReaders a) (x:=u0) (y:=Sub)); auto
| intro;
eapply
(Set_remove2 (A:=SUBJECT) (Aeq_dec:=SUBeq_dec) (B:=
ActWriters a) (x:=u0) (y:=Sub)); auto ].
unfold fsecmat in |- *; apply AddEq1.
auto.
tauto.
unfold fsecmat in |- *; apply DOMFuncRel4.
Qed.

(* Specifications: *)
Lemma Eqfsecmat1 :
forall (s : SFSstate) (o1 o2 : OBJECT) (u : SUBJECT),
o1 <> o2 -> fsecmat (secmat s) o2 = fsecmat (close_sm s u o1) o2.