States equal except on a lens #
Lens.equal_outside L g₁ g₂ (Language/Lens.lean): g₂ is g₁ with L overwritten. The
relation EasyCrypt's sim keeps when the two programs differ only in variables the rest of the code
does not read (a local module's variable written on one side only, or written on both sides at
different times). prhlProc_self_equal_outside is the call rule for it: a procedure that does not
touch L, on both sides.
L.equal_outside g₁ g₂ (the states agree except on L) is agreement of the complement lens.
EasyCrypt's sim across a call, the states equal except on L: a procedure that does not
touch L, called on both sides with equal arguments, keeps the states equal outside L and any
relation I of the two contents of L (prhlProc_abstract_callF without holes).
prhlProc_self_equal_outside for a module's procedure, bounded by the module's footprint.
EasyCrypt's call (: inv) for an abstract module, the states equal except on L: D
outside L, applied to two oracles that keep the states equal outside L and the relation I of
the two contents of L, keeps them too (prhlProc_abstract_callF at the complement of L). With
I equality, the states are equal (Lens.equal_outside_and_get_eq_iff): EC's sim across a
call of an adversary whose oracles differ in code but not in behaviour.
The same write of a lens disjoint from L keeps the states equal outside L.
States equal outside L agree on every lens disjoint from L.
A write of L on one side keeps the states equal outside L.
Every state is equal to itself outside L.
A write of L on the left keeps the states equal outside L.
equal_outside is symmetric.
equal_outside is transitive.
A write of L keeps a state equal to itself outside L.
States equal outside A are equal outside Lens.pair A B.
States equal outside B are equal outside Lens.pair A B.
States equal outside L and on L are equal.