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 ownerclose_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 H0; auto.
intros.
replace
(fsecmat
(set_add SECMATeq_dec (o, NEWRWOC Sub o a)
(set_remove SECMATeq_dec (o, a) (secmat s))) o) with
(Some (NEWRWOC Sub o a)).
unfold NEWRWOC 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, NEWRWOC Sub o a)
(set_remove SECMATeq_dec (o, a) (secmat s))) o) with
(Some (NEWRWOC Sub o a)).
unfold NEWRWOC 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, NEWRWOC Sub o a)
(set_remove SECMATeq_dec (o, a) (secmat s))) o) with
(Some (NEWRWOC Sub o a)).
unfold NEWRWOC 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.

Lemma Eqfsecmat2 :
forall (s : SFSstate) (o1 o2 : OBJECT) (u : SUBJECT),
o1 <> o2 -> fsecmat (secmat s) o2 = fsecmat (ownerclose_sm s u o1) o2.