hash h1
hash h2

abstract ok : message
abstract error : message

name key1 : index -> message
name key2 : index -> message
name k : index -> message
name r1 : index -> message

name k1init : index -> message
name k2init : index -> message

mutable kT(i:index) : message = <k1init(i),k2init(i)>
mutable kR(i:index) : message = <k1init(i),k2init(i)>

channel cT
channel cR

(* i = tag's identity, j = tag's session for identity i *)
process tag(i:index,j:index) =
in(cR, xr1);
out(cT, h1(fst(kT(i)) XOR xr1 XOR k(i), key1(i)));
in(cR, xh2);
if xh2 = h2(snd(kT(i)), key2(i)) then
kT(i) := < fst(kT(i)) XOR h2(snd(kT(i)), key2(i)),
snd(kT(i)) XOR h1(fst(kT(i)) XOR xr1 XOR k(i), key1(i)) >;
out(cT, ok)
else
out(cT, error)

(* jj = generic reader's session *)
process reader(jj:index) =
out(cR, r1(jj));
in(cT, xh1);
try find ii such that xh1 = h1(fst(kR(ii)) XOR r1(jj) XOR k(ii), key1(ii)) in
let m = h2(snd(kR(ii)),key2(ii)) in
kR(ii) := < fst(kR(ii)) XOR h2(snd(kR(ii)), key2(ii)),
snd(kR(ii)) XOR h1(fst(kR(ii)) XOR r1(jj) XOR k(ii), key1(ii)) >;
out(cT, m)
else
out(cT, error)

system ((!_jj R: reader(jj)) | (!_i !_j T: tag(i,j))).
Typed-check process:

null

Added action dependencies lemmas:


System after processing:

null

System Empty registered with actions (init).
[warning>Loaded "Prelude.sp".
<]global axiom namelength_key1 {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index), len (key1 i) = namelength_message]
global axiom namelength_key2 {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index), len (key2 i) = namelength_message]
global axiom namelength_k {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index), len (k i) = namelength_message]
global axiom namelength_r1 {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index), len (r1 i) = namelength_message]
global axiom namelength_k1init {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index), len (k1init i) = namelength_message]
global axiom namelength_k2init {'P:system} @system:(set:'P; equiv:None) :
[forall (i:index), len (k2init i) = namelength_message]
process tag (i,j:index) =
in(cR,xr1);
out(cT,h1 (xor (xor (fst (kT i@τ)) xr1) (k i), key1 i));
in(cR,xh2);
if xh2 = h2 (snd (kT i@τ), key2 i) then
kT(i) :=
<xor (fst (kT i@τ)) (h2 (snd (kT i@τ), key2 i)),
xor (snd (kT i@τ)) (h1 (xor (xor (fst (kT i@τ)) xr1) (k i), key1 i))>;
out(cT,ok);
null
else
out(cT,error); null
process reader (jj:index) =
out(cR,r1 jj);
in(cT,xh1);
find (ii) such that xh1 =
h1
(xor (xor (fst (kR ii@τ)) (r1 jj)) (k ii), key1 ii) in
let m : message = h2 (snd (kR ii@τ), key2 ii) in
kR(ii) :=
<xor (fst (kR ii@τ)) (h2 (snd (kR ii@τ), key2 ii)),
xor
(snd (kR ii@τ))
(h1 (xor (xor (fst (kR ii@τ)) (r1 jj)) (k ii), key1 ii))>;
out(cT,m);
null
else
out(cT,error); null
Typed-check process:

( !_jj( R: reader jj) ) | !_i( !_j( T: tag i j))

Added action dependencies lemmas:

