let Z1, Z2 be Tree; :: thesis: for p being FinSequence of NAT st p in Z1 holds
for v being Element of Z1 with-replacement (p,Z2)
for w being Element of Z1 st v = w & w is_a_proper_prefix_of p holds
succ v = succ w

let p be FinSequence of NAT ; :: thesis: ( p in Z1 implies for v being Element of Z1 with-replacement (p,Z2)
for w being Element of Z1 st v = w & w is_a_proper_prefix_of p holds
succ v = succ w )

assume A1: p in Z1 ; :: thesis: for v being Element of Z1 with-replacement (p,Z2)
for w being Element of Z1 st v = w & w is_a_proper_prefix_of p holds
succ v = succ w

set Z = Z1 with-replacement (p,Z2);
let v be Element of Z1 with-replacement (p,Z2); :: thesis: for w being Element of Z1 st v = w & w is_a_proper_prefix_of p holds
succ v = succ w

let w be Element of Z1; :: thesis: ( v = w & w is_a_proper_prefix_of p implies succ v = succ w )
assume that
A2: v = w and
A3: w is_a_proper_prefix_of p ; :: thesis: succ v = succ w
w is_a_prefix_of p by A3;
then consider r being FinSequence such that
A4: p = w ^ r by TREES_1:1;
now :: thesis: for n being Nat st n in dom r holds
r . n in NAT
let n be Nat; :: thesis: ( n in dom r implies r . n in NAT )
assume A5: n in dom r ; :: thesis: r . n in NAT
then (len w) + n in dom p by A4, FINSEQ_1:28;
then A6: p . ((len w) + n) in rng p by FUNCT_1:def 3;
p . ((len w) + n) = r . n by A4, A5, FINSEQ_1:def 7;
hence r . n in NAT by A6; :: thesis: verum
end;
then reconsider r = r as FinSequence of NAT by FINSEQ_2:12;
A7: r <> {} by A3, A4, FINSEQ_1:34;
now :: thesis: for x being object holds
( ( x in succ v implies x in succ w ) & ( x in succ w implies x in succ v ) )
let x be object ; :: thesis: ( ( x in succ v implies x in succ w ) & ( x in succ w implies x in succ v ) )
thus ( x in succ v implies x in succ w ) :: thesis: ( x in succ w implies x in succ v )
proof
assume x in succ v ; :: thesis: x in succ w
then x in { (v ^ <*n*>) where n is Nat : v ^ <*n*> in Z1 with-replacement (p,Z2) } by TREES_2:def 5;
then consider n being Nat such that
A8: x = v ^ <*n*> and
A9: v ^ <*n*> in Z1 with-replacement (p,Z2) ;
reconsider n = n as Element of NAT by ORDINAL1:def 12;
x = v ^ <*n*> by A8;
then reconsider x9 = x as FinSequence of NAT ;
now :: thesis: x in succ w
per cases ( ( x9 in Z1 & not p is_a_proper_prefix_of x9 ) or ex r being FinSequence of NAT st
( r in Z2 & x9 = p ^ r ) )
by A1, A8, A9, TREES_1:def 9;
suppose ( x9 in Z1 & not p is_a_proper_prefix_of x9 ) ; :: thesis: x in succ w
then x in { (w ^ <*m*>) where m is Nat : w ^ <*m*> in Z1 } by A2, A8;
hence x in succ w by TREES_2:def 5; :: thesis: verum
end;
suppose ex r being FinSequence of NAT st
( r in Z2 & x9 = p ^ r ) ; :: thesis: x in succ w
then consider s being FinSequence of NAT such that
s in Z2 and
A10: v ^ <*n*> = p ^ s by A8;
w ^ <*n*> = w ^ (r ^ s) by A2, A4, A10, FINSEQ_1:32;
then A11: <*n*> = r ^ s by FINSEQ_1:33;
s = {} then <*n*> = r by A11, FINSEQ_1:34;
then x in { (w ^ <*m*>) where m is Nat : w ^ <*m*> in Z1 } by A1, A2, A4, A8;
hence x in succ w by TREES_2:def 5; :: thesis: verum
end;
end;
end;
hence x in succ w ; :: thesis: verum
end;
assume x in succ w ; :: thesis: x in succ v
then x in { (w ^ <*n*>) where n is Nat : w ^ <*n*> in Z1 } by TREES_2:def 5;
then consider n being Nat such that
A13: x = w ^ <*n*> and
A14: w ^ <*n*> in Z1 ;
reconsider n = n as Element of NAT by ORDINAL1:def 12;
now :: thesis: v ^ <*n*> in Z1 with-replacement (p,Z2)end;
then x in { (v ^ <*m*>) where m is Nat : v ^ <*m*> in Z1 with-replacement (p,Z2) } by A2, A13;
hence x in succ v by TREES_2:def 5; :: thesis: verum
end;
hence succ v = succ w by TARSKI:2; :: thesis: verum