let B be set ; :: thesis: for R being Rule
for P, P1, P2 being Formula-sequence
for n being Nat st n in dom P & P ^ P1,n is_a_correct_step_wrt B,R holds
P ^ P2,n is_a_correct_step_wrt B,R

let R be Rule; :: thesis: for P, P1, P2 being Formula-sequence
for n being Nat st n in dom P & P ^ P1,n is_a_correct_step_wrt B,R holds
P ^ P2,n is_a_correct_step_wrt B,R

let P, P1, P2 be Formula-sequence; :: thesis: for n being Nat st n in dom P & P ^ P1,n is_a_correct_step_wrt B,R holds
P ^ P2,n is_a_correct_step_wrt B,R

let n be Nat; :: thesis: ( n in dom P & P ^ P1,n is_a_correct_step_wrt B,R implies P ^ P2,n is_a_correct_step_wrt B,R )
assume that
A1: n in dom P and
A2: P ^ P1,n is_a_correct_step_wrt B,R ; :: thesis: P ^ P2,n is_a_correct_step_wrt B,R
A3: P . n = (P ^ P2) . n by A1, FINSEQ_1:def 7;
P . n = (P ^ P1) . n by A1, FINSEQ_1:def 7;
per cases then ( P . n in B or ex Q being Formula-finset st
( [Q,(P . n)] in R & ( for t being object st t in Q holds
ex m being Nat st
( m in dom (P ^ P1) & m < n & (P ^ P1) . m = t ) ) ) )
by A2;
suppose P . n in B ; :: thesis: P ^ P2,n is_a_correct_step_wrt B,R
end;
suppose ex Q being Formula-finset st
( [Q,(P . n)] in R & ( for t being object st t in Q holds
ex m being Nat st
( m in dom (P ^ P1) & m < n & (P ^ P1) . m = t ) ) ) ; :: thesis: P ^ P2,n is_a_correct_step_wrt B,R
then consider Q being Formula-finset such that
A10: [Q,(P . n)] in R and
A11: for t being object st t in Q holds
ex m being Nat st
( m in dom (P ^ P1) & m < n & (P ^ P1) . m = t ) ;
A13: for t being object st t in Q holds
ex m being Nat st
( m in dom (P ^ P2) & m < n & (P ^ P2) . m = t )
proof
let t be object ; :: thesis: ( t in Q implies ex m being Nat st
( m in dom (P ^ P2) & m < n & (P ^ P2) . m = t ) )

assume t in Q ; :: thesis: ex m being Nat st
( m in dom (P ^ P2) & m < n & (P ^ P2) . m = t )

then consider m being Nat such that
A14: m in dom (P ^ P1) and
A15: m < n and
A16: (P ^ P1) . m = t by A11;
take m ; :: thesis: ( m in dom (P ^ P2) & m < n & (P ^ P2) . m = t )
A20: m in dom P by A1, A14, A15, Lm40;
dom P c= dom (P ^ P2) by FINSEQ_1:26;
hence m in dom (P ^ P2) by A1, A14, A15, Lm40; :: thesis: ( m < n & (P ^ P2) . m = t )
thus m < n by A15; :: thesis: (P ^ P2) . m = t
thus (P ^ P2) . m = P . m by A20, FINSEQ_1:def 7
.= t by A16, A20, FINSEQ_1:def 7 ; :: thesis: verum
end;
thus P ^ P2,n is_a_correct_step_wrt B,R by A3, A10, A13; :: thesis: verum
end;
end;