axiom mutex_T2_T1 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), not happens(T2(i, j)) || not happens(T1(i, j))
axiom mutex_T1_T2 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), not happens(T1(i, j)) || not happens(T2(i, j))
axiom depends_T_T2 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), happens(T2(i, j)) => T(i, j) < T2(i, j)
axiom depends_T_T1 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), happens(T1(i, j)) => T(i, j) < T1(i, j)
axiom mutex_R2_R1 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (jj,ii:index), not happens(R2(jj)) || not happens(R1(jj, ii))
axiom mutex_R1_R2 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (jj,ii:index), not happens(R1(jj, ii)) || not happens(R2(jj))
axiom depends_R_R2 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (jj:index), happens(R2(jj)) => R(jj) < R2(jj)
axiom depends_R_R1 {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (jj,ii:index), happens(R1(jj, ii)) => R(jj) < R1(jj, ii)
axiom depends_init_T2 {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (i,j:index), happens(T2(i, j)) => init < T2(i, j)
axiom depends_init_T1 {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (i,j:index), happens(T1(i, j)) => init < T1(i, j)
axiom depends_init_T {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (i,j:index), happens(T(i, j)) => init < T(i, j)
axiom depends_init_R2 {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (jj:index), happens(R2(jj)) => init < R2(jj)
axiom depends_init_R1 {'P:system[like default]} @system:(set:'P; equiv:None)
: forall (jj,ii:index), happens(R1(jj, ii)) => init < R1(jj, ii)
axiom depends_init_R {'P:system[like default]} @system:(set:'P; equiv:None) :
forall (jj:index), happens(R(jj)) => init < R(jj)

System after processing:

( !_jj(
R: out(cR,r1 jj);
in(cT,xh1);
find (ii) such that xh1 =
h1
(xor (xor (fst (kR ii@τ)) (r1 jj)) (k ii),
key1 ii) in
let m : message = h2 (snd (kR ii@τ), key2 ii) in
kR(ii) :=
<xor (fst (kR ii@τ)) (h2 (snd (kR ii@τ), key2 ii)),
xor
(snd (kR ii@τ))
(h1 (xor (xor (fst (kR ii@τ)) (r1 jj)) (k ii), key1 ii))>;
R1: out(cT,m jj ii@τ);
null
else
R2: out(cT,error); null) ) |
!_i(
!_j(
in(cR,xr1);
T: out(cT,h1 (xor (xor (fst (kT i@τ)) xr1) (k i), key1 i));
in(cR,xh2);
if xh2 = h2 (snd (kT i@τ), key2 i) then
kT(i) :=
<xor (fst (kT i@τ)) (h2 (snd (kT i@τ), key2 i)),
xor
(snd (kT i@τ))
(h1 (xor (xor (fst (kT i@τ)) (input@T(i, j))) (k i), key1 i))>;
T1: out(cT,ok);
null
else
T2: out(cT,error); null))

System Empty registered with actions (init).
System default registered with actions (init,R,R1,R2,T,T1,T2).

YPLRK05

T. van Deursen and S. Radomirović, ‘Attacks on RFID Protocols’, Cryptology ePrint Archive, vol. 2008, no. 310, pp. 1–56, Aug. 2009.

The reader and tag share secrets k, k1, k2. The reader initiates the protocol by challenging the tag with a nonce r1. The tag responds with h(k1 XOR r1 XOR k). The reader then replies with h(k2) and both tag and reader update secrets k1 and k2.

R -> T : r1 T -> R : h(kT1+r1+k) kT1 := kT1+h(kT2) kT2 := kT2+h(kT1+r1+k) R -> T : h(kR2) kR1 := kR1+h(kR2) kR2 := kR2+h(kR1+r1+k)

COMMENTS - In this model we use 2 different keyed hash functions, instead of a single (not keyed) hash function as in the specification.

HELPING LEMMAS - no update

SECURITY PROPERTIES - authentication ******************************************************************************



(* AXIOMS *)

(* Minimal sequentiality assumption needed for the proofs *)
axiom sequentiality (t:timestamp, i,j:index):
happens(T(i,j),t,T1(i,j)) =>
T(i,j) < t => t < T1(i,j) =>
not(exists (j':index), t = T1(i,j') && j <> j').
axiom sequentiality @system:(set:default; equiv:None) :
forall (t:timestamp,i,j:index),
happens(T1(i, j), t, T(i, j)) =>
T(i, j) < t =>
t < T1(i, j) => not exists (j':index), t = T1(i, j') && j <> j'


(* LIBRARIES *)

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".
<]


(* HELPING LEMMAS *)

lemma noUpdateTag (t:timestamp, i,j:index):
happens(T(i,j),t,T1(i,j)) =>
(t >= T(i,j) && t < T1(i,j)) => kT(i)@T(i,j) = kT(i)@t.
Goal noUpdateTag :
happens(T1(i, j), t, T(i, j)) =>
t >= T(i, j) && t < T1(i, j) => kT i@T(i, j) = kT i@t

Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index,t:timestamp
----------------------------------------
happens(T1(i, j), t, T(i, j)) =>
t >= T(i, j) && t < T1(i, j) => kT i@T(i, j) = kT i@t


generalize i j.
[> Line 97: (generalize) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t:timestamp[const]
----------------------------------------
forall (i,j:index),
happens(T1(i, j), t, T(i, j)) =>
t >= T(i, j) && t < T1(i, j) => kT i@T(i, j) = kT i@t



induction t => t IH0 i j Hap [H1 H2].
[> Line 98: ((induction);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@t


case t => He;
try by (repeat destruct He as [_ He]; expand kT(i)@t; apply IH0).
[> Line 100: (((case);(intro));
(try by ((repeat (destruct));((expand);(apply)))))
[goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: i,j:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = init
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@init



auto.
[> Line 102: (auto) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: exists (i0,j0:index), t = T(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@t



destruct He as [i0 j0 He].
[> Line 104: (destruct) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@t


assert T(i0,j0) = T(i,j) || T(i0,j0) > T(i,j) as H0 by constraints.
[> Line 105: ((have); 1: by (constraints)) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H0: T(i0, j0) = T(i, j) || T(i0, j0) > T(i, j)
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@t



case H0; 1: auto.
[> Line 107: ((case); 1: (auto)) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H0: T(i0, j0) > T(i, j)
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@t


expand kT(i)@t; by apply IH0.
[> Line 108: ((expand);by (apply)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: exists (i0,j0:index), t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@t



destruct He as [i0 j0 He].
[> Line 110: (destruct) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@t


rewrite He.
[> Line 111: (rewrite) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
----------------------------------------
kT i@T(i, j) = kT i@T1(i0, j0)


case (i=i0) => _.
[> Line 112: ((case);(intro)) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
_: i = i0
----------------------------------------
kT i@T(i, j) = kT i@T1(i0, j0)


case (j=j0) => _.
[> Line 113: ((case);(intro)) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
_: j = j0
_: i = i0
----------------------------------------
kT i@T(i, j) = kT i@T1(i0, j0)



(* case i=i0 && j=j0 *)
auto.
[> Line 116: (auto) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
_: not (j = j0)
_: i = i0
----------------------------------------
kT i@T(i, j) = kT i@T1(i0, j0)



(* case i=i0 && j<>j0 *)
use sequentiality with T1(i,j0),i,j => //.
[> Line 119: ((have);(intro)) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
_: not (j = j0)
_: i = i0
----------------------------------------
exists (j':index), T1(i, j0) = T1(i, j') && j <> j'


by exists j0.
[> Line 120: by (exists) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
_: not (i = i0)
----------------------------------------
kT i@T(i, j) = kT i@T1(i0, j0)



(* case i<>i0 *)
use IH0 with pred(T1(i0,j0)),i,j as Meq; 2,3,4: auto.
[> Line 123: ((have); 2,3,4: (auto)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,i0,j,j0:index[const],t:timestamp[const]
H1: t >= T(i, j)
H2: t < T1(i, j)
Hap: happens(T1(i, j), t, T(i, j))
He: t = T1(i0, j0)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(T1(i, j), t0, T(i, j)) =>
t0 >= T(i, j) && t0 < T1(i, j) => kT i@T(i, j) = kT i@t0
Meq: kT i@T(i, j) = kT i@pred (T1(i0, j0))
_: not (i = i0)
----------------------------------------
kT i@T(i, j) = kT i@T1(i0, j0)


by rewrite /kT if_false //.
[> Line 124: by (rewrite) [goal> lemma noUpdateTag is proved


Qed.
lemma noUpdateTag @system:(set:default; equiv:None) :
forall (t:timestamp,i,j:index),
happens(T1(i, j), t, T(i, j)) =>
t >= T(i, j) && t < T1(i, j) => kT i@T(i, j) = kT i@t
Exiting proof mode.



(* SECURITY PROPERTIES *)

lemma auth_R1_induction (t:timestamp, jj,ii:index):
happens(R1(jj,ii)) =>
t = R1(jj,ii) && exec@t (* exec@t (not only cond@t) is needed *)
=>
exists (j:index), T(ii,j) < t && output@T(ii,j) = input@t.
Goal auth_R1_induction :
happens(R1(jj, ii)) =>
t = R1(jj, ii) && exec@t =>
exists (j:index), T(ii, j) < t && output@T(ii, j) = input@t

Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,jj:index,t:timestamp
----------------------------------------
happens(R1(jj, ii)) =>
t = R1(jj, ii) && exec@t =>
exists (j:index), T(ii, j) < t && output@T(ii, j) = input@t


generalize jj ii.
[> Line 135: (generalize) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t:timestamp[const]
----------------------------------------
forall (jj,ii:index),
happens(R1(jj, ii)) =>
t = R1(jj, ii) && exec@t =>
exists (j:index), T(ii, j) < t && output@T(ii, j) = input@t



induction t => t IH0 jj ii Hap [Ht0 Hexec].
[> Line 136: ((induction);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,jj:index[const],t:timestamp[const]
Hap: happens(R1(jj, ii))
Hexec: exec@t
Ht0: t = R1(jj, ii)
IH0: forall (t0:timestamp,jj,ii:index),
t0 < t =>
happens(R1(jj, ii)) =>
t0 = R1(jj, ii) && exec@t0 =>
exists (j:index), T(ii, j) < t0 && output@T(ii, j) = input@t0
----------------------------------------
exists (j:index), T(ii, j) < t && output@T(ii, j) = input@t


rewrite Ht0 in *; clear Ht0.
[> Line 137: ((rewrite);(clear)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,jj:index[const],t:timestamp[const]
Hap: happens(R1(jj, ii))
Hexec: exec@R1(jj, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) && exec@t =>
exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)



expand exec, cond.
[> Line 139: (expand) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,jj:index[const],t:timestamp[const]
Hap: happens(R1(jj, ii))
Hexec: exec@pred (R1(jj, ii)) &&
input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


destruct Hexec as [H1 Meq].
[> Line 140: (destruct) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,jj:index[const],t:timestamp[const]
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


euf Meq.
[> Line 141: (euf) Indirect bad occurrences of key key1(ii), and messages authenticated by it
in other actions:
xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) auth. by key1(ii)
(collision with xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) auth. by key1(ii))
in action R1(jj, ii)
in term
(happens(R1(jj, ii)),
<xor
(fst (kR ii@pred (R1(jj, ii))))
(h2 (snd (kR ii@pred (R1(jj, ii))), key2 ii)),
xor
(snd (kR ii@pred (R1(jj, ii))))
(h1
(xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii),
key1 ii))>)

xor (xor (fst (kT i@T(i, j))) (input@T(i, j))) (k i) auth. by key1(i)
(collision with xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) auth. by key1(ii))
in action T(i, j)
in term
(happens(T(i, j)),
h1 (xor (xor (fst (kT i@T(i, j))) (input@T(i, j))) (k i), key1 i))

xor (xor (fst (kT i@pred (T1(i, j)))) (input@T(i, j))) (k i) auth. by key1(i)
(collision with xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) auth. by key1(ii))
in action T1(i, j)
in term
(happens(T1(i, j)),
<xor
(fst (kT i@pred (T1(i, j))))
(h2 (snd (kT i@pred (T1(i, j))), key2 i)),
xor
(snd (kT i@pred (T1(i, j))))
(h1
(xor (xor (fst (kT i@pred (T1(i, j)))) (input@T(i, j))) (k i),
key1 i))>)

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

[goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: ii,jj:index[const],t:timestamp[const]
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
(exists (jj0:index),
R1(jj0, ii) < R1(jj, ii) &&
xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii)) =>
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)



(* case 1/3: equality with hashed message in update@R1 *)
+ intro [jj0 [Ht Heq]].
[> Line 144: (intro) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: ii,jj,jj0:index[const],t:timestamp[const]
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii)
Ht: R1(jj0, ii) < R1(jj, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


executable pred(R1(jj,ii)) => // H.
[> Line 145: ((executable);(intro)) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: ii,jj,jj0:index[const],t:timestamp[const]
H: forall (t0:timestamp), t0 < R1(jj, ii) => exec@t0
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii)
Ht: R1(jj0, ii) < R1(jj, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


use H with R1(jj0,ii) as Ht1; 2: auto.
[> Line 146: ((have); 2: (auto)) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: ii,jj,jj0:index[const],t:timestamp[const]
H: forall (t0:timestamp), t0 < R1(jj, ii) => exec@t0
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii)
Ht: R1(jj0, ii) < R1(jj, ii)
Ht1: exec@R1(jj0, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


expand exec, cond.
[> Line 147: (expand) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: ii,jj,jj0:index[const],t:timestamp[const]
H: forall (t0:timestamp), t0 < R1(jj, ii) => exec@t0
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii)
Ht: R1(jj0, ii) < R1(jj, ii)
Ht1: exec@pred (R1(jj0, ii)) &&
input@R1(jj0, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii), key1 ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


destruct Ht1 as [_ _].
[> Line 148: (destruct) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: ii,jj,jj0:index[const],t:timestamp[const]
H: forall (t0:timestamp), t0 < R1(jj, ii) => exec@t0
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii)
Ht: R1(jj0, ii) < R1(jj, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
_: input@R1(jj0, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii), key1 ii)
_: exec@pred (R1(jj0, ii))
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


use IH0 with R1(jj0,ii),jj0,ii as [j _]; 2,3,4: auto.
[> Line 149: ((have); 2,3,4: (auto)) [goal> Focused goal (1/3):
System: (set:default; equiv:None)
Variables: ii,j,jj,jj0:index[const],t:timestamp[const]
H: forall (t0:timestamp), t0 < R1(jj, ii) => exec@t0
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii)
Ht: R1(jj0, ii) < R1(jj, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
_: T(ii, j) < R1(jj0, ii) && output@T(ii, j) = input@R1(jj0, ii)
_: input@R1(jj0, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj0, ii)))) (r1 jj0)) (k ii), key1 ii)
_: exec@pred (R1(jj0, ii))
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


by exists j.
[> Line 150: by (exists) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: ii,jj:index[const],t:timestamp[const]
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
(exists (j:index),
T(ii, j) < R1(jj, ii) &&
xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kT ii@T(ii, j))) (input@T(ii, j))) (k ii)) =>
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)



(* case 2/3: equality with hashed message in output@T *)
(* honest case *)
+ by intro [j _]; exists j.
[> Line 154: by ((intro);(exists)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,jj:index[const],t:timestamp[const]
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
(exists (j:index),
T1(ii, j) < R1(jj, ii) &&
xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kT ii@pred (T1(ii, j)))) (input@T(ii, j))) (k ii))
=>
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)



(* case 3/3: equality with hashed message in update@T1 *)
(* if there is an update@T1, then action T happened before *)
+ intro [j [Ht Heq]].
[> Line 158: (intro) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,j,jj:index[const],t:timestamp[const]
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kT ii@pred (T1(ii, j)))) (input@T(ii, j))) (k ii)
Ht: T1(ii, j) < R1(jj, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
exists (j:index), T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


exists j.
[> Line 159: (exists) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,j,jj:index[const],t:timestamp[const]
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kT ii@pred (T1(ii, j)))) (input@T(ii, j))) (k ii)
Ht: T1(ii, j) < R1(jj, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
----------------------------------------
T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


depends T(ii,j),T1(ii,j) by auto => _.
[> Line 160: (((depends); 1: by (auto));(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: ii,j,jj:index[const],t:timestamp[const]
H1: exec@pred (R1(jj, ii))
Hap: happens(R1(jj, ii))
Heq: xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii) =
xor (xor (fst (kT ii@pred (T1(ii, j)))) (input@T(ii, j))) (k ii)
Ht: T1(ii, j) < R1(jj, ii)
IH0: forall (t:timestamp,jj0,ii0:index),
t < R1(jj, ii) =>
happens(R1(jj0, ii0)) =>
t = R1(jj0, ii0) &&
exec@pred t &&
input@t =
h1 (xor (xor (fst (kR ii0@pred t)) (r1 jj0)) (k ii0), key1 ii0)
=> exists (j:index), T(ii0, j) < t && output@T(ii0, j) = input@t
Meq: input@R1(jj, ii) =
h1 (xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii), key1 ii)
_: T(ii, j) < T1(ii, j)
----------------------------------------
T(ii, j) < R1(jj, ii) && output@T(ii, j) = input@R1(jj, ii)


by rewrite /output (noUpdateTag (pred(T1(ii,j)))).
[> Line 161: by (rewrite) [goal> lemma auth_R1_induction is proved


Qed.
lemma auth_R1_induction @system:(set:default; equiv:None) :
forall (t:timestamp,jj,ii:index),
happens(R1(jj, ii)) =>
t = R1(jj, ii) && exec@t =>
exists (j:index), T(ii, j) < t && output@T(ii, j) = input@t
Exiting proof mode.



lemma auth_T1_induction (t:timestamp, i,j:index):
happens(t) =>
t = T1(i,j) && exec@t (* exec@t (not only cond@t) is needed *)
=>
exists (jj:index), R1(jj,i) < t && output@R1(jj,i) = input@t.
Goal auth_T1_induction :
happens(t) =>
t = T1(i, j) && exec@t =>
exists (jj:index), R1(jj, i) < t && output@R1(jj, i) = input@t

Proof.
[goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index,t:timestamp
----------------------------------------
happens(t) =>
t = T1(i, j) && exec@t =>
exists (jj:index), R1(jj, i) < t && output@R1(jj, i) = input@t


generalize i j.
[> Line 170: (generalize) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: t:timestamp[const]
----------------------------------------
forall (i,j:index),
happens(t) =>
t = T1(i, j) && exec@t =>
exists (jj:index), R1(jj, i) < t && output@R1(jj, i) = input@t



induction t => t IH0 i j Hap [Ht Hexec].
[> Line 171: ((induction);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],t:timestamp[const]
Hap: happens(t)
Hexec: exec@t
Ht: t = T1(i, j)
IH0: forall (t0:timestamp,i,j:index),
t0 < t =>
happens(t0) =>
t0 = T1(i, j) && exec@t0 =>
exists (jj:index), R1(jj, i) < t0 && output@R1(jj, i) = input@t0
----------------------------------------
exists (jj:index), R1(jj, i) < t && output@R1(jj, i) = input@t


rewrite Ht in *; clear Ht.
[> Line 172: ((rewrite);(clear)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],t:timestamp[const]
Hap: happens(T1(i, j))
Hexec: exec@T1(i, j)
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
----------------------------------------
exists (jj:index), R1(jj, i) < T1(i, j) && output@R1(jj, i) = input@T1(i, j)



rewrite /exec /cond in Hexec.
[> Line 174: (rewrite) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],t:timestamp[const]
Hap: happens(T1(i, j))
Hexec: exec@pred (T1(i, j)) &&
input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
----------------------------------------
exists (jj:index), R1(jj, i) < T1(i, j) && output@R1(jj, i) = input@T1(i, j)


destruct Hexec as [H1 Meq].
[> Line 175: (destruct) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j:index[const],t:timestamp[const]
H1: exec@pred (T1(i, j))
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
----------------------------------------
exists (jj:index), R1(jj, i) < T1(i, j) && output@R1(jj, i) = input@T1(i, j)


euf Meq => [jj [Clt H]].
[> Line 175: ((euf);(intro)) Indirect bad occurrences of key key2(i), and messages authenticated by it
in other actions:
snd (kR ii@pred (R1(jj, ii))) auth. by key2(ii)
(collision with snd (kT i@pred (T1(i, j))) auth. by key2(i))
in action R1(jj, ii)
in term (happens(R1(jj, ii)), m jj ii@R1(jj, ii))

snd (kR ii@pred (R1(jj, ii))) auth. by key2(ii)
(collision with snd (kT i@pred (T1(i, j))) auth. by key2(i))
in action R1(jj, ii)
in term
(happens(R1(jj, ii)),
<xor
(fst (kR ii@pred (R1(jj, ii))))
(h2 (snd (kR ii@pred (R1(jj, ii))), key2 ii)),
xor
(snd (kR ii@pred (R1(jj, ii))))
(h1
(xor (xor (fst (kR ii@pred (R1(jj, ii)))) (r1 jj)) (k ii),
key1 ii))>)

snd (kT i@pred (T1(i, j))) auth. by key2(i)
(collision with snd (kT i@pred (T1(i, j))) auth. by key2(i))
in action T1(i, j)
in term
(happens(T1(i, j)),
<xor
(fst (kT i@pred (T1(i, j))))
(h2 (snd (kT i@pred (T1(i, j))), key2 i)),
xor
(snd (kT i@pred (T1(i, j))))
(h1
(xor (xor (fst (kT i@pred (T1(i, j)))) (input@T(i, j))) (k i),
key1 i))>)

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

[goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j,jj:index[const],t:timestamp[const]
Clt: R1(jj, i) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kR i@pred (R1(jj, i)))
H1: exec@pred (T1(i, j))
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
----------------------------------------
exists (jj:index), R1(jj, i) < T1(i, j) && output@R1(jj, i) = input@T1(i, j)



(* case 1/3: equality with hashed message in output@R1 *)
(* honest case *)
+ by exists jj.
[> Line 180: by (exists) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,jj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
----------------------------------------
exists (jj:index), R1(jj, i) < T1(i, j) && output@R1(jj, i) = input@T1(i, j)



(* case 3/3: equality with hashed message in update@T1 *)
+ use IH0 with T1(i,jj), i, jj as [jjj [_ H2]] => //.
[> Line 182: ((have);(intro)) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j,jj,jjj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
H2: output@R1(jjj, i) = input@T1(i, jj)
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
_: R1(jjj, i) < T1(i, jj)
----------------------------------------
exists (jj:index), R1(jj, i) < T1(i, j) && output@R1(jj, i) = input@T1(i, j)

{
exists jjj => /=.
[> Line 184: ((exists);(intro)) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j,jj,jjj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
H2: output@R1(jjj, i) = input@T1(i, jj)
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
_: R1(jjj, i) < T1(i, jj)
----------------------------------------
output@R1(jjj, i) = input@T1(i, j)


rewrite H2 Meq H.
[> Line 184: (rewrite) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j,jj,jjj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
H2: output@R1(jjj, i) = input@T1(i, jj)
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
_: R1(jjj, i) < T1(i, jj)
----------------------------------------
input@T1(i, jj) = h2 (snd (kT i@pred (T1(i, jj))), key2 i)


executable pred(T1(i,j)); try auto.
[> Line 185: ((executable);(try (auto))) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j,jj,jjj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
H2: output@R1(jjj, i) = input@T1(i, jj)
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
_: R1(jjj, i) < T1(i, jj)
----------------------------------------
(forall (t0:timestamp), t0 < T1(i, j) => exec@t0) =>
input@T1(i, jj) = h2 (snd (kT i@pred (T1(i, jj))), key2 i)


intro H3.
[> Line 187: (intro) [goal> Focused goal (1/2):
System: (set:default; equiv:None)
Variables: i,j,jj,jjj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
H2: output@R1(jjj, i) = input@T1(i, jj)
H3: forall (t0:timestamp), t0 < T1(i, j) => exec@t0
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
_: R1(jjj, i) < T1(i, jj)
----------------------------------------
input@T1(i, jj) = h2 (snd (kT i@pred (T1(i, jj))), key2 i)


by apply H3 in Clt.
[> Line 188: by (apply) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,jj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
----------------------------------------
T1(i, jj) = T1(i, jj) && exec@T1(i, jj)


}

simpl.
[> Line 191: (simpl) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,jj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
----------------------------------------
exec@T1(i, jj)


executable pred(T1(i,j)) => // H3.
[> Line 192: ((executable);(intro)) [goal> Focused goal (1/1):
System: (set:default; equiv:None)
Variables: i,j,jj:index[const],t:timestamp[const]
Clt: T1(i, jj) < T1(i, j)
H: snd (kT i@pred (T1(i, j))) = snd (kT i@pred (T1(i, jj)))
H1: exec@pred (T1(i, j))
H3: forall (t0:timestamp), t0 < T1(i, j) => exec@t0
Hap: happens(T1(i, j))
IH0: forall (t:timestamp,i0,j0:index),
t < T1(i, j) =>
happens(t) =>
t = T1(i0, j0) && exec@t =>
exists (jj:index), R1(jj, i0) < t && output@R1(jj, i0) = input@t
Meq: input@T1(i, j) = h2 (snd (kT i@pred (T1(i, j))), key2 i)
----------------------------------------
exec@T1(i, jj)


by apply H3.
[> Line 193: by (apply) [goal> lemma auth_T1_induction is proved


Qed.
lemma auth_T1_induction @system:(set:default; equiv:None) :
forall (t:timestamp,i,j:index),
happens(t) =>
t = T1(i, j) && exec@t =>
exists (jj:index), R1(jj, i) < t && output@R1(jj, i) = input@t
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: