hash H. Typed-check process:

null

Added action dependencies lemmas:


System after processing:

null

System Empty registered with actions (init).
[warning>Loaded "Prelude.sp".
<]

RUNNING EXAMPLE

This protocol is a variant of the OSK protocol described in: M. Ohkubo, K. Suzuki, S. Kinoshita et al., “Cryptographic approach to “privacy-friendly” tags,” RFID privacy workshop, vol. 82. Cambridge, USA, 2003.

Each tag is associated to a mutable state sT initialized with s0. Readers have access to a database containing an entry sR for each authorized tag.

sT := H(sT,k) T -> R : G(sT,k’)

input x; sR := H(sR,k) if x = G(H(sR,k),k’) with sR in DB R -> T : ok

COMMENTS - In this model we add in parallel a process in order to provide the attacker the ability to compute hashes with their respective keys (without knowing these keys). - The reader process is not modelled here, this is left for future work.

HELPING LEMMAS - last update - disjoint chains - monotonic chain

SECURITY PROPERTIES - strong secrecy ******************************************************************************


hash G.

name k : message.
global axiom namelength_k {'P:system} @system:(set:'P; equiv:None) :
[len k = namelength_message]

name k' : message.
global axiom namelength_k' {'P:system} @system:(set:'P; equiv:None) :
[len k' = namelength_message]

name s0 : index->message.
global axiom namelength_s0 {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index), len (s0 i) = namelength_message]

mutable s (i:index) : message = s0(i).


channel o.

channel c.


system (
(O: !_j in(o,x); out(o,<H(x,k),G(x,k')>)) |
(A: !_i !_j s(i):=H(s(i),k); out(o,G(s(i),k')))
).
Typed-check process:

( O: !_j( in(o,x); out(o,<H (x, k),G (x, k')>); null) ) |
A: !_i( !_j( s(i) := H (s i@τ, k); out(o,G (s i@τ, k')); null))

Added action dependencies lemmas:

axiom depends_init_A {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), happens(A(i, j)) => init < A(i, j)
axiom depends_init_O {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (j:index), happens(O(j)) => init < O(j)

System after processing:

( !_j( in(o,x); O: out(o,<H (x, k),G (x, k')>); null) ) |
!_i( !_j( s(i) := H (s i@τ, k); A: out(o,G (s i@τ, k')); null))

System Empty registered with actions (init).
System default registered with actions (init,O,A).


include Core.
op assoc ['a] (f:'a -> 'a -> 'a) : bool =
forall (x,y,z:'a), f (f x y) z = f x (f y z)
axiom eq_iff {'P:system} @system:(set:'P; equiv:None) :
forall (x,y:bool), (x = y) = (x <=> y)
axiom eq_not {'P:system} @system:(set:'P; equiv:None) :
forall (x,y:bool), (not x = not y) = (x = y)
Goal eq_sym :
(x = y) = (y = x)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
(x = y) = (y = x)

[> Line 12: by (rewrite) [goal> lemma eq_sym is proved

lemma eq_sym {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), (x = y) = (y = x)
Exiting proof mode.

Goal neq_sym :
(x <> y) = (y <> x)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
(x <> y) = (y <> x)

[> Line 15: by (rewrite) [goal> lemma neq_sym is proved

lemma neq_sym {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), (x <> y) = (y <> x)
Exiting proof mode.

Goal eq_refl_e :
(x = x) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x:'a
----------------------------------------
(x = x) = true

[> Line 20: by (rewrite) [goal> lemma eq_refl_e is proved

lemma eq_refl_e {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x:'a), (x = x) = true
Exiting proof mode.

Goal eq_refl :
x = x
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x:'a
----------------------------------------
x = x

[> Line 26: by (rewrite) [goal> lemma eq_refl is proved

lemma eq_refl {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x:'a), x = x
Exiting proof mode.

Goal neq_irrefl :
x <> x <=> false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x:'a
----------------------------------------
x <> x <=> false

[> Line 29: by (split) [goal> lemma neq_irrefl is proved

lemma neq_irrefl {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x:'a), x <> x <=> false
Exiting proof mode.

Goal eq_assoc :
((b0 = b1) = b2) = (b0 = (b1 = b2))
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool
----------------------------------------
((b0 = b1) = b2) = (b0 = (b1 = b2))

[> Line 37: ((have); 1: by (rewrite)) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool[const]
true_false: (true = false) = false
----------------------------------------
((b0 = b1) = b2) = (b0 = (b1 = b2))

[> Line 38: ((have); 1: by (rewrite)) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool[const]
false_true: (false = true) = false
true_false: (true = false) = false
----------------------------------------
((b0 = b1) = b2) = (b0 = (b1 = b2))

[> Line 38: ((case);((case);((case);(try (auto))))) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool[const]
false_true: (false = true) = false
true_false: (true = false) = false
----------------------------------------
not b2 => not b1 => b0 => ((true = false) = false) = (true = (false = false))

[> Line 38: by (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool[const]
false_true: (false = true) = false
true_false: (true = false) = false
----------------------------------------
b2 => not b1 => not b0 => ((false = false) = true) = (false = (false = true))

[> Line 38: by (rewrite) [goal> lemma eq_assoc is proved

lemma eq_assoc {'P:system} @system:(set:'P; equiv:None) :
forall (b0,b1,b2:bool), ((b0 = b1) = b2) = (b0 = (b1 = b2))
Exiting proof mode.

axiom fun_ext {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
forall (f,g:'a -> 'b), (forall (x:'a), f x = g x) => f = g
Goal true_false :
(true = false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
----------------------------------------
(true = false) = false

[> Line 51: by (rewrite) [goal> lemma true_false is proved

lemma true_false {'P:system} @system:(set:'P; equiv:None) :
(true = false) = false
Exiting proof mode.

Goal false_true :
(false = true) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
----------------------------------------
(false = true) = false

[> Line 57: by (rewrite) [goal> lemma false_true is proved

lemma false_true {'P:system} @system:(set:'P; equiv:None) :
(false = true) = false
Exiting proof mode.

Goal eq_true :
(b = true) = b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b = true) = b

[> Line 61: by (case) [goal> lemma eq_true is proved

lemma eq_true {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b = true) = b
Exiting proof mode.

Goal eq_true2 :
(true = b) = b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(true = b) = b

[> Line 65: by (case) [goal> lemma eq_true2 is proved

lemma eq_true2 {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (true = b) = b
Exiting proof mode.

axiom not_true {'P:system} @system:(set:'P; equiv:None) : not true = false
axiom not_false {'P:system} @system:(set:'P; equiv:None) : not false = true
Goal not_not :
not (not b) = b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
not (not b) = b

[> Line 81: by (case) [goal> lemma not_not is proved

lemma not_not {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), not (not b) = b
Exiting proof mode.

Goal not_eq :
not (x = y) = (x <> y)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
not (x = y) = (x <> y)

[> Line 86: by (rewrite) [goal> lemma not_eq is proved

lemma not_eq {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), not (x = y) = (x <> y)
Exiting proof mode.

Goal not_neq :
not (x <> y) = (x = y)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
not (x <> y) = (x = y)

[> Line 92: by (rewrite) [goal> lemma not_neq is proved

lemma not_neq {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), not (x <> y) = (x = y)
Exiting proof mode.

Goal not_eqfalse :
(b = false) = not b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b = false) = not b

[> Line 99: by (case) [goal> lemma not_eqfalse is proved

lemma not_eqfalse {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b = false) = not b
Exiting proof mode.

Goal not_impl :
not (a => b) = (a && not b)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool
----------------------------------------
not (a => b) = (a && not b)

[> Line 104: ((rewrite);((split);(intro))) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
H: not (a => b)
----------------------------------------
a && not b

[> Line 104: (split) [goal> Focused goal (1/3):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
H: not (a => b)
----------------------------------------
a

[> Line 106: (rewrite) [goal> Focused goal (1/3):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
H: not (a => b)
----------------------------------------
not (not a)

[> Line 107: (intro) [goal> Focused goal (1/3):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
H: not (a => b)
Hna: not a
----------------------------------------
false

[> Line 108: by (apply) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
H: not (a => b)
----------------------------------------
not b

[> Line 109: (intro) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
H: not (a => b)
Hb: b
----------------------------------------
false

[> Line 110: by (apply) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
H: a && not b
----------------------------------------
not (a => b)

[> Line 111: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
H: a && not b
Hi: a => b
----------------------------------------
false

[> Line 112: (destruct) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
Ha: a
Hi: a => b
Hnb: not b
----------------------------------------
false

[> Line 113: (apply) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
Ha: a
Hi: a => b
Hnb: not b
----------------------------------------
b

[> Line 114: by (apply) [goal> lemma not_impl is proved

lemma not_impl {'P:system} @system:(set:'P; equiv:None) :
forall (a,b:bool), not (a => b) = (a && not b)
Exiting proof mode.

Goal eq_false :
((x = y) = false) = (x <> y)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
((x = y) = false) = (x <> y)

[> Line 121: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
((x = y) = false) = not (x = y)

[> Line 121: ((case);(intro)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
_: x = y
----------------------------------------
(true = false) = not true

[> Line 121: (simpl) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
_: x = y
----------------------------------------
true

[> Line 122: (auto) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
_: not (x = y)
----------------------------------------
(false = false) = not false

[> Line 122: by (rewrite) [goal> lemma eq_false is proved

lemma eq_false {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), ((x = y) = false) = (x <> y)
Exiting proof mode.

axiom and_comm {'P:system} @system:(set:'P; equiv:None) :
forall (b,b':bool), (b && b') = (b' && b)
Goal and_dist :
((b0 || b1) && b2) = (b0 && b2 || b1 && b2)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool
----------------------------------------
((b0 || b1) && b2) = (b0 && b2 || b1 && b2)

[> Line 132: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool[const]
----------------------------------------
(b0 || b1) && b2 <=> b0 && b2 || b1 && b2

[> Line 132: by (split) [goal> lemma and_dist is proved

lemma and_dist {'P:system} @system:(set:'P; equiv:None) :
forall (b0,b1,b2:bool), ((b0 || b1) && b2) = (b0 && b2 || b1 && b2)
Exiting proof mode.

axiom and_true_l {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (true && b) = b
Goal and_true_r :
(b && true) = b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b && true) = b

[> Line 138: by (rewrite) [goal> lemma and_true_r is proved

lemma and_true_r {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b && true) = b
Exiting proof mode.

axiom and_false_l {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (false && b) = false
Goal and_false_r :
(b && false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b && false) = false

[> Line 145: by (rewrite) [goal> lemma and_false_r is proved

lemma and_false_r {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b && false) = false
Exiting proof mode.

Goal and_double :
(b && b) = b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b && b) = b

[> Line 150: by (case) [goal> lemma and_double is proved

lemma and_double {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b && b) = b
Exiting proof mode.

axiom or_comm {'P:system} @system:(set:'P; equiv:None) :
forall (b,b':bool), (b || b') = (b' || b)
Goal or_dist :
((b0 || b2) && (b1 || b2)) = (b0 && b1 || b2)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool
----------------------------------------
((b0 || b2) && (b1 || b2)) = (b0 && b1 || b2)

[> Line 158: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1,b2:bool[const]
----------------------------------------
(b0 || b2) && (b1 || b2) <=> b0 && b1 || b2

[> Line 158: by (split) [goal> lemma or_dist is proved

lemma or_dist {'P:system} @system:(set:'P; equiv:None) :
forall (b0,b1,b2:bool), ((b0 || b2) && (b1 || b2)) = (b0 && b1 || b2)
Exiting proof mode.

axiom or_false_l {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (false || b) = b
Goal or_false_r :
(b || false) = b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b || false) = b

[> Line 164: by (rewrite) [goal> lemma or_false_r is proved

lemma or_false_r {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b || false) = b
Exiting proof mode.

axiom or_true_l {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (true || b) = true
Goal or_true_r :
(b || true) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b || true) = true

[> Line 171: by (rewrite) [goal> lemma or_true_r is proved

lemma or_true_r {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b || true) = true
Exiting proof mode.

Goal or_double :
(b || b) = b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b || b) = b

[> Line 175: by (case) [goal> lemma or_double is proved

lemma or_double {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b || b) = b
Exiting proof mode.

Goal impl_charac :
(b => b') = (not b || b')
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b,b':bool
----------------------------------------
(b => b') = (not b || b')

[> Line 182: (((rewrite);((split);((case);(case))));(intro)) [goal> lemma impl_charac is proved

lemma impl_charac {'P:system} @system:(set:'P; equiv:None) :
forall (b,b':bool), (b => b') = (not b || b')
Exiting proof mode.

Goal impl_false_l :
(false => b) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(false => b) = true

[> Line 186: by ((rewrite);(case)) [goal> lemma impl_false_l is proved

lemma impl_false_l {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (false => b) = true
Exiting proof mode.

Goal impl_true_r :
(b => true) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(b => true) = true

[> Line 190: (auto) [goal> lemma impl_true_r is proved

lemma impl_true_r {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (b => true) = true
Exiting proof mode.

Goal impl_true_l :
(true => b) = b
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool
----------------------------------------
(true => b) = b

[> Line 194: by (rewrite) [goal> lemma impl_true_l is proved

lemma impl_true_l {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool), (true => b) = b
Exiting proof mode.

Goal impl_contra :
(b => c) = (not c => not b)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b,c:bool
----------------------------------------
(b => c) = (not c => not b)

[> Line 200: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b,c:bool[const]
----------------------------------------
(not b || c) = (c || not b)

[> Line 201: by (rewrite) [goal> lemma impl_contra is proved

lemma impl_contra {'P:system} @system:(set:'P; equiv:None) :
forall (b,c:bool), (b => c) = (not c => not b)
Exiting proof mode.

Goal not_and :
not (a && b) = (not a || not b)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool
----------------------------------------
not (a && b) = (not a || not b)

[> Line 208: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
----------------------------------------
not (a && b) <=> not a || not b

[> Line 210: (((case);(case));(intro)) [goal> lemma not_and is proved

lemma not_and {'P:system} @system:(set:'P; equiv:None) :
forall (a,b:bool), not (a && b) = (not a || not b)
Exiting proof mode.

Goal not_or :
not (a || b) = (not a && not b)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool
----------------------------------------
not (a || b) = (not a && not b)

[> Line 214: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: a,b:bool[const]
----------------------------------------
not (a || b) <=> not a && not b

[> Line 216: (((case);(case));(intro)) [goal> lemma not_or is proved

lemma not_or {'P:system} @system:(set:'P; equiv:None) :
forall (a,b:bool), not (a || b) = (not a && not b)
Exiting proof mode.

Goal if_true :
b => if b then x else y = x
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool,x,y:'a
----------------------------------------
b => if b then x else y = x

[> Line 225: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool[const],x,y:'a
H: b
----------------------------------------
if b then x else y = x

[> Line 226: (case) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool[const],x,y:'a
H: b
----------------------------------------
b && if b then x else y = x => x = x

[> Line 227: (auto) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool[const],x,y:'a
H: b
----------------------------------------
not b && if b then x else y = y => y = x

[> Line 227: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool[const],x,y:'a
H: b
HH: not b
_: if b then x else y = y
----------------------------------------
y = x

[> Line 228: by (have) [goal> lemma if_true is proved

lemma if_true {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b:bool,x,y:'a), b => if b then x else y = x
Exiting proof mode.

Goal if_true0 :
if true then x else y = x
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
if true then x else y = x

[> Line 233: by (rewrite) [goal> lemma if_true0 is proved

lemma if_true0 {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), if true then x else y = x
Exiting proof mode.

Goal if_false :
not b => if b then x else y = y
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool,x,y:'a
----------------------------------------
not b => if b then x else y = y

[> Line 241: ((intro);(case)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool[const],x,y:'a
H: not b
----------------------------------------
b && if b then x else y = x => x = y

[> Line 241: (intro) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool[const],x,y:'a
H: not b
H1: b
H2: if b then x else y = x
----------------------------------------
x = y

[> Line 242: by (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool[const],x,y:'a
H: not b
----------------------------------------
not b && if b then x else y = y => y = y

[> Line 244: (auto) [goal> lemma if_false is proved

lemma if_false {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b:bool,x,y:'a), not b => if b then x else y = y
Exiting proof mode.

Goal if_false0 :
if false then x else y = y
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
if false then x else y = y

[> Line 250: by (rewrite) [goal> lemma if_false0 is proved

lemma if_false0 {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), if false then x else y = y
Exiting proof mode.

Goal if_then_then :
if b then (if b' then x else y) else y = if (b && b') then x else y
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b,b':bool,x,y:'a
----------------------------------------
if b then (if b' then x else y) else y = if (b && b') then x else y

[> Line 257: by ((case);(case)) [goal> lemma if_then_then is proved

lemma if_then_then {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b,b':bool,x,y:'a),
if b then (if b' then x else y) else y = if (b && b') then x else y
Exiting proof mode.

Goal if_then_or :
if b0 then m0 else if b1 then m0 else m1 = if (b0 || b1) then m0 else m1
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1:bool,m0,m1:message
----------------------------------------
if b0 then m0 else if b1 then m0 else m1 = if (b0 || b1) then m0 else m1

[> Line 264: ((have); 1: by (auto)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1:bool[const],m0,m1:message
_: b0
----------------------------------------
if b0 then m0 else if b1 then m0 else m1 = if (b0 || b1) then m0 else m1

[> Line 264: ((rewrite);(intro)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1:bool[const],m0,m1:message
_: b0
----------------------------------------
m0 = if (b0 || b1) then m0 else m1

[> Line 264: ((rewrite);(intro)) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1:bool[const],m0,m1:message
_: not b0
----------------------------------------
if b0 then m0 else if b1 then m0 else m1 = if (b0 || b1) then m0 else m1

[> Line 265: ((have); 1: by (auto)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1:bool[const],m0,m1:message
_: b1
_: not b0
----------------------------------------
if b0 then m0 else if b1 then m0 else m1 = if (b0 || b1) then m0 else m1

[> Line 265: ((rewrite);(intro)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1:bool[const],m0,m1:message
_: b1
_: not b0
----------------------------------------
if b1 then m0 else m1 = if (b0 || b1) then m0 else m1

[> Line 265: ((rewrite);(intro)) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b0,b1:bool[const],m0,m1:message
_: not b1
_: not b0
----------------------------------------
if b0 then m0 else if b1 then m0 else m1 = if (b0 || b1) then m0 else m1

[> Line 267: ((rewrite);(intro)) [goal> lemma if_then_or is proved

lemma if_then_or {'P:system} @system:(set:'P; equiv:None) :
forall (b0,b1:bool,m0,m1:message),
if b0 then m0 else if b1 then m0 else m1 = if (b0 || b1) then m0 else m1
Exiting proof mode.

Goal if_then_implies :
if b then (if b' then x else y) else z =
if b then (if (b => b') then x else y) else z
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b,b':bool,x,y,z:'a
----------------------------------------
if b then (if b' then x else y) else z =
if b then (if (b => b') then x else y) else z

[> Line 273: ((case);((intro);((case);((intro);((simpl);(try (auto))))))) [goal> lemma if_then_implies is proved

lemma if_then_implies {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b,b':bool,x,y,z:'a),
if b then (if b' then x else y) else z =
if b then (if (b => b') then x else y) else z
Exiting proof mode.

Goal if_same :
if b then x else x = x
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b:bool,x:'a
----------------------------------------
if b then x else x = x

[> Line 280: by (case) [goal> lemma if_same is proved

lemma if_same {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b:bool,x:'a), if b then x else x = x
Exiting proof mode.

Goal if_then :
b = b' => if b then (if b' then x else y) else z = if b then x else z
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b,b':bool,x,y,z:'a
----------------------------------------
b = b' => if b then (if b' then x else y) else z = if b then x else z

[> Line 289: by ((intro);(case)) [goal> lemma if_then is proved

lemma if_then {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b,b':bool,x,y,z:'a),
b = b' => if b then (if b' then x else y) else z = if b then x else z
Exiting proof mode.

Goal if_then_inv :
if b then m0 else m1 = if b then (if b then m0) else m1
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool,m0,m1:message
----------------------------------------
if b then m0 else m1 = if b then (if b then m0) else m1

[> Line 295: (auto) [goal> lemma if_then_inv is proved

lemma if_then_inv {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool,m0,m1:message),
if b then m0 else m1 = if b then (if b then m0) else m1
Exiting proof mode.

Goal if_else :
b = b' => if b then x else if b' then y else z = if b then x else z
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b,b':bool,x,y,z:'a
----------------------------------------
b = b' => if b then x else if b' then y else z = if b then x else z

[> Line 303: by ((intro);(case)) [goal> lemma if_else is proved

lemma if_else {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b,b':bool,x,y,z:'a),
b = b' => if b then x else if b' then y else z = if b then x else z
Exiting proof mode.

Goal if_else_inv :
if b then m0 else m1 = if b then m0 else if not b then m1
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool,m0,m1:message
----------------------------------------
if b then m0 else m1 = if b then m0 else if not b then m1

[> Line 308: by (case) [goal> lemma if_else_inv is proved

lemma if_else_inv {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool,m0,m1:message),
if b then m0 else m1 = if b then m0 else if not b then m1
Exiting proof mode.

Goal if_push :
if b then m0 else m1 = if b then (if b then m0) else if not b then m1
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: b:bool,m0,m1:message
----------------------------------------
if b then m0 else m1 = if b then (if b then m0) else if not b then m1

[> Line 312: by (rewrite) [goal> lemma if_push is proved

lemma if_push {'P:system} @system:(set:'P; equiv:None) :
forall (b:bool,m0,m1:message),
if b then m0 else m1 = if b then (if b then m0) else if not b then m1
Exiting proof mode.

Goal if_then_not :
b = not b' => if b then (if b' then x else y) else z = if b then y else z
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b,b':bool,x,y,z:'a
----------------------------------------
b = not b' => if b then (if b' then x else y) else z = if b then y else z

[> Line 320: by ((intro);(case)) [goal> lemma if_then_not is proved

lemma if_then_not {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b,b':bool,x,y,z:'a),
b = not b' => if b then (if b' then x else y) else z = if b then y else z
Exiting proof mode.

Goal if_else_not :
b = not b' => if b then x else if b' then y else z = if b then x else y
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: b,b':bool,x,y,z:'a
----------------------------------------
b = not b' => if b then x else if b' then y else z = if b then x else y

[> Line 329: by ((intro);(case)) [goal> lemma if_else_not is proved

lemma if_else_not {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (b,b':bool,x,y,z:'a),
b = not b' => if b then x else if b' then y else z = if b then x else y
Exiting proof mode.

Goal if_app :
f (if c then x else y) = if c then f x else f y
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: c:bool,f:'a -> 'b,x,y:'a
----------------------------------------
f (if c then x else y) = if c then f x else f y

[> Line 334: by (case) [goal> lemma if_app is proved

lemma if_app {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
forall (f:'a -> 'b,c:bool,x,y:'a),
f (if c then x else y) = if c then f x else f y
Exiting proof mode.

Goal fst_pair :
fst <x,y> = x
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x,y:message
----------------------------------------
fst <x,y> = x

[> Line 340: (auto) [goal> lemma fst_pair is proved

lemma fst_pair {'P:system} @system:(set:'P; equiv:None) :
forall (x,y:message), fst <x,y> = x
Exiting proof mode.

Goal snd_pair :
snd <x,y> = y
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x,y:message
----------------------------------------
snd <x,y> = y

[> Line 344: (auto) [goal> lemma snd_pair is proved

lemma snd_pair {'P:system} @system:(set:'P; equiv:None) :
forall (x,y:message), snd <x,y> = y
Exiting proof mode.

Goal iff_def :
(x <=> y) = ((x => y) && (y => x))
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x,y:bool
----------------------------------------
(x <=> y) = ((x => y) && (y => x))

[> Line 353: ((rewrite);(split)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x,y:bool[const]
----------------------------------------
x <=> y => (x => y) && (y => x)

[> Line 353: by (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x,y:bool[const]
----------------------------------------
(x => y) && (y => x) => x <=> y

[> Line 355: (auto) [goal> lemma iff_def is proved

lemma iff_def {'P:system} @system:(set:'P; equiv:None) :
forall (x,y:bool), (x <=> y) = ((x => y) && (y => x))
Exiting proof mode.

Goal iff_refl :
(x <=> x) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x:bool
----------------------------------------
(x <=> x) = true

[> Line 359: by (rewrite) [goal> lemma iff_refl is proved

lemma iff_refl {'P:system} @system:(set:'P; equiv:None) :
forall (x:bool), (x <=> x) = true
Exiting proof mode.

Goal iff_sym :
(x <=> y) = (y <=> x)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x,y:bool
----------------------------------------
(x <=> y) = (y <=> x)

[> Line 366: by (rewrite) [goal> lemma iff_sym is proved

lemma iff_sym {'P:system} @system:(set:'P; equiv:None) :
forall (x,y:bool), (x <=> y) = (y <=> x)
Exiting proof mode.

Goal true_iff_false :
(true <=> false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
----------------------------------------
(true <=> false) = false

[> Line 370: by (rewrite) [goal> lemma true_iff_false is proved

lemma true_iff_false {'P:system} @system:(set:'P; equiv:None) :
(true <=> false) = false
Exiting proof mode.

Goal false_iff_true :
(false <=> true) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
----------------------------------------
(false <=> true) = false

[> Line 376: by (rewrite) [goal> lemma false_iff_true is proved

lemma false_iff_true {'P:system} @system:(set:'P; equiv:None) :
(false <=> true) = false
Exiting proof mode.

Goal contra_iff :
(not x <=> y) = (x <=> not y)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x,y:bool
----------------------------------------
(not x <=> y) = (x <=> not y)

[> Line 384: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x,y:bool[const]
----------------------------------------
(not x <=> y) <=> (x <=> not y)

[> Line 385: ((split);by (rewrite)) [goal> lemma contra_iff is proved

lemma contra_iff {'P:system} @system:(set:'P; equiv:None) :
forall (x,y:bool), (not x <=> y) = (x <=> not y)
Exiting proof mode.

Goal exists_false1 :
(exists (a:'a), false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
----------------------------------------
(exists (a:'a), false) = false

[> Line 392: by (rewrite) [goal> lemma exists_false1 is proved

lemma exists_false1 {'P:system} @system:(set:'P; equiv:None) ['a] :
(exists (a:'a), false) = false
Exiting proof mode.

Goal exists_false2 :
(exists (a:'a,b:'b), false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
----------------------------------------
(exists (a:'a,b:'b), false) = false

[> Line 396: by (rewrite) [goal> lemma exists_false2 is proved

lemma exists_false2 {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
(exists (a:'a,b:'b), false) = false
Exiting proof mode.

Goal exists_false3 :
(exists (a:'a,b:'b,c:'c), false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b, 'c
----------------------------------------
(exists (a:'a,b:'b,c:'c), false) = false

[> Line 400: by (rewrite) [goal> lemma exists_false3 is proved

lemma exists_false3 {'P:system} @system:(set:'P; equiv:None) ['a 'b 'c] :
(exists (a:'a,b:'b,c:'c), false) = false
Exiting proof mode.

Goal exists_false4 :
(exists (a:'a,b:'b,c:'c,d:'d), false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b, 'c, 'd
----------------------------------------
(exists (a:'a,b:'b,c:'c,d:'d), false) = false

[> Line 404: by (rewrite) [goal> lemma exists_false4 is proved

lemma exists_false4 {'P:system} @system:(set:'P; equiv:None) ['a 'b 'c 'd] :
(exists (a:'a,b:'b,c:'c,d:'d), false) = false
Exiting proof mode.

Goal exists_false5 :
(exists (a:'a,b:'b,c:'c,d:'d,e:'e), false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b, 'c, 'd, 'e
----------------------------------------
(exists (a:'a,b:'b,c:'c,d:'d,e:'e), false) = false

[> Line 408: by (rewrite) [goal> lemma exists_false5 is proved

lemma exists_false5 {'P:system} @system:(set:'P; equiv:None)
['a 'b 'c 'd 'e] : (exists (a:'a,b:'b,c:'c,d:'d,e:'e), false) = false
Exiting proof mode.

Goal exists_false6 :
(exists (a:'a,b:'b,c:'c,d:'d,e:'e,f:'f), false) = false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b, 'c, 'd, 'e, 'f
----------------------------------------
(exists (a:'a,b:'b,c:'c,d:'d,e:'e,f:'f), false) = false

[> Line 412: by (rewrite) [goal> lemma exists_false6 is proved

lemma exists_false6 {'P:system} @system:(set:'P; equiv:None)
['a 'b 'c 'd 'e 'f] :
(exists (a:'a,b:'b,c:'c,d:'d,e:'e,f:'f), false) = false
Exiting proof mode.

Goal forall_true1 :
(forall (a:'a), true) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
----------------------------------------
(forall (a:'a), true) = true

[> Line 422: (auto) [goal> lemma forall_true1 is proved

lemma forall_true1 {'P:system} @system:(set:'P; equiv:None) ['a] :
(forall (a:'a), true) = true
Exiting proof mode.

Goal forall_true2 :
(forall (a:'a,b:'b), true) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
----------------------------------------
(forall (a:'a,b:'b), true) = true

[> Line 426: (auto) [goal> lemma forall_true2 is proved

lemma forall_true2 {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
(forall (a:'a,b:'b), true) = true
Exiting proof mode.

Goal forall_true3 :
(forall (a:'a,b:'b,c:'c), true) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b, 'c
----------------------------------------
(forall (a:'a,b:'b,c:'c), true) = true

[> Line 430: (auto) [goal> lemma forall_true3 is proved

lemma forall_true3 {'P:system} @system:(set:'P; equiv:None) ['a 'b 'c] :
(forall (a:'a,b:'b,c:'c), true) = true
Exiting proof mode.

Goal forall_true4 :
(forall (a:'a,b:'b,c:'c,d:'d), true) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b, 'c, 'd
----------------------------------------
(forall (a:'a,b:'b,c:'c,d:'d), true) = true

[> Line 434: (auto) [goal> lemma forall_true4 is proved

lemma forall_true4 {'P:system} @system:(set:'P; equiv:None) ['a 'b 'c 'd] :
(forall (a:'a,b:'b,c:'c,d:'d), true) = true
Exiting proof mode.

Goal forall_true5 :
(forall (a:'a,b:'b,c:'c,d:'d,e:'e), true) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b, 'c, 'd, 'e
----------------------------------------
(forall (a:'a,b:'b,c:'c,d:'d,e:'e), true) = true

[> Line 438: (auto) [goal> lemma forall_true5 is proved

lemma forall_true5 {'P:system} @system:(set:'P; equiv:None)
['a 'b 'c 'd 'e] : (forall (a:'a,b:'b,c:'c,d:'d,e:'e), true) = true
Exiting proof mode.

Goal forall_true6 :
(forall (a:'a,b:'b,c:'c,d:'d,e:'e,f:'f), true) = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b, 'c, 'd, 'e, 'f
----------------------------------------
(forall (a:'a,b:'b,c:'c,d:'d,e:'e,f:'f), true) = true

[> Line 442: (auto) [goal> lemma forall_true6 is proved

lemma forall_true6 {'P:system} @system:(set:'P; equiv:None)
['a 'b 'c 'd 'e 'f] : (forall (a:'a,b:'b,c:'c,d:'d,e:'e,f:'f), true) = true
Exiting proof mode.

axiom len_zeroes {'P:system} @system:(set:'P; equiv:None) :
forall (x:message), len (zeroes x) = len x
Goal f_apply :
x = y => f x = f y
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: f:'a -> 'b,x,y:'a
----------------------------------------
x = y => f x = f y

[> Line 455: by (intro) [goal> lemma f_apply is proved

lemma f_apply {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
forall (f:'a -> 'b,x,y:'a), x = y => f x = f y
Exiting proof mode.

Goal not_exists_1 :
not exists (a:'a), phi a = forall (a:'a), not (phi a)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool
----------------------------------------
not exists (a:'a), phi a = forall (a:'a), not (phi a)

[> Line 461: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool
----------------------------------------
not exists (a:'a), phi a <=> forall (a:'a), not (phi a)

[> Line 462: (split) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool
----------------------------------------
not exists (a:'a), phi a => forall (a:'a), not (phi a)

[> Line 463: (intro) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: a:'a,phi:'a -> bool
H: not exists (a:'a), phi a
Hp: phi a
----------------------------------------
false

[> Line 463: (apply) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: a:'a,phi:'a -> bool
H: not exists (a:'a), phi a
Hp: phi a
----------------------------------------
exists (a:'a), phi a

[> Line 465: by (exists) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool
----------------------------------------
(forall (a:'a), not (phi a)) => not exists (a:'a), phi a

[> Line 465: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: a:'a,phi:'a -> bool
H: forall (a:'a), not (phi a)
Hp: phi a
----------------------------------------
false

[> Line 467: by (have) [goal> lemma not_exists_1 is proved

lemma not_exists_1 {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (phi:'a -> bool),
not exists (a:'a), phi a = forall (a:'a), not (phi a)
Exiting proof mode.

Goal not_exists_2 :
not exists (a:'a,b:'b), phi a b = forall (a:'a,b:'b), not (phi a b)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
----------------------------------------
not exists (a:'a,b:'b), phi a b = forall (a:'a,b:'b), not (phi a b)

[> Line 473: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
----------------------------------------
not exists (a:'a,b:'b), phi a b <=> forall (a:'a,b:'b), not (phi a b)

[> Line 474: (split) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
----------------------------------------
not exists (a:'a,b:'b), phi a b => forall (a:'a,b:'b), not (phi a b)

[> Line 475: (intro) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: a:'a,b:'b,phi:'a -> 'b -> bool
H: not exists (a:'a,b:'b), phi a b
Hp: phi a b
----------------------------------------
false

[> Line 475: (apply) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: a:'a,b:'b,phi:'a -> 'b -> bool
H: not exists (a:'a,b:'b), phi a b
Hp: phi a b
----------------------------------------
exists (a:'a,b:'b), phi a b

[> Line 477: by (exists) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
----------------------------------------
(forall (a:'a,b:'b), not (phi a b)) => not exists (a:'a,b:'b), phi a b

[> Line 477: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: a:'a,b:'b,phi:'a -> 'b -> bool
H: forall (a:'a,b:'b), not (phi a b)
Hp: phi a b
----------------------------------------
false

[> Line 479: by (have) [goal> lemma not_exists_2 is proved

lemma not_exists_2 {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
forall (phi:'a -> 'b -> bool),
not exists (a:'a,b:'b), phi a b = forall (a:'a,b:'b), not (phi a b)
Exiting proof mode.

axiom not_forall_1 {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (phi:'a -> bool),
not forall (a:'a), phi a = exists (a:'a), not (phi a)
axiom not_forall_2 {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
forall (phi:'a -> 'b -> bool),
not forall (a:'a,b:'b), phi a b = exists (a:'a,b:'b), not (phi a b)
axiom try_carac_1 {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
forall (phi:'a -> bool,f:'a -> 'b,g:'b),
try find x:'a such that phi x in f x else g =
if (exists (x:'a), phi x) then f (choose phi) else g
Goal choose_spec :
phi x => phi (choose phi)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
----------------------------------------
phi x => phi (choose phi)

[> Line 505: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
phi (choose phi)

[> Line 508: (have) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
phi (choose phi) = if (exists (x:'a), phi x) then phi (choose phi) else false

[> Line 509: ?? [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
phi (choose phi) = if (exists (x:'a), phi x) then phi (choose phi) else false

[> Line 509: ((rewrite);(intro)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
exists (x:'a), phi x

[> Line 510: by (exists) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
if (exists (x:'a), phi x) then phi (choose phi) else false

[> Line 511: ?? [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
if (exists (x:'a), phi x) then phi (choose phi) else false

[> Line 512: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
try find x:'a such that phi x in phi x else false

[> Line 513: (case) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
(exists (x:'a),
phi x && try find x:'a such that phi x in phi x else false = phi x)
=> try find x:'a such that phi x in phi x else false

[> Line 514: (auto) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:'a -> bool,x:'a
H: phi x
----------------------------------------
(forall (x:'a), not (phi x)) &&
try find x:'a such that phi x in phi x else false = false =>
try find x:'a such that phi x in phi x else false

[> Line 515: ((intro);by (have)) [goal> lemma choose_spec is proved

lemma choose_spec {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (phi:'a -> bool,x:'a), phi x => phi (choose phi)
Exiting proof mode.

Goal try_choose :
phi x => try find x:'a such that phi x in f x else g = f (choose phi)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: f:'a -> 'b,g:'b,phi:'a -> bool,x:'a
----------------------------------------
phi x => try find x:'a such that phi x in f x else g = f (choose phi)

[> Line 524: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: f:'a -> 'b,g:'b,phi:'a -> bool,x:'a
H: phi x
----------------------------------------
try find x:'a such that phi x in f x else g = f (choose phi)

[> Line 525: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: f:'a -> 'b,g:'b,phi:'a -> bool,x:'a
H: phi x
----------------------------------------
if (exists (x:'a), phi x) then f (choose phi) else g = f (choose phi)

[> Line 526: ((rewrite);(intro)) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: f:'a -> 'b,g:'b,phi:'a -> bool,x:'a
H: phi x
----------------------------------------
exists (x:'a), phi x

[> Line 527: by (exists) [goal> lemma try_choose is proved

lemma try_choose {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
forall (phi:'a -> bool,f:'a -> 'b,g:'b,x:'a),
phi x => try find x:'a such that phi x in f x else g = f (choose phi)
Exiting proof mode.

Goal forall_exists :
(forall (x:'a), exists (y:'b), phi x y) =
exists (y':'a -> 'b), forall (x:'a), phi x (y' x)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
----------------------------------------
(forall (x:'a), exists (y:'b), phi x y) =
exists (y':'a -> 'b), forall (x:'a), phi x (y' x)

[> Line 536: ((rewrite);(split)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
----------------------------------------
(forall (x:'a), exists (y:'b), phi x y) =>
exists (y':'a -> 'b), forall (x:'a), phi x (y' x)

[> Line 537: (intro) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
H: forall (x:'a), exists (y:'b), phi x y
----------------------------------------
exists (y':'a -> 'b), forall (x:'a), phi x (y' x)

[> Line 538: (exists) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
H: forall (x:'a), exists (y:'b), phi x y
----------------------------------------
forall (x:'a), phi x ((fun (x:'a) => choose (fun (y:'b) => phi x y)) x)

[> Line 539: ((intro);(simpl)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool,x:'a
H: forall (x:'a), exists (y:'b), phi x y
----------------------------------------
phi x (choose (fun (y:'b) => phi x y))

[> Line 540: (have) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool,x:'a,y:'b
H: forall (x:'a), exists (y:'b), phi x y
Hy: phi x y
----------------------------------------
phi x (choose (fun (y:'b) => phi x y))

[> Line 544: ((have); 1: by (auto)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool,x:'a,y:'b
H: forall (x:'a), exists (y:'b), phi x y
Hy: phi x y
----------------------------------------
(fun (y:'b) => phi x y) (choose (fun (y:'b) => phi x y))

[> Line 545: (apply) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool,x:'a,y:'b
H: forall (x:'a), exists (y:'b), phi x y
Hy: phi x y
----------------------------------------
(fun (y:'b) => phi x y) y

[> Line 546: ((simpl);(assumption)) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool
----------------------------------------
(exists (y':'a -> 'b), forall (x:'a), phi x (y' x)) =>
forall (x:'a), exists (y:'b), phi x y

[> Line 547: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool,x:'a,y':'a -> 'b
H: forall (x:'a), phi x (y' x)
----------------------------------------
exists (y:'b), phi x y

[> Line 548: (exists) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a, 'b
Variables: phi:'a -> 'b -> bool,x:'a,y':'a -> 'b
H: forall (x:'a), phi x (y' x)
----------------------------------------
phi x (y' x)

[> Line 549: by (apply) [goal> lemma forall_exists is proved

lemma forall_exists {'P:system} @system:(set:'P; equiv:None) ['a 'b] :
forall (phi:'a -> 'b -> bool),
(forall (x:'a), exists (y:'b), phi x y) =
exists (y':'a -> 'b), forall (x:'a), phi x (y' x)
Exiting proof mode.

Goal implies_exists :
(phi => exists (j:'a), psi j) = exists (x:'a), phi => psi x
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool,psi:'a -> bool
----------------------------------------
(phi => exists (j:'a), psi j) = exists (x:'a), phi => psi x

[> Line 556: ((rewrite);(split)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool
----------------------------------------
(phi => exists (j:'a), psi j) => exists (x:'a), phi => psi x

[> Line 557: (intro) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool
H: phi => exists (j:'a), psi j
----------------------------------------
exists (x:'a), phi => psi x

[> Line 558: (case) [goal> Focused goal (1/3):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool
H: phi => exists (j:'a), psi j
----------------------------------------
phi => exists (x:'a), true => psi x

[> Line 559: (intro) [goal> Focused goal (1/3):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool
H: phi => exists (j:'a), psi j
phi: phi
----------------------------------------
exists (x:'a), true => psi x

[> Line 560: ((have); 1: by (apply)) [goal> Focused goal (1/3):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool,x:'a
H: phi => exists (j:'a), psi j
_: psi x
phi: phi
----------------------------------------
exists (x:'a), true => psi x

[> Line 561: by (exists) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool
H: phi => exists (j:'a), psi j
----------------------------------------
not phi => exists (x:'a), false => psi x

[> Line 562: (intro) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool
H: phi => exists (j:'a), psi j
_: not phi
----------------------------------------
exists (x:'a), false => psi x

[> Line 563: by (exists) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool
----------------------------------------
(exists (x:'a), phi => psi x) => phi => exists (j:'a), psi j

[> Line 564: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: phi:bool[const],psi:'a -> bool,x:'a
H: phi => psi x
H': phi
----------------------------------------
exists (j:'a), psi j

[> Line 565: by (exists) [goal> lemma implies_exists is proved

lemma implies_exists {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (phi:bool,psi:'a -> bool),
(phi => exists (j:'a), psi j) = exists (x:'a), phi => psi x
Exiting proof mode.

axiom le_trans {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y,z:'a), x <= y => y <= z => x <= z
axiom lt_trans {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y,z:'a), x < y => y < z => x < z
axiom lt_le_trans {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y,z:'a), x < y => y <= z => x < z
axiom le_lt_trans {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y,z:'a), x <= y => y < z => x < z
axiom lt_charac {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), x < y <=> x <> y && x <= y
axiom le_not_lt_impl_eq {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), x <= y => not (x < y) => x = y
Goal lt_impl_le :
x < y => x <= y
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x,y:'a
----------------------------------------
x < y => x <= y

[> Line 580: by (rewrite) [goal> lemma lt_impl_le is proved

lemma lt_impl_le {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), x < y => x <= y
Exiting proof mode.

Goal not_lt_refl :
not (x < x)
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x:'a
----------------------------------------
not (x < x)

[> Line 583: (auto) [goal> lemma not_lt_refl is proved

lemma not_lt_refl {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x:'a), not (x < x)
Exiting proof mode.

Goal lt_irrefl :
x < x <=> false
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Type variables: 'a
Variables: x:'a
----------------------------------------
x < x <=> false

[> Line 586: (auto) [goal> lemma lt_irrefl is proved

lemma lt_irrefl {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x:'a), x < x <=> false
Exiting proof mode.

axiom le_impl_eq_lt {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,y:'a), x <= y => x = y || x < y
axiom le_refl_index {'P:system} @system:(set:'P; equiv:None) :
forall (x:index), x <= x
Goal le_refl_index_eq :
x <= x = true
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: x:index
----------------------------------------
x <= x = true

[> Line 599: by (rewrite) [goal> lemma le_refl_index_eq is proved

lemma le_refl_index_eq {'P:system} @system:(set:'P; equiv:None) :
forall (x:index), x <= x = true
Exiting proof mode.

Goal le_pred_lt :
t <= pred t' = t < t'
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: t,t':timestamp
----------------------------------------
t <= pred t' = t < t'

[> Line 603: by (rewrite) [goal> lemma le_pred_lt is proved

lemma le_pred_lt {'P:system} @system:(set:'P; equiv:None) :
forall (t,t':timestamp), t <= pred t' = t < t'
Exiting proof mode.

Goal neq_le_pred_le :
t <> t' => t <= t' = t <= pred t'
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: t,t':timestamp
----------------------------------------
t <> t' => t <= t' = t <= pred t'

[> Line 607: by (rewrite) [goal> lemma neq_le_pred_le is proved

lemma neq_le_pred_le {'P:system} @system:(set:'P; equiv:None) :
forall (t,t':timestamp), t <> t' => t <= t' = t <= pred t'
Exiting proof mode.

axiom le_lt {'P:system} @system:(set:'P; equiv:None) ['a] :
forall (x,x':'a), x <> x' => x <= x' = x < x'
[warning>Loaded "Logic.sp".
<]axiom empty_set_is_empty {'P:system} @system:(set:'P; equiv:None) :
forall (x:message), not (mem x empty_set)
[warning>Loaded "Set.sp".
<]new predicate:
predicate (|>) {set:system} ['a 'b] {set: u:'a,m:'b} =
Exists (f:'a -> 'b[adv, glob]), [f u = m]
new predicate:
predicate (|1>) {set:system} ['a 'b 'c] {set: u:'a -> 'b,m:'a -> 'c} =
Exists (f:'b -> 'c[adv, glob]), [forall (x:'a), f (u x) = m x]
[warning>Loaded "DeductionSyntax.sp".
<]Goal unnamed1 :
forall u:'b[glob],v:'a -> 'c[glob],
Let u0 = fun (_x:'a) => u in
$(u0 |1>{Empty} fun (x:'a) => v x) -> $(u |>{Empty} fun (x:'a) => v x)
[goal> Focused goal (1/1):
Systems: Empty
Type variables: 'a, 'b, 'c
Variables: u:'b[glob],v:'a -> 'c[glob]
----------------------------------------
Let u0 = fun (_x:'a) => u in
$(u0 |1> fun (x:'a) => v x) -> $(u |> fun (x:'a) => v x)

[> Line 11: (intro) [goal> Focused goal (1/1):
Systems: Empty
Type variables: 'a, 'b, 'c
Variables: u:'b[glob],v:'a -> 'c[glob]
H: $(u0 |1> fun (x:'a) => v x)
u0 := fun (_x:'a) => u
----------------------------------------
$(u |> fun (x:'a) => v x)

[> Line 12: (rewrite) [goal> Focused goal (1/1):
Systems: Empty
Type variables: 'a, 'b, 'c
Variables: u:'b[glob],v:'a -> 'c[glob]
H: $(u0 |1> fun (x:'a) => v x)
u0 := fun (_x:'a) => u
----------------------------------------
Exists (f:'b -> 'a -> 'c[adv, glob]), [f u = (fun (x:'a) => v x)]

[> Line 13: (rewrite) [goal> Focused goal (1/1):
Systems: Empty
Type variables: 'a, 'b, 'c
Variables: u:'b[glob],v:'a -> 'c[glob]
H: Exists (f:'b -> 'c[adv, glob]),
[forall (x:'a), f (u0 x) = (fun (x:'a) => v x) x]
u0 := fun (_x:'a) => u
----------------------------------------
Exists (f:'b -> 'a -> 'c[adv, glob]), [f u = (fun (x:'a) => v x)]

[> Line 14: (destruct) [goal> Focused goal (1/1):
Systems: Empty
Type variables: 'a, 'b, 'c
Variables: f:'b -> 'c[adv, glob],u:'b[glob],v:'a -> 'c[glob]
H: [forall (x:'a), f (u0 x) = (fun (x:'a) => v x) x]
u0 := fun (_x:'a) => u
----------------------------------------
Exists (f:'b -> 'a -> 'c[adv, glob]), [f u = (fun (x:'a) => v x)]

[> Line 14: ((exists);(intro)) [goal> Focused goal (1/1):
System: Empty
Type variables: 'a, 'b, 'c
Variables: f:'b -> 'c[adv, glob],u:'b[glob],v:'a -> 'c[glob]
H: [forall (x:'a), f (u0 x) = v x]
u0 := fun (_x:'a) => u
----------------------------------------
(fun (x:'a) => f u) = (fun (x:'a) => v x)

[> Line 16: ((apply);(intro)) [goal> Focused goal (1/1):
System: Empty
Type variables: 'a, 'b, 'c
Variables: f:'b -> 'c[adv, glob],u:'b[glob],v:'a -> 'c[glob],x:'a
H: [forall (x:'a), f (u0 x) = v x]
u0 := fun (_x:'a) => u
----------------------------------------
f u = v x

[> Line 17: (rewrite) [goal> Focused goal (1/1):
System: Empty
Type variables: 'a, 'b, 'c
Variables: f:'b -> 'c[adv, glob],u:'b[glob],v:'a -> 'c[glob],x:'a
H: [forall (x:'a), f u = v x]
u0 := fun (_x:'a) => u
----------------------------------------
f u = v x

[> Line 18: (apply) [goal> lemma unnamed1 is proved

global lemma unnamed1 @system:Empty ['a 'b 'c] :
Forall (u:'b[glob],v:'a -> 'c[glob]),
Let u0 = fun (_x:'a) => u in
$(u0 |1>{Empty} fun (x:'a) => v x) -> $(u |>{Empty} fun (x:'a) => v x)
Exiting proof mode.

global axiom frame_from_frame {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => frame@t |1>{P}
fun (t,t':timestamp) => if (t' <= t) then frame@t')
New deduction hint frame_from_frame :
∀{P:system} , @system:(P), ∀ x ⊢ frame@x ▷ λ t' ⇒ (frame@t' |
t' <= x)
global axiom exec_from_frame {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => frame@t |1>{P}
fun (t,t':timestamp) => if (t' <= t) then exec@t' else witness)
New deduction hint exec_from_frame :
∀{P:system} , @system:(P), ∀ x ⊢ frame@x ▷ λ t' ⇒ (exec@t' |
t' <= x)
global axiom output_from_frame {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => frame@t |1>{P}
fun (t,t':timestamp) => if (t' <= t && exec@t') then output@t')
New deduction hint output_from_frame :
∀{P:system} , @system:(P), ∀ x ⊢ frame@x ▷ λ t' ⇒ (output@t' |
t' <= x && exec@t')
global axiom input_from_frame {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => frame@t |1>{P}
fun (t,t':timestamp) => if (pred t' <= t) then input@t')
New deduction hint input_from_frame :
∀{P:system} , @system:(P), ∀ x ⊢ frame@x ▷ λ t' ⇒ (input@t' |
pred t' <= x)
global axiom exec_from_frame {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => frame@t |1>{P}
fun (t,t':timestamp) => if (t' <= t) then exec@t' else witness)
New deduction hint exec_from_frame :
∀{P:system} , @system:(P), ∀ x ⊢ frame@x ▷ λ t' ⇒ (exec@t' |
t' <= x)
global axiom output_from_frame {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => frame@t |1>{P}
fun (t,t':timestamp) => if (t' <= t && exec@t') then output@t')
New deduction hint output_from_frame :
∀{P:system} , @system:(P), ∀ x ⊢ frame@x ▷ λ t' ⇒ (output@t' |
t' <= x && exec@t')
global axiom input_from_frame {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => frame@t |1>{P}
fun (t,t':timestamp) => if (pred t' <= t) then input@t')
New deduction hint input_from_frame :
∀{P:system} , @system:(P), ∀ x ⊢ frame@x ▷ λ t' ⇒ (input@t' |
pred t' <= x)
global axiom transcript_from_frame {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => frame@t |1>{P}
fun (t,t':timestamp) => if (t' <= t) then transcript@t')
New deduction hint transcript_from_frame :
∀{P:system} , @system:(P), ∀ x ⊢ frame@x ▷ λ t' ⇒ (transcript@t' |
t' <= x)
global axiom transcript_from_transcript {P:system}
@system:(set:P; equiv:None) :
$(fun (t:timestamp) => transcript@t |1>{P}
fun (t,t':timestamp) => if (t' <= t) then transcript@t')
New deduction hint transcript_from_transcript :
∀{P:system} , @system:(P), ∀ x ⊢ transcript@x ▷ λ t' ⇒ (
transcript@t' |
t' <= x)
global axiom exec_from_transcript {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => transcript@t |1>{P}
fun (t,t':timestamp) => if (t' <= t) then exec@t' else witness)
New deduction hint exec_from_transcript :
∀{P:system} , @system:(P), ∀ x ⊢ transcript@x ▷ λ t' ⇒ (
exec@t' | t' <= x)
global axiom output_from_transcript {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => transcript@t |1>{P}
fun (t,t':timestamp) => if (t' <= t && exec@t') then output@t')
New deduction hint output_from_transcript :
∀{P:system} , @system:(P), ∀ x ⊢ transcript@x ▷ λ t' ⇒ (
output@t' |
t' <= x && exec@t')
global axiom input_from_transcript {P:system} @system:(set:P; equiv:None) :
$(fun (t:timestamp) => transcript@t |1>{P}
fun (t,t':timestamp) => if (pred t' <= t) then input@t')
New deduction hint input_from_transcript :
∀{P:system} , @system:(P), ∀ x ⊢ transcript@x ▷ λ t' ⇒ (
input@t' |
pred t' <= x)
[warning>Loaded "Deduction.sp".
<]axiom exec_not_init {'P:system} @system:(set:'P; equiv:None) :
forall (tau:timestamp),
init < tau => exec@tau = (exec@pred tau && cond@tau)
axiom exec_init {'P:system} @system:(set:'P; equiv:None) :
forall (tau:timestamp), tau = init => exec@tau = true
axiom cond_init {'P:system} @system:(set:'P; equiv:None) :
forall (tau:timestamp), tau = init => cond@tau = true
Goal exec_le :
tau' <= tau => exec@tau => exec@tau'
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau,tau':timestamp
----------------------------------------
tau' <= tau => exec@tau => exec@tau'

[> Line 17: ((induction);(intro)) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau,tau':timestamp[const]
Hexec: exec@tau
Hle: tau' <= tau
IH: forall (tau0:timestamp),
tau0 < tau => tau' <= tau0 => exec@tau0 => exec@tau'
----------------------------------------
exec@tau'

[> Line 18: (case) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau,tau':timestamp[const]
Hexec: exec@tau
Hle: tau' <= tau
IH: forall (tau0:timestamp),
tau0 < tau => tau' <= tau0 => exec@tau0 => exec@tau'
----------------------------------------
tau = tau' => exec@tau'

[> Line 19: (auto) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau,tau':timestamp[const]
Hexec: exec@tau
Hle: tau' <= tau
IH: forall (tau0:timestamp),
tau0 < tau => tau' <= tau0 => exec@tau0 => exec@tau'
----------------------------------------
not (tau = tau') => exec@tau'

[> Line 20: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau,tau':timestamp[const]
Hexec: exec@tau
Hle: tau' <= tau
Hneq: not (tau = tau')
IH: forall (tau0:timestamp),
tau0 < tau => tau' <= tau0 => exec@tau0 => exec@tau'
----------------------------------------
exec@tau'

[> Line 21: (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau,tau':timestamp[const]
Hexec: exec@pred tau && cond@tau
Hle: tau' <= tau
Hneq: not (tau = tau')
IH: forall (tau0:timestamp),
tau0 < tau => tau' <= tau0 => exec@tau0 => exec@tau'
----------------------------------------
exec@tau'

[> Line 22: by (apply) [goal> lemma exec_le is proved

lemma exec_le {'P:system} @system:(set:'P; equiv:None) :
forall (tau,tau':timestamp), tau' <= tau => exec@tau => exec@tau'
Exiting proof mode.

Goal exec_cond :
happens(tau) => exec@tau => cond@tau
[goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau:timestamp
----------------------------------------
happens(tau) => exec@tau => cond@tau

[> Line 27: (intro) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau:timestamp[const]
Hap: happens(tau)
Hexec: exec@tau
----------------------------------------
cond@tau

[> Line 28: ((case);(intro)) [goal> Focused goal (1/2):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau:timestamp[const]
Hap: happens(tau)
Hexec: exec@tau
_: init < tau
----------------------------------------
cond@tau

[> Line 29: by (rewrite) [goal> Focused goal (1/1):
System variables: 'P
System: (set:'P; equiv:None)
Variables: tau:timestamp[const]
Hap: happens(tau)
Hexec: exec@tau
_: not (init < tau)
----------------------------------------
cond@tau

[> Line 30: by (rewrite) [goal> lemma exec_cond is proved

lemma exec_cond {'P:system} @system:(set:'P; equiv:None) :
forall (tau:timestamp), happens(tau) => exec@tau => cond@tau
Exiting proof mode.

axiom executability {'P:system} @system:(set:'P; equiv:None) :
forall (t:timestamp),
happens(t) => exec@t => forall (t0:timestamp), t0 <= t => exec@t0
[warning>Loaded "Classic.sp".
<][warning>Loaded "Core.sp".
<]


(* AXIOMS *)

(* We assume that the attacker never repeats a query to the oracle. *)

axiom unique_queries (i,j:index) : i <> j => input@O(i) <> input@O(j).
axiom unique_queries @system:(set:default; equiv:None) :
forall (i,j:index), i <> j => input@O(i) <> input@O(j)


(* HELPING LEMMAS *)

(* See `running-ex.sp` for more details about lastupdate_XXX lemmas. *)

global lemma lastupdate_pure_glob :
Forall (i:index[const], tau:timestamp[const]),
[happens(tau)] -> (
[forall (j:index), happens(A(i,j)) => A(i,j)>tau] \/
(Exists (j:index[const]),
[happens(A(i,j)) && A(i,j) <= tau] /\
[forall (jj:index), happens(A(i,jj)) && A(i,jj)<=tau => A(i,jj)<=A(i,j)])).
Goal lastupdate_pure_glob :
Forall (i:index[const, glob],tau:timestamp[const, glob]),
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]

Proof.
[goal> Focused goal (1/1):
Systems: default
----------------------------------------
Forall (i:index[const, glob],tau:timestamp[const, glob]),
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]



intro i.
[> Line 69: (intro) [goal> Focused goal (1/1):
Systems: default
Variables: i:index[const, glob]
----------------------------------------
Forall (tau:timestamp[const, glob]),
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]



dependent induction => tau IH Hp.
[> Line 70: ((dependent induction);(intro)) [goal> Focused goal (1/1):
Systems: default
Variables: i:index[const, glob],tau:timestamp[const, glob]
Hp: [happens(tau)]
IH: Forall (tau0:timestamp[const, glob]),
[tau0 < tau] ->
[happens(tau0)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau0] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau0] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau0 => A(i, jj) <= A(i, j)]
----------------------------------------
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]



case tau.
[> Line 71: (case) [goal> Focused goal (1/3):
Systems: default
Variables: i:index[const, glob],tau:timestamp[const, glob]
Hp: [happens(tau)]
IH: Forall (tau0:timestamp[const, glob]),
[tau0 < tau] ->
[happens(tau0)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau0] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau0] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau0 => A(i, jj) <= A(i, j)]
----------------------------------------
[tau = init] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > init] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= init] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= init => A(i, jj) <= A(i, j)]




+ (* init *)
intro Eq; by left.
[> Line 74: ((intro);by (left)) [goal> Focused goal (1/2):
Systems: default
Variables: i:index[const, glob],tau:timestamp[const, glob]
Hp: [happens(tau)]
IH: Forall (tau0:timestamp[const, glob]),
[tau0 < tau] ->
[happens(tau0)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau0] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau0] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau0 => A(i, jj) <= A(i, j)]
----------------------------------------
(Exists (j:index[const, adv, glob]), [tau = O(j)]) ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]




+ (* O(i) *)
intro [j Eq]; rewrite Eq in *; clear Eq.
[> Line 77: ((intro);((rewrite);(clear))) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],j:index[const, adv, glob],tau:timestamp[const, glob]
Hp: [happens(O(j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > O(j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= O(j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= O(j) => A(i, jj) <= A(i, j0)]



use IH with pred(O(j)) => //.
[> Line 78: ((have);(intro)) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],j:index[const, adv, glob],tau:timestamp[const, glob]
H: [forall (j0:index), happens(A(i, j0)) => A(i, j0) > pred (O(j))] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= pred (O(j))] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (O(j)) => A(i, jj) <= A(i, j0)]
Hp: [happens(O(j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > O(j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= O(j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= O(j) => A(i, jj) <= A(i, j0)]



destruct H as [H1 | [j0 H2]].
[> Line 79: (destruct) [goal> Focused goal (1/3):
Systems: default
Variables:
i:index[const, glob],j:index[const, adv, glob],tau:timestamp[const, glob]
H1: [forall (j0:index), happens(A(i, j0)) => A(i, j0) > pred (O(j))]
Hp: [happens(O(j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > O(j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= O(j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= O(j) => A(i, jj) <= A(i, j0)]



- left; intro j0 HpA; by use H1 with j0.
[> Line 80: ((left);((intro);by (have))) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],j:index[const, adv, glob],j0:index[const, glob],
tau:timestamp[const, glob]
H2: [happens(A(i, j0)) && A(i, j0) <= pred (O(j))] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (O(j)) => A(i, jj) <= A(i, j0)]
Hp: [happens(O(j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > O(j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= O(j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= O(j) => A(i, jj) <= A(i, j0)]



- right.
[> Line 81: (right) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],j:index[const, adv, glob],j0:index[const, glob],
tau:timestamp[const, glob]
H2: [happens(A(i, j0)) && A(i, j0) <= pred (O(j))] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (O(j)) => A(i, jj) <= A(i, j0)]
Hp: [happens(O(j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
----------------------------------------
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= O(j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= O(j) => A(i, jj) <= A(i, j0)]



destruct H2 as [[_ _] H2].
[> Line 82: (destruct) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],j:index[const, adv, glob],j0:index[const, glob],
tau:timestamp[const, glob]
H2: [forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (O(j)) => A(i, jj) <= A(i, j0)]
Hp: [happens(O(j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
_: [A(i, j0) <= pred (O(j))]
_: [happens(A(i, j0))]
----------------------------------------
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= O(j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= O(j) => A(i, jj) <= A(i, j0)]



exists j0.
[> Line 82: (exists) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],j:index[const, adv, glob],j0:index[const, glob],
tau:timestamp[const, glob]
H2: [forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (O(j)) => A(i, jj) <= A(i, j0)]
Hp: [happens(O(j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
_: [A(i, j0) <= pred (O(j))]
_: [happens(A(i, j0))]
----------------------------------------
[happens(A(i, j0)) && A(i, j0) <= O(j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= O(j) => A(i, jj) <= A(i, j0)]



split; 1: auto.
[> Line 83: ((split); 1: (auto)) [goal> Focused goal (1/2):
System: default
Variables:
i:index[const, glob],j:index[const, adv, glob],j0:index[const, glob],
tau:timestamp[const, glob]
H2: [forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (O(j)) => A(i, jj) <= A(i, j0)]
Hp: [happens(O(j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
_: [happens(A(i, j0))]
_: [A(i, j0) <= pred (O(j))]
----------------------------------------
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= O(j) => A(i, jj) <= A(i, j0)



intro /= jj Hyp.
[> Line 85: (intro) [goal> Focused goal (1/2):
System: default
Variables:
i:index[const, glob],j:index[const, adv, glob],j0:index[const, glob],
jj:index[const],tau:timestamp[const, glob]
H2: [forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (O(j)) => A(i, jj) <= A(i, j0)]
Hp: [happens(O(j))]
Hyp: happens(A(i, jj)) && A(i, jj) <= O(j)
IH: Forall (tau:timestamp[const, glob]),
[tau < O(j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
_: [happens(A(i, j0))]
_: [A(i, j0) <= pred (O(j))]
----------------------------------------
A(i, jj) <= A(i, j0)


by apply H2.
[> Line 86: by (apply) [goal> Focused goal (1/1):
Systems: default
Variables: i:index[const, glob],tau:timestamp[const, glob]
Hp: [happens(tau)]
IH: Forall (tau0:timestamp[const, glob]),
[tau0 < tau] ->
[happens(tau0)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau0] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau0] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau0 => A(i, jj) <= A(i, j)]
----------------------------------------
(Exists (i0,j:index[const, adv, glob]), [tau = A(i0, j)]) ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]




+ (* A(i0,j) *)
intro [i0 j Eq]; rewrite Eq in *; clear Eq.
[> Line 89: ((intro);((rewrite);(clear))) [goal> Focused goal (1/1):
Systems: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],
tau:timestamp[const, glob]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > A(i0, j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= A(i0, j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j0)]



ghave [Neq | Eq] : [i <> i0 || i = i0]; 1:auto.
[> Line 89: ((have); 1: (auto)) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],
tau:timestamp[const, glob]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
Neq: [i <> i0]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > A(i0, j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= A(i0, j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j0)]



- (* 1st case: i<>i0 *)
use IH with pred(A(i0,j)) => //.
[> Line 92: ((have);(intro)) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],
tau:timestamp[const, glob]
H: [forall (j0:index), happens(A(i, j0)) => A(i, j0) > pred (A(i0, j))] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= pred (A(i0, j))] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i0, j)) =>
A(i, jj) <= A(i, j0)]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
Neq: [i <> i0]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > A(i0, j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= A(i0, j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j0)]



destruct H as [H1 | [j0 H2]].
[> Line 93: (destruct) [goal> Focused goal (1/3):
Systems: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],
tau:timestamp[const, glob]
H1: [forall (j0:index), happens(A(i, j0)) => A(i, j0) > pred (A(i0, j))]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
Neq: [i <> i0]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > A(i0, j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= A(i0, j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j0)]



* left; intro j0 HpA; by use H1 with j0.
[> Line 94: ((left);((intro);by (have))) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],j0:index[const, glob],
tau:timestamp[const, glob]
H2: [happens(A(i, j0)) && A(i, j0) <= pred (A(i0, j))] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i0, j)) =>
A(i, jj) <= A(i, j0)]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
Neq: [i <> i0]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > A(i0, j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= A(i0, j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j0)]



* right; destruct H2 as [[_ _] H2]; exists j0.
[> Line 95: ((right);((destruct);(exists))) [goal> Focused goal (1/2):
Systems: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],j0:index[const, glob],
tau:timestamp[const, glob]
H2: [forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i0, j)) =>
A(i, jj) <= A(i, j0)]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
Neq: [i <> i0]
_: [A(i, j0) <= pred (A(i0, j))]
_: [happens(A(i, j0))]
----------------------------------------
[happens(A(i, j0)) && A(i, j0) <= A(i0, j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j0)]



split; 1:auto.
[> Line 96: ((split); 1: (auto)) [goal> Focused goal (1/2):
System: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],j0:index[const, glob],
tau:timestamp[const, glob]
H2: [forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i0, j)) =>
A(i, jj) <= A(i, j0)]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
Neq: [i <> i0]
_: [happens(A(i, j0))]
_: [A(i, j0) <= pred (A(i0, j))]
----------------------------------------
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j0)



intro /= jj Hyp.
[> Line 97: (intro) [goal> Focused goal (1/2):
System: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],j0:index[const, glob],
jj:index[const],tau:timestamp[const, glob]
H2: [forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i0, j)) =>
A(i, jj) <= A(i, j0)]
Hp: [happens(A(i0, j))]
Hyp: happens(A(i, jj)) && A(i, jj) <= A(i0, j)
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
Neq: [i <> i0]
_: [happens(A(i, j0))]
_: [A(i, j0) <= pred (A(i0, j))]
----------------------------------------
A(i, jj) <= A(i, j0)


by apply H2.
[> Line 98: by (apply) [goal> Focused goal (1/1):
Systems: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],
tau:timestamp[const, glob]
Eq: [i = i0]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
----------------------------------------
[forall (j0:index), happens(A(i, j0)) => A(i, j0) > A(i0, j)] \/
Exists (j0:index[const, glob]),
[happens(A(i, j0)) && A(i, j0) <= A(i0, j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j0)]




- (* 2nd case: i<>i0 *)
right; exists j.
[> Line 100: ((right);(exists)) [goal> Focused goal (1/1):
Systems: default
Variables:
i:index[const, glob],i0,j:index[const, adv, glob],
tau:timestamp[const, glob]
Eq: [i = i0]
Hp: [happens(A(i0, j))]
IH: Forall (tau:timestamp[const, glob]),
[tau < A(i0, j)] ->
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
----------------------------------------
[happens(A(i, j)) && A(i, j) <= A(i0, j)] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= A(i0, j) => A(i, jj) <= A(i, j)]



by split.
[> Line 102: by (split) [goal> lemma lastupdate_pure_glob is proved


Qed.
global lemma lastupdate_pure_glob @system:default :
Forall (i:index[const, glob],tau:timestamp[const, glob]),
[happens(tau)] ->
[forall (j:index), happens(A(i, j)) => A(i, j) > tau] \/
Exists (j:index[const, glob]),
[happens(A(i, j)) && A(i, j) <= tau] /\
[forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)]
Exiting proof mode.



lemma lastupdate_init : forall (i:index,tau:timestamp), happens(tau) => (
(forall j, happens(A(i,j)) => A(i,j)>tau))
=> s(i)@tau = s(i)@init.
Goal lastupdate_init :
forall (i:index,tau:timestamp),
happens(tau) =>
(forall (j:index), happens(A(i, j)) => A(i, j) > tau) =>
s i@tau = s i@init


Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
----------------------------------------
forall (i:index,tau:timestamp),
happens(tau) =>
(forall (j:index), happens(A(i, j)) => A(i, j) > tau) => s i@tau = s i@init



intro i.
[> Line 110: (intro) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i:index[const]
----------------------------------------
forall (tau:timestamp),
happens(tau) =>
(forall (j:index), happens(A(i, j)) => A(i, j) > tau) => s i@tau = s i@init



induction.
[> Line 111: (induction) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i:index[const]
----------------------------------------
forall (tau:timestamp),
(forall (tau0:timestamp),
tau0 < tau =>
happens(tau0) =>
(forall (j:index), happens(A(i, j)) => A(i, j) > tau0) =>
s i@tau0 = s i@init) =>
happens(tau) =>
(forall (j:index), happens(A(i, j)) => A(i, j) > tau) => s i@tau = s i@init



smt.
[> Line 111: (smt) [goal> lemma lastupdate_init is proved


Qed.
lemma lastupdate_init @system:(set:default; equiv:None) :
forall (i:index,tau:timestamp),
happens(tau) =>
(forall (j:index), happens(A(i, j)) => A(i, j) > tau) =>
s i@tau = s i@init
Exiting proof mode.




lemma lastupdate_A: forall (i:index, j:index, tau:timestamp),
(happens(tau) &&
A(i,j)<=tau &&
forall jj, happens(A(i,jj)) && A(i,jj)<=tau => A(i,jj)<=A(i,j))
=> s(i)@tau = s(i)@A(i,j).
Goal lastupdate_A :
forall (i,j:index,tau:timestamp),
happens(tau) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j) =>
s i@tau = s i@A(i, j)

Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
----------------------------------------
forall (i,j:index,tau:timestamp),
happens(tau) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j) =>
s i@tau = s i@A(i, j)



intro i j.
[> Line 122: (intro) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const]
----------------------------------------
forall (tau:timestamp),
happens(tau) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j) =>
s i@tau = s i@A(i, j)



induction.
[> Line 123: (induction) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const]
----------------------------------------
forall (tau:timestamp),
(forall (tau0:timestamp),
tau0 < tau =>
happens(tau0) &&
A(i, j) <= tau0 &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau0 => A(i, jj) <= A(i, j) =>
s i@tau0 = s i@A(i, j)) =>
happens(tau) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j) =>
s i@tau = s i@A(i, j)



smt.
[> Line 123: (smt) [goal> lemma lastupdate_A is proved


Qed.
lemma lastupdate_A @system:(set:default; equiv:None) :
forall (i,j:index,tau:timestamp),
happens(tau) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j) =>
s i@tau = s i@A(i, j)
Exiting proof mode.




lemma lastupdate : forall (i:index,tau:timestamp), happens(tau) => (
(s(i)@tau = s(i)@init && forall j, happens(A(i,j)) => A(i,j)>tau) ||
(exists j,
s(i)@tau = s(i)@A(i,j) && A(i,j)<=tau
&& forall jj, happens(A(i,jj)) && A(i,jj)<=tau => A(i,jj)<=A(i,j))).
Goal lastupdate :
forall (i:index,tau:timestamp),
happens(tau) =>
s i@tau = s i@init && forall (j:index), happens(A(i, j)) => A(i, j) > tau
||
exists (j:index),
s i@tau = s i@A(i, j) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)

Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
----------------------------------------
forall (i:index,tau:timestamp),
happens(tau) =>
s i@tau = s i@init && forall (j:index), happens(A(i, j)) => A(i, j) > tau
||
exists (j:index),
s i@tau = s i@A(i, j) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)



intro i tau.
[> Line 133: (intro) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i:index[const],tau:timestamp[const]
----------------------------------------
happens(tau) =>
s i@tau = s i@init && forall (j:index), happens(A(i, j)) => A(i, j) > tau
||
exists (j:index),
s i@tau = s i@A(i, j) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)



induction tau.
[> Line 135: (induction) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i:index[const]
----------------------------------------
forall (tau:timestamp),
(forall (tau0:timestamp),
tau0 < tau =>
happens(tau0) =>
s i@tau0 = s i@init &&
forall (j:index), happens(A(i, j)) => A(i, j) > tau0 ||
exists (j:index),
s i@tau0 = s i@A(i, j) &&
A(i, j) <= tau0 &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau0 => A(i, jj) <= A(i, j))
=>
happens(tau) =>
s i@tau = s i@init && forall (j:index), happens(A(i, j)) => A(i, j) > tau
||
exists (j:index),
s i@tau = s i@A(i, j) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)



smt ~prover:Z3_noBV.
[> Line 136: (smt) [goal> lemma lastupdate is proved


Qed.
lemma lastupdate @system:(set:default; equiv:None) :
forall (i:index,tau:timestamp),
happens(tau) =>
s i@tau = s i@init && forall (j:index), happens(A(i, j)) => A(i, j) > tau
||
exists (j:index),
s i@tau = s i@A(i, j) &&
A(i, j) <= tau &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)
Exiting proof mode.

lemma disjoint_chains :
forall (tau',tau:timestamp,i',i:index), happens(tau',tau) =>
i<>i' =>
s(i)@tau <> s(i')@tau'.
Goal disjoint_chains :
forall (tau',tau:timestamp,i',i:index),
happens(tau, tau') => i <> i' => s i@tau <> s i'@tau'

The contents of distinct memory cells never coincide.


Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
----------------------------------------
forall (tau',tau:timestamp,i',i:index),
happens(tau, tau') => i <> i' => s i@tau <> s i'@tau'



induction => tau' IH tau i' i D E Meq.
[> Line 146: ((induction);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,i':index[const],tau,tau':timestamp[const]
D: happens(tau, tau')
E: i <> i'
IH: forall (tau'0,tau:timestamp,i',i:index),
tau'0 < tau' => happens(tau, tau'0) => i <> i' => s i@tau <> s i'@tau'0
Meq: s i@tau = s i'@tau'
----------------------------------------
false


use lastupdate with i,tau as [[A0 Hinit] | [j [A0 A1 Hsup]]] => //;
use lastupdate with i',tau' as [[A Hinit'] | [j' [B C Hsup']]] => //.
[> Line 148: ((((have);(intro));(have));(intro)) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: i,i',j':index[const],tau,tau':timestamp[const]
A0: s i@tau = s i@init
B: s i'@tau' = s i'@A(i', j')
C: A(i', j') <= tau'
D: happens(tau, tau')
E: i <> i'
Hinit: forall (j:index), happens(A(i, j)) => A(i, j) > tau
Hsup': forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j')
IH: forall (tau'0,tau:timestamp,i',i:index),
tau'0 < tau' => happens(tau, tau'0) => i <> i' => s i@tau <> s i'@tau'0
Meq: s i@tau = s i'@tau'
----------------------------------------
false



+ rewrite -Meq A0 /s in B.
[> Line 150: (rewrite) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: i,i',j':index[const],tau,tau':timestamp[const]
A0: s i@tau = s i@init
B: s0 i = H (s i'@pred (A(i', j')), k)
C: A(i', j') <= tau'
D: happens(tau, tau')
E: i <> i'
Hinit: forall (j:index), happens(A(i, j)) => A(i, j) > tau
Hsup': forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j')
IH: forall (tau'0,tau:timestamp,i',i:index),
tau'0 < tau' => happens(tau, tau'0) => i <> i' => s i@tau <> s i'@tau'0
Meq: s i@tau = s i'@tau'
----------------------------------------
false


by fresh B.
[> Line 151: by (fresh) Freshness of s0 i:
Indirect occurrences of s0(i) in other actions:
s0(i')
(collision with s0(i))
in action init
in term (happens(init), s0 i')

Total: 1 occurrence
0 of them are subsumed by another
1 occurrence remaining


[goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,i',j:index[const],tau,tau':timestamp[const]
A: s i'@tau' = s i'@init
A0: s i@tau = s i@A(i, j)
A1: A(i, j) <= tau
D: happens(tau, tau')
E: i <> i'
Hinit': forall (j:index), happens(A(i', j)) => A(i', j) > tau'
Hsup: forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)
IH: forall (tau'0,tau:timestamp,i',i:index),
tau'0 < tau' => happens(tau, tau'0) => i <> i' => s i@tau <> s i'@tau'0
Meq: s i@tau = s i'@tau'
----------------------------------------
false



+ rewrite Meq A /s in A0.
[> Line 153: (rewrite) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,i',j:index[const],tau,tau':timestamp[const]
A: s i'@tau' = s i'@init
A0: s0 i' = H (s i@pred (A(i, j)), k)
A1: A(i, j) <= tau
D: happens(tau, tau')
E: i <> i'
Hinit': forall (j:index), happens(A(i', j)) => A(i', j) > tau'
Hsup: forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)
IH: forall (tau'0,tau:timestamp,i',i:index),
tau'0 < tau' => happens(tau, tau'0) => i <> i' => s i@tau <> s i'@tau'0
Meq: s i@tau = s i'@tau'
----------------------------------------
false


by fresh A0.
[> Line 154: by (fresh) Freshness of s0 i':
Indirect occurrences of s0(i') in other actions:
s0(i) (collision with s0(i')) in action init in term (happens(init), s0 i)

Total: 1 occurrence
0 of them are subsumed by another
1 occurrence remaining


[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,i',j,j':index[const],tau,tau':timestamp[const]
A0: s i@tau = s i@A(i, j)
A1: A(i, j) <= tau
B: s i'@tau' = s i'@A(i', j')
C: A(i', j') <= tau'
D: happens(tau, tau')
E: i <> i'
Hsup: forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)
Hsup': forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j')
IH: forall (tau'0,tau:timestamp,i',i:index),
tau'0 < tau' => happens(tau, tau'0) => i <> i' => s i@tau <> s i'@tau'0
Meq: s i@tau = s i'@tau'
----------------------------------------
false



+ rewrite Meq B /s in A0.
[> Line 156: (rewrite) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,i',j,j':index[const],tau,tau':timestamp[const]
A0: H (s i'@pred (A(i', j')), k) = H (s i@pred (A(i, j)), k)
A1: A(i, j) <= tau
B: s i'@tau' = s i'@A(i', j')
C: A(i', j') <= tau'
D: happens(tau, tau')
E: i <> i'
Hsup: forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)
Hsup': forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j')
IH: forall (tau'0,tau:timestamp,i',i:index),
tau'0 < tau' => happens(tau, tau'0) => i <> i' => s i@tau <> s i'@tau'0
Meq: s i@tau = s i'@tau'
----------------------------------------
false


collision A0 => H.
[> Line 157: ((collision);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,i',j,j':index[const],tau,tau':timestamp[const]
A0: H (s i'@pred (A(i', j')), k) = H (s i@pred (A(i, j)), k)
A1: A(i, j) <= tau
B: s i'@tau' = s i'@A(i', j')
C: A(i', j') <= tau'
D: happens(tau, tau')
E: i <> i'
H: s i'@pred (A(i', j')) = s i@pred (A(i, j))
Hsup: forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= tau => A(i, jj) <= A(i, j)
Hsup': forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j')
IH: forall (tau'0,tau:timestamp,i',i:index),
tau'0 < tau' => happens(tau, tau'0) => i <> i' => s i@tau <> s i'@tau'0
Meq: s i@tau = s i'@tau'
----------------------------------------
false


use IH with pred(A(i',j')),pred(A(i,j)),i',i => //.
[> Line 158: ((have);(intro)) [goal> lemma disjoint_chains is proved


Qed.
lemma disjoint_chains @system:(set:default; equiv:None) :
forall (tau',tau:timestamp,i',i:index),
happens(tau, tau') => i <> i' => s i@tau <> s i'@tau'
Exiting proof mode.

lemma monotonic_chain :
forall (tau,tau':timestamp,i,j:index), happens(tau,A(i,j)) => (
(s(i)@tau = s(i)@A(i,j) && tau' < A(i,j) && A(i,j) <= tau)
=> s(i)@tau' <> s(i)@tau).
Goal monotonic_chain :
forall (tau,tau':timestamp,i,j:index),
happens(A(i, j), tau) =>
s i@tau = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau =>
s i@tau' <> s i@tau

Values do not repeat inside the same chain of hashes.


Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
----------------------------------------
forall (tau,tau':timestamp,i,j:index),
happens(A(i, j), tau) =>
s i@tau = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau =>
s i@tau' <> s i@tau



induction => tau IH tau' i j Hap [H1 H2 H3] Meq.
[> Line 168: ((induction);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],tau,tau':timestamp[const]
H1: s i@tau = s i@A(i, j)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
Hap: happens(A(i, j), tau)
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
----------------------------------------
false


assert s(i)@tau' = s(i)@A(i,j) as Meq' by auto.
[> Line 169: ((have); 1: by (auto)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],tau,tau':timestamp[const]
H1: s i@tau = s i@A(i, j)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
Hap: happens(A(i, j), tau)
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = s i@A(i, j)
----------------------------------------
false


expand s(i)@A(i,j).
[> Line 170: (expand) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
Hap: happens(A(i, j), tau)
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
----------------------------------------
false


euf Meq'.
[> Line 171: (euf) Indirect bad occurrences of key k, and messages authenticated by it
in other actions:
s i@pred (A(i, j)) auth. by k
(collision with s i@pred (A(i, j)) auth. by k)
in action A(i, j)
in term (happens(A(i, j)), H (s i@pred (A(i, j)), k))

Total: 1 occurrence
0 of them are subsumed by another
1 occurrence remaining

[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
Hap: happens(A(i, j), tau)
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
----------------------------------------
(exists (j0:index),
(A(i, j0) < A(i, j) || A(i, j0) <= tau') &&
s i@pred (A(i, j)) = s i@pred (A(i, j0))) =>
false


intro [j0 [Heuf Meuf]].
[> Line 172: (intro) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,j0:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
Hap: happens(A(i, j), tau)
Heuf: A(i, j0) < A(i, j) || A(i, j0) <= tau'
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
Meuf: s i@pred (A(i, j)) = s i@pred (A(i, j0))
----------------------------------------
false


use lastupdate with i,pred(A(i,j)) as H4; 2: by auto.
[> Line 173: ((have); 2: by (auto)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,j0:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
H4: s i@pred (A(i, j)) = s i@init &&
forall (j0:index), happens(A(i, j0)) => A(i, j0) > pred (A(i, j))
||
exists (j0:index),
s i@pred (A(i, j)) = s i@A(i, j0) &&
A(i, j0) <= pred (A(i, j)) &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i, j)) =>
A(i, jj) <= A(i, j0)
Hap: happens(A(i, j), tau)
Heuf: A(i, j0) < A(i, j) || A(i, j0) <= tau'
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
Meuf: s i@pred (A(i, j)) = s i@pred (A(i, j0))
----------------------------------------
false


case H4.
[> Line 174: (case) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j,j0:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
H4: s i@pred (A(i, j)) = s i@init &&
forall (j0:index), happens(A(i, j0)) => A(i, j0) > pred (A(i, j))
Hap: happens(A(i, j), tau)
Heuf: A(i, j0) < A(i, j) || A(i, j0) <= tau'
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
Meuf: s i@pred (A(i, j)) = s i@pred (A(i, j0))
----------------------------------------
false


- (* case H4 - init *)
destruct H4 as [H4 H4'].
[> Line 176: (destruct) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j,j0:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
H4: s i@pred (A(i, j)) = s i@init
H4': forall (j0:index), happens(A(i, j0)) => A(i, j0) > pred (A(i, j))
Hap: happens(A(i, j), tau)
Heuf: A(i, j0) < A(i, j) || A(i, j0) <= tau'
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
Meuf: s i@pred (A(i, j)) = s i@pred (A(i, j0))
----------------------------------------
false


use H4' with j0; by case Heuf.
[> Line 176: ((have);by (case)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,j0:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
H4: exists (j0:index),
s i@pred (A(i, j)) = s i@A(i, j0) &&
A(i, j0) <= pred (A(i, j)) &&
forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i, j)) =>
A(i, jj) <= A(i, j0)
Hap: happens(A(i, j), tau)
Heuf: A(i, j0) < A(i, j) || A(i, j0) <= tau'
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
Meuf: s i@pred (A(i, j)) = s i@pred (A(i, j0))
----------------------------------------
false


- (* case H1 - general *)
destruct H4 as [j1 [Meq1 H4 H5]].
[> Line 179: (destruct) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,j0,j1:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
H4: A(i, j1) <= pred (A(i, j))
H5: forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i, j)) => A(i, jj) <= A(i, j1)
Hap: happens(A(i, j), tau)
Heuf: A(i, j0) < A(i, j) || A(i, j0) <= tau'
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
Meq1: s i@pred (A(i, j)) = s i@A(i, j1)
Meuf: s i@pred (A(i, j)) = s i@pred (A(i, j0))
----------------------------------------
false


use IH with pred(A(i,j)), pred(A(i,j0)),i,j1 as H; try auto.
[> Line 180: ((have);(try (auto))) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,j0,j1:index[const],tau,tau':timestamp[const]
H1: s i@tau = H (s i@pred (A(i, j)), k)
H2: tau' < A(i, j)
H3: A(i, j) <= tau
H4: A(i, j1) <= pred (A(i, j))
H5: forall (jj:index),
happens(A(i, jj)) && A(i, jj) <= pred (A(i, j)) => A(i, jj) <= A(i, j1)
Hap: happens(A(i, j), tau)
Heuf: A(i, j0) < A(i, j) || A(i, j0) <= tau'
IH: forall (tau0,tau':timestamp,i,j:index),
tau0 < tau =>
happens(A(i, j), tau0) =>
s i@tau0 = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau0 =>
s i@tau' <> s i@tau0
Meq: s i@tau' = s i@tau
Meq': s i@tau' = H (s i@pred (A(i, j)), k)
Meq1: s i@pred (A(i, j)) = s i@A(i, j1)
Meuf: s i@pred (A(i, j)) = s i@pred (A(i, j0))
----------------------------------------
s i@pred (A(i, j)) = s i@A(i, j1) &&
pred (A(i, j0)) < A(i, j1) && A(i, j1) <= pred (A(i, j))


use H5 with j0; by case Heuf.
[> Line 181: ((have);by (case)) [goal> lemma monotonic_chain is proved


Qed.
lemma monotonic_chain @system:(set:default; equiv:None) :
forall (tau,tau':timestamp,i,j:index),
happens(A(i, j), tau) =>
s i@tau = s i@A(i, j) && tau' < A(i, j) && A(i, j) <= tau =>
s i@tau' <> s i@tau
Exiting proof mode.




(* SECURITY PROPERTIES *)

name m : message.
global axiom namelength_m {'P:system} @system:(set:'P; equiv:None) :
[len m = namelength_message]


global lemma [default/left,default/left]
strong_secrecy (tau:timestamp[const]) :
Forall (i':index[const],tau':timestamp[const]),
[happens(tau)] -> [happens(tau')] -> equiv(frame@tau, diff(s(i')@tau',m)).
Goal strong_secrecy :
forall tau:timestamp[const, glob],
Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(tau)] -> [happens(tau')] -> equiv(frame@tau, diff(s i'@tau', m))

Proof.
[goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: tau:timestamp[const, glob]
----------------------------------------
Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(tau)] -> [happens(tau')] -> equiv(frame@tau, diff(s i'@tau', m))



induction tau => i' tau' Htau Htau'.
[> Line 194: ((induction);(intro)) [goal> Focused goal (1/3):
Systems: (left:default/left, right:default/left)
Variables: i':index[const, glob],tau':timestamp[const, glob]
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
0: frame@init
1: diff(s i'@tau', m)




+ (* Init *)
expand frame@init.
[> Line 197: (expand) [goal> Focused goal (1/3):
Systems: (left:default/left, right:default/left)
Variables: i':index[const, glob],tau':timestamp[const, glob]
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
0: diff(s i'@tau', m)



have [Hinit | [j [HA1 HA2]]] := lastupdate_pure_glob i' tau' _; try auto.
[> Line 198: ((have);(try (auto))) [goal> Focused goal (1/4):
Systems: (left:default/left, right:default/left)
Variables: i':index[const, glob],tau':timestamp[const, glob]
Hinit: [forall (j:index), happens(A(i', j)) => A(i', j) > tau']
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
0: diff(s i'@tau', m)




- use lastupdate_init with i',tau' as H; try auto.
[> Line 200: ((have);(try (auto))) [goal> Focused goal (1/4):
Systems: (left:default/left, right:default/left)
Variables: i':index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = s i'@init]
Hinit: [forall (j:index), happens(A(i', j)) => A(i', j) > tau']
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
0: diff(s i'@tau', m)



rewrite H //; expand s(i')@init.
[> Line 200: ((rewrite);(expand)) [goal> Focused goal (1/4):
Systems: (left:default/left, right:default/left)
Variables: i':index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = s0 i']
Hinit: [forall (j:index), happens(A(i', j)) => A(i', j) > tau']
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
0: diff(s0 i', m)



by fresh 0.
[> Line 202: by (fresh) Freshness on the left side:


Freshness on the right side:


[goal> Focused goal (1/3):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
0: diff(s i'@tau', m)




- use lastupdate_A with i',j,tau' as H; try auto.
[> Line 204: ((have);(try (auto))) [goal> Focused goal (1/3):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = s i'@A(i', j)]
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
0: diff(s i'@tau', m)



rewrite H // in *; expand s(i')@A(i',j).
[> Line 205: ((rewrite);(expand)) [goal> Focused goal (1/3):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
0: diff(H (s i'@pred (A(i', j)), k), m)



prf 0; [2: by fresh 0].
[> Line 206: ((prf); 2: by (fresh)) global axiom namelength_n_PRF {'P:system} @system:(set:'P; equiv:None) :
[len n_PRF = namelength_message]
Applying PRF to H (s i'@pred (A(i', j)), k)

Checking for occurrences on the left
Indirect bad occurrences of key k, and messages hashed by it
in other actions:
s i'@pred (A(i', j)) hashed by k
(collision with s i'@pred (A(i', j)) hashed by k)
in action A(i', j)
in term (happens(A(i', j)), H (s i'@pred (A(i', j)), k))

Total: 1 occurrence
0 of them are subsumed by another
1 occurrence remaining


Checking for occurrences on the right
Indirect bad occurrences of key k, and messages hashed by it
in other actions:
s i'@pred (A(i', j)) hashed by k
(collision with s i'@pred (A(i', j)) hashed by k)
in action A(i', j)
in term (happens(A(i', j)), H (s i'@pred (A(i', j)), k))

Total: 1 occurrence
0 of them are subsumed by another
1 occurrence remaining


Freshness on the left side:


Freshness on the right side:


[goal> Focused goal (1/3):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
forall (j0:index),
A(i', j0) < A(i', j) => s i'@pred (A(i', j)) <> s i'@pred (A(i', j0))



simpl.
[> Line 206: (simpl) [goal> Focused goal (1/3):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
forall (j0:index),
A(i', j0) < A(i', j) => s i'@pred (A(i', j)) <> s i'@pred (A(i', j0))


intro j0 HAi0. [> Line 207: (intro) [goal> Focused goal (1/3):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',j,j0:index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
HAi0: A(i', j0) < A(i', j)
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
s i'@pred (A(i', j)) <> s i'@pred (A(i', j0))


use lastupdate with i',pred(A(i',j)) as [[H1 H2] | H1]; try auto.
[> Line 208: ((have);(try (auto))) [goal> Focused goal (1/4):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',j,j0:index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
H1: s i'@pred (A(i', j)) = s i'@init
H2: forall (j0:index), happens(A(i', j0)) => A(i', j0) > pred (A(i', j))
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
HAi0: A(i', j0) < A(i', j)
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
s i'@pred (A(i', j)) <> s i'@pred (A(i', j0))


* use H2 with j0 as H3; try auto.
[> Line 209: ((have);(try (auto))) [goal> Focused goal (1/3):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',j,j0:index[const, glob],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
H1: exists (j0:index),
s i'@pred (A(i', j)) = s i'@A(i', j0) &&
A(i', j0) <= pred (A(i', j)) &&
forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= pred (A(i', j)) =>
A(i', jj) <= A(i', j0)
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
HAi0: A(i', j0) < A(i', j)
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
s i'@pred (A(i', j)) <> s i'@pred (A(i', j0))


* destruct H1 as [j1 [H1 H2 H3]].
[> Line 210: (destruct) [goal> Focused goal (1/3):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables:
i',j,j0:index[const, glob],j1:index[const],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
H1: s i'@pred (A(i', j)) = s i'@A(i', j1)
H2: A(i', j1) <= pred (A(i', j))
H3: forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= pred (A(i', j)) =>
A(i', jj) <= A(i', j1)
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
HAi0: A(i', j0) < A(i', j)
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
s i'@pred (A(i', j)) <> s i'@pred (A(i', j0))


use monotonic_chain with pred(A(i',j)),pred(A(i',j0)),i',j1 => //.
[> Line 211: ((have);(intro)) [goal> Focused goal (1/3):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables:
i',j,j0:index[const, glob],j1:index[const],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
H1: s i'@pred (A(i', j)) = s i'@A(i', j1)
H2: A(i', j1) <= pred (A(i', j))
H3: forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= pred (A(i', j)) =>
A(i', jj) <= A(i', j1)
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
HAi0: A(i', j0) < A(i', j)
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
s i'@pred (A(i', j)) = s i'@A(i', j1) &&
pred (A(i', j0)) < A(i', j1) && A(i', j1) <= pred (A(i', j))


repeat split; try auto.
[> Line 212: ((repeat (split));(try (auto))) [goal> Focused goal (1/3):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables:
i',j,j0:index[const, glob],j1:index[const],tau':timestamp[const, glob]
H: [s i'@tau' = H (s i'@pred (A(i', j)), k)]
H1: s i'@pred (A(i', j)) = s i'@A(i', j1)
H2: A(i', j1) <= pred (A(i', j))
H3: forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= pred (A(i', j)) =>
A(i', jj) <= A(i', j1)
HA1: [happens(A(i', j)) && A(i', j) <= tau']
HA2: [forall (jj:index),
happens(A(i', jj)) && A(i', jj) <= tau' => A(i', jj) <= A(i', j)]
HAi0: A(i', j0) < A(i', j)
Htau: [happens(init)]
Htau': [happens(tau')]
----------------------------------------
pred (A(i', j0)) < A(i', j1)


use H3 with j0 as H4; try auto.
[> Line 213: ((have);(try (auto))) [goal> Focused goal (1/2):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
0: frame@O(j)
1: diff(s i'@tau', m)




+ (* Oracle *)
expand frame, exec, cond, output.
[> Line 216: (expand) [goal> Focused goal (1/2):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
0: <frame@pred (O(j)),
<of_bool (exec@pred (O(j)) && true),
if (exec@pred (O(j)) && true) then
<H (input@O(j), k),G (input@O(j), k')>>>
1: diff(s i'@tau', m)



fa !<_,_>, if _ then _, (_ && _), <_,_>.
[> Line 217: (fa) [goal> Focused goal (1/2):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (O(j))
1: H (input@O(j), k)
2: G (input@O(j), k')
3: diff(s i'@tau', m)



prf 1.
[> Line 218: (prf) global axiom namelength_n_PRF {'P:system} @system:(set:'P; equiv:None) :
[len n_PRF = namelength_message]
Applying PRF to H (input@O(j), k)

Checking for occurrences on the left
Indirect bad occurrences of key k, and messages hashed by it
in other actions:
input@O(j) hashed by k
(collision with input@O(j) hashed by k)
in action O(j)
in term (happens(O(j)), <H (input@O(j), k),G (input@O(j), k')>)

s i@pred (A(i, j)) hashed by k
(collision with input@O(j) hashed by k)
in action A(i, j)
in term (happens(A(i, j)), G (s i@A(i, j), k'))

s i@pred (A(i, j)) hashed by k
(collision with input@O(j) hashed by k)
in action A(i, j)
in term (happens(A(i, j)), H (s i@pred (A(i, j)), k))

Total: 3 occurrences
1 of them is subsumed by another
2 occurrences remaining


Checking for occurrences on the right
Indirect bad occurrences of key k, and messages hashed by it
in other actions:
input@O(j) hashed by k
(collision with input@O(j) hashed by k)
in action O(j)
in term (happens(O(j)), <H (input@O(j), k),G (input@O(j), k')>)

s i@pred (A(i, j)) hashed by k
(collision with input@O(j) hashed by k)
in action A(i, j)
in term (happens(A(i, j)), G (s i@A(i, j), k'))

s i@pred (A(i, j)) hashed by k
(collision with input@O(j) hashed by k)
in action A(i, j)
in term (happens(A(i, j)), H (s i@pred (A(i, j)), k))

Total: 3 occurrences
1 of them is subsumed by another
2 occurrences remaining


[goal> Focused goal (1/5):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
forall (i,j0:index),
A(i, j0) <= tau' || A(i, j0) < O(j) => input@O(j) <> s i@pred (A(i, j0))



* intro i0 j0 H.
[> Line 219: (intro) [goal> Focused goal (1/5):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',i0,j,j0:index[const, glob],tau':timestamp[const, glob]
H: A(i0, j0) <= tau' || A(i0, j0) < O(j)
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> s i0@pred (A(i0, j0))


have ? : happens(pred (A(i0, j0))) by case H.
[> Line 219: ((have); 1: by (case)) [goal> Focused goal (1/5):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',i0,j,j0:index[const, glob],tau':timestamp[const, glob]
H: A(i0, j0) <= tau' || A(i0, j0) < O(j)
Hap: happens(pred (A(i0, j0)))
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> s i0@pred (A(i0, j0))


rewrite equiv IH i0 (pred(A(i0,j0))) => //.
[> Line 220: ((rewrite equiv);(intro)) [goal> Focused goal (1/5):
System: (set:left:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',i0,j,j0:index[const, glob],tau':timestamp[const, glob]
H: A(i0, j0) <= tau' || A(i0, j0) < O(j)
Hap: happens(pred (A(i0, j0)))
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> m


intro Hf; by fresh Hf.
[> Line 222: ((intro);by (fresh)) Freshness of m:

[goal> Focused goal (1/4):
System: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
forall (j0:index), O(j0) < O(j) => input@O(j) <> input@O(j0)


* intro j0 H.
[> Line 223: (intro) [goal> Focused goal (1/4):
System: (left:default/left, right:default/left)
Variables:
i',j:index[const, glob],j0:index[const],tau':timestamp[const, glob]
H: O(j0) < O(j)
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> input@O(j0)


by apply unique_queries.
[> Line 224: by (apply) [goal> Focused goal (1/3):
System: (set:right:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
forall (i,j0:index), A(i, j0) < O(j) => input@O(j) <> s i@pred (A(i, j0))


* intro i0 j0 H.
[> Line 225: (intro) [goal> Focused goal (1/3):
System: (set:right:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',i0,j,j0:index[const, glob],tau':timestamp[const, glob]
H: A(i0, j0) < O(j)
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> s i0@pred (A(i0, j0))


have ? : happens(pred (A(i0, j0))) by auto.
[> Line 225: ((have); 1: by (auto)) [goal> Focused goal (1/3):
System: (set:right:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',i0,j,j0:index[const, glob],tau':timestamp[const, glob]
H: A(i0, j0) < O(j)
Hap: happens(pred (A(i0, j0)))
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> s i0@pred (A(i0, j0))


rewrite equiv IH i0 (pred(A(i0,j0))) => //.
[> Line 226: ((rewrite equiv);(intro)) [goal> Focused goal (1/3):
System: (set:right:default/left;
equiv:(left:default/left, right:default/left))
Variables: i',i0,j,j0:index[const, glob],tau':timestamp[const, glob]
H: A(i0, j0) < O(j)
Hap: happens(pred (A(i0, j0)))
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> m


intro Hf; by fresh Hf.
[> Line 228: ((intro);by (fresh)) Freshness of m:

[goal> Focused goal (1/2):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (O(j))
1: n_PRF
2: G (input@O(j), k')
3: diff(s i'@tau', m)



* fresh 1; 1:auto.
[> Line 229: ((fresh); 1: (auto)) Freshness on the left side:


Freshness on the right side:


[goal> Focused goal (1/2):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (O(j))
1: G (input@O(j), k')
2: diff(s i'@tau', m)



prf 1.
[> Line 229: (prf) global axiom namelength_n_PRF1 {'P:system} @system:(set:'P; equiv:None) :
[len n_PRF1 = namelength_message]
Applying PRF to G (input@O(j), k')

Checking for occurrences on the left
Indirect bad occurrences of key k', and messages hashed by it
in other actions:
input@O(j) hashed by k'
(collision with input@O(j) hashed by k')
in action O(j)
in term (happens(O(j)), <H (input@O(j), k),G (input@O(j), k')>)

s i@A(i, j) hashed by k'
(collision with input@O(j) hashed by k')
in action A(i, j)
in term (happens(A(i, j)), G (s i@A(i, j), k'))

Total: 2 occurrences
0 of them are subsumed by another
2 occurrences remaining


Checking for occurrences on the right
Indirect bad occurrences of key k', and messages hashed by it
in other actions:
input@O(j) hashed by k'
(collision with input@O(j) hashed by k')
in action O(j)
in term (happens(O(j)), <H (input@O(j), k),G (input@O(j), k')>)

s i@A(i, j) hashed by k'
(collision with input@O(j) hashed by k')
in action A(i, j)
in term (happens(A(i, j)), G (s i@A(i, j), k'))

Total: 2 occurrences
0 of them are subsumed by another
2 occurrences remaining


[goal> Focused goal (1/3):
System: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
(forall (j0:index), O(j0) < O(j) => input@O(j) <> input@O(j0)) &&
forall (i,j0:index), A(i, j0) < O(j) => input@O(j) <> s i@A(i, j0)


simpl; split.
[> Line 231: ((simpl);(split)) [goal> Focused goal (1/4):
System: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
forall (j0:index), O(j0) < O(j) => input@O(j) <> input@O(j0)


++ intro j0 H.
[> Line 232: (intro) [goal> Focused goal (1/4):
System: (left:default/left, right:default/left)
Variables:
i',j:index[const, glob],j0:index[const],tau':timestamp[const, glob]
H: O(j0) < O(j)
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> input@O(j0)


apply unique_queries; auto.
[> Line 233: ((apply);(auto)) [goal> Focused goal (1/3):
System: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
forall (i,j0:index), A(i, j0) < O(j) => input@O(j) <> s i@A(i, j0)


++ intro i0 j0 H.
[> Line 234: (intro) [goal> Focused goal (1/3):
System: (left:default/left, right:default/left)
Variables:
i':index[const, glob],i0:index[const],j:index[const, glob],j0:index
[const],tau':timestamp[const, glob]
H: A(i0, j0) < O(j)
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
input@O(j) <> s i0@A(i0, j0)


rewrite equiv IH i0 (A(i0,j0)) => // Hf.
[> Line 235: ((rewrite equiv);(intro)) [goal> Focused goal (1/3):
System: (left:default/left, right:default/left)
Variables:
i':index[const, glob],i0:index[const],j:index[const, glob],j0:index
[const],tau':timestamp[const, glob]
H: A(i0, j0) < O(j)
Hf: input@O(j) = m
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
false


by fresh Hf.
[> Line 236: by (fresh) Freshness of m:

[goal> Focused goal (1/2):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (O(j))
1: n_PRF1
2: diff(s i'@tau', m)



fresh 1; 1:auto.
[> Line 237: ((fresh); 1: (auto)) Freshness on the left side:


Freshness on the right side:


[goal> Focused goal (1/2):
Systems: (left:default/left, right:default/left)
Variables: i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(O(j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (O(j)))] ->
[happens(tau')] -> equiv(frame@pred (O(j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (O(j))
1: diff(s i'@tau', m)



by apply IH.
[> Line 238: by (apply) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: frame@A(i, j)
1: diff(s i'@tau', m)




+ (* Tag *)
expand frame@A(i,j).
[> Line 240: (expand) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: <frame@pred (A(i, j)),
<of_bool (exec@A(i, j)),if exec@A(i, j) then output@A(i, j)>>
1: diff(s i'@tau', m)


expand exec@A(i,j). [> Line 240: (expand) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: <frame@pred (A(i, j)),
<of_bool (exec@pred (A(i, j)) && cond@A(i, j)),
if (exec@pred (A(i, j)) && cond@A(i, j)) then output@A(i, j)>>
1: diff(s i'@tau', m)


expand cond@A(i,j). [> Line 240: (expand) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: <frame@pred (A(i, j)),
<of_bool (exec@pred (A(i, j)) && true),
if (exec@pred (A(i, j)) && true) then output@A(i, j)>>
1: diff(s i'@tau', m)


expand output@A(i,j). [> Line 241: (expand) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: <frame@pred (A(i, j)),
<of_bool (exec@pred (A(i, j)) && true),
if (exec@pred (A(i, j)) && true) then G (s i@A(i, j), k')>>
1: diff(s i'@tau', m)



fa 0.
[> Line 241: (fa) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (A(i, j))
1: <of_bool (exec@pred (A(i, j)) && true),
if (exec@pred (A(i, j)) && true) then G (s i@A(i, j), k')>
2: diff(s i'@tau', m)


fa 1. [> Line 241: (fa) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (A(i, j))
1: if (exec@pred (A(i, j)) && true) then G (s i@A(i, j), k')
2: diff(s i'@tau', m)


fa 1. [> Line 242: (fa) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (A(i, j))
1: G (s i@A(i, j), k')
2: diff(s i'@tau', m)



prf 1.
[> Line 243: (prf) global axiom namelength_n_PRF {'P:system} @system:(set:'P; equiv:None) :
[len n_PRF = namelength_message]
Applying PRF to G (s i@A(i, j), k')

Checking for occurrences on the left
Indirect bad occurrences of key k', and messages hashed by it
in other actions:
input@O(j) hashed by k'
(collision with s i@A(i, j) hashed by k')
in action O(j)
in term (happens(O(j)), <H (input@O(j), k),G (input@O(j), k')>)

s i@A(i, j) hashed by k'
(collision with s i@A(i, j) hashed by k')
in action A(i, j)
in term (happens(A(i, j)), G (s i@A(i, j), k'))

Total: 2 occurrences
0 of them are subsumed by another
2 occurrences remaining


Checking for occurrences on the right
Indirect bad occurrences of key k', and messages hashed by it
in other actions:
input@O(j) hashed by k'
(collision with s i@A(i, j) hashed by k')
in action O(j)
in term (happens(O(j)), <H (input@O(j), k),G (input@O(j), k')>)

s i@A(i, j) hashed by k'
(collision with s i@A(i, j) hashed by k')
in action A(i, j)
in term (happens(A(i, j)), G (s i@A(i, j), k'))

Total: 2 occurrences
0 of them are subsumed by another
2 occurrences remaining


[goal> Focused goal (1/2):
System: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
(forall (j0:index), O(j0) < A(i, j) => s i@A(i, j) <> input@O(j0)) &&
forall (i0,j0:index), A(i0, j0) < A(i, j) => s i@A(i, j) <> s i0@A(i0, j0)


simpl; split.
[> Line 244: ((simpl);(split)) [goal> Focused goal (1/3):
System: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
forall (j0:index), O(j0) < A(i, j) => s i@A(i, j) <> input@O(j0)


- intro j0 H.
[> Line 245: (intro) [goal> Focused goal (1/3):
System: (left:default/left, right:default/left)
Variables:
i,i',j:index[const, glob],j0:index[const],tau':timestamp[const, glob]
H: O(j0) < A(i, j)
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
s i@A(i, j) <> input@O(j0)


rewrite equiv IH i (A(i,j)) => // Hf; by fresh Hf.
[> Line 246: (((rewrite equiv);(intro));by (fresh)) Freshness of m:

[goal> Focused goal (1/2):
System: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
forall (i0,j0:index), A(i0, j0) < A(i, j) => s i@A(i, j) <> s i0@A(i0, j0)


- intro i0 j0 H.
[> Line 247: (intro) [goal> Focused goal (1/2):
System: (left:default/left, right:default/left)
Variables:
i,i':index[const, glob],i0:index[const],j:index[const, glob],
j0:index[const],tau':timestamp[const, glob]
H: A(i0, j0) < A(i, j)
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
s i@A(i, j) <> s i0@A(i0, j0)


assert i=i0 || i<>i0; try auto.
[> Line 248: ((have);(try (auto))) [goal> Focused goal (1/2):
System: (left:default/left, right:default/left)
Variables:
i,i':index[const, glob],i0:index[const],j:index[const, glob],
j0:index[const],tau':timestamp[const, glob]
H: A(i0, j0) < A(i, j)
H0: i = i0 || i <> i0
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
s i@A(i, j) <> s i0@A(i0, j0)


case H0.
[> Line 249: (case) [goal> Focused goal (1/3):
System: (left:default/left, right:default/left)
Variables:
i,i':index[const, glob],i0:index[const],j:index[const, glob],
j0:index[const],tau':timestamp[const, glob]
H: A(i0, j0) < A(i, j)
H0: i = i0
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
s i@A(i, j) <> s i0@A(i0, j0)


* by use monotonic_chain with A(i,j),A(i,j0),i,j => //.
[> Line 250: (by (have);(intro)) [goal> Focused goal (1/2):
System: (left:default/left, right:default/left)
Variables:
i,i':index[const, glob],i0:index[const],j:index[const, glob],
j0:index[const],tau':timestamp[const, glob]
H: A(i0, j0) < A(i, j)
H0: i <> i0
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
s i@A(i, j) <> s i0@A(i0, j0)


* by use disjoint_chains with A(i,j),A(i0,j0),i,i0.
[> Line 251: by (have) [goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (A(i, j))
1: n_PRF
2: diff(s i'@tau', m)



fresh 1; 1:auto.
[> Line 252: ((fresh); 1: (auto)) Freshness on the left side:


Freshness on the right side:


[goal> Focused goal (1/1):
Systems: (left:default/left, right:default/left)
Variables: i,i',j:index[const, glob],tau':timestamp[const, glob]
Htau: [happens(A(i, j))]
Htau': [happens(tau')]
IH: Forall (i':index[const, glob],tau':timestamp[const, glob]),
[happens(pred (A(i, j)))] ->
[happens(tau')] -> equiv(frame@pred (A(i, j)), diff(s i'@tau', m))
----------------------------------------
0: frame@pred (A(i, j))
1: diff(s i'@tau', m)



by apply IH.
[> Line 253: by (apply) [goal> lemma strong_secrecy is proved


Qed.
global lemma strong_secrecy @system:(left:default/left, right:default/left) :
Forall (tau:timestamp[const, glob],i':index[const, glob],
tau':timestamp[const, glob]),
[happens(tau)] -> [happens(tau')] -> equiv(frame@tau, diff(s i'@tau', m))
Exiting proof mode.

Press the left and right arrows to do and undo an instruction.

Alternatively, you can double-click on an instruction.

This zone shows a Squirrel file. You can double-click on a comment to collapse it for better readabilility.

This zone shows the output given by Squirrel.

This zone shows the output of the previous instruction, to help identifying the change caused by the instruction.

Previously: