
theorem Th19:
  for S being non void Circuit-like non empty ManySortedSign for
A being non-empty Circuit of S, s being State of A for g being Gate of S st for
x being set st x in rng the_arity_of g holds s is_stable_at x holds Following s
  is_stable_at the_result_sort_of g
proof
  let S be non void Circuit-like non empty ManySortedSign;
  let A be non-empty Circuit of S;
  let s be State of A;
  let g be Gate of S;
  set p = the_arity_of g;
  assume
A1: for x being set st x in rng p holds s is_stable_at x;
  let n be Nat;
A2: now
    let a be object;
    assume
A3: a in dom p;
    then p.a in rng p by FUNCT_1:def 3;
    then
A4: s is_stable_at p.a by A1;
    ((Following(s, n))*p).a = (Following(s, n)).(p.a) & (s*p).a = s.(p . a
    ) by A3,FUNCT_1:13;
    hence ((Following(s, n))*p).a = (s*p).a by A4;
  end;
A5: rng p c= the carrier of S by FINSEQ_1:def 4;
  dom Following(s, n) = the carrier of S by CIRCUIT1:3;
  then
A6: dom ((Following(s, n))*p) = dom p by A5,RELAT_1:27;
  dom s = the carrier of S by CIRCUIT1:3;
  then dom (s*p) = dom p by A5,RELAT_1:27;
  then
A7: (Following(s, n))*p = s*p by A6,A2,FUNCT_1:2;
  thus (Following(Following s, n)).the_result_sort_of g = (Following(s, n+1)).
  the_result_sort_of g by Th16
    .= (Following Following(s, n)).the_result_sort_of g by Th12
    .= (Den(g,A)).((Following(s, n))*p) by Th10
    .= (Following s).the_result_sort_of g by A7,Th10;
end;
