
theorem Th12:
  for f,g being nonpair-yielding FinSequence for n being Nat holds
  InputVertices ((n+1)-BitGFA0Str(f,g)) =
  (InputVertices (n-BitGFA0Str(f,g)))\/
  ((InputVertices BitGFA0Str(f.(n+1),g.(n+1),
  n-BitGFA0CarryOutput(f,g)) \ {n-BitGFA0CarryOutput(f,g)})) &
  InnerVertices (n-BitGFA0Str(f,g)) is Relation &
  InputVertices (n-BitGFA0Str(f,g)) is without_pairs
proof
  set f1 = and2, f2 = and2, f3 = and2, f0 = xor2;
  let f,g be nonpair-yielding FinSequence;
  deffunc Sn(Nat) = $1-BitGFA0Str(f,g);
  deffunc S(set, Nat) = BitGFA0Str(f.($2+1),g.($2+1), $1);
  deffunc F(Nat) = $1-BitGFA0CarryOutput(f,g);
  consider h being ManySortedSet of NAT such that
A1: for n being Element of NAT holds h.n = F(n) from PBOOLE:sch 5;
  deffunc h(Nat) = h.$1;
  deffunc o(set, Nat) = GFA0CarryOutput(f.($2+1),g.($2+1), $1);
  set k = (0-tuples_on BOOLEAN)-->FALSE;
A2: Sn(0) = 1GateCircStr(<*>, k) by Th2;
  then
A3: InnerVertices Sn(0) is Relation by FACIRC_1:38;
A4: InputVertices Sn(0) is without_pairs by A2,FACIRC_1:39;
  h(0) = F(0) by A1;
  then
A5: h.0 in InnerVertices Sn(0);
A6: for n being Nat, x being set holds
  InnerVertices S(x,n) is Relation by GFACIRC1:32;
A7: now
    let n be Nat, x be set such that
A8: x = h(n);
    n in NAT by ORDINAL1:def 12;
    then
A9: h(n) = F(n) by A1;
    then
A10: x <> [<*f.(n+1),g.(n+1)*>, f1] by A8,Lm2;
    x <> [<*f.(n+1),g.(n+1)*>, f0] by A8,A9,Lm2;
    hence InputVertices S(x, n) = {f.(n+1), g.(n+1), x} by A10,GFACIRC1:33;
  end;
A11: for n being Nat, x being set st x = h.n holds
  (InputVertices S(x, n)) \ {x} is without_pairs
  proof
    let n be Nat, x be set;
    assume x = h(n);
    then
A12: InputVertices S(x, n) = {f.(n+1), g.(n+1), x} by A7;
    thus (InputVertices S(x, n)) \ {x} is without_pairs
    proof
      let a be pair object;
      assume
A13:  a in (InputVertices S(x, n)) \ {x};
      then a in InputVertices S(x, n) by XBOOLE_0:def 5;
      then
A14:  a = f.(n+1) or a = g.(n+1) or a = x by A12,ENUMSET1:def 1;
      not a in {x} by A13,XBOOLE_0:def 5;
      hence contradiction by A14,TARSKI:def 1;
    end;
  end;
A15: now
    let n be Nat, S be non empty ManySortedSign, x be set;
    assume that
A16: S = Sn(n) and
A17: x = h.n;
    n in NAT by ORDINAL1:def 12;
    then
A18: x = n-BitGFA0CarryOutput(f,g) by A1,A17;
A19: h(n+1) = (n+1)-BitGFA0CarryOutput(f,g) by A1;
    thus Sn(n+1) = S +* S(x,n) by A16,A18,Th7;
    thus h.(n+1) = o(x, n) by A18,A19,Th7;
    InputVertices S(x, n) = {f.(n+1), g.(n+1), x} by A7,A17;
    hence x in InputVertices S(x,n) by ENUMSET1:def 1;
A20: InnerVertices S(x, n) = {[<*f.(n+1),g.(n+1)*>,f0]} \/
    {GFA0AdderOutput(f.(n+1),g.(n+1),x)} \/ {[<*f.(n+1),g.(n+1)*>,f1],
    [<*g.(n+1),x*>,f2], [<*x,f.(n+1)*>,f3]} \/
    {GFA0CarryOutput(f.(n+1),g.(n+1),x)} by GFACIRC1:31;
    o(x,n) in {o(x,n)} by TARSKI:def 1;
    hence o(x, n) in InnerVertices S(x, n) by A20,XBOOLE_0:def 3;
  end;
A21: for n being Nat holds InputVertices Sn(n+1) =
  (InputVertices Sn(n)) \/ ((InputVertices S(h.(n),n)) \ {h.(n)}) &
  InnerVertices Sn(n) is Relation & InputVertices Sn(n) is without_pairs
  from CIRCCMB2:sch 11(A3,A4,A5,A6,A11,A15);
  let n be Nat;
  n in NAT by ORDINAL1:def 12;
  then h.n = n-BitGFA0CarryOutput(f,g) by A1;
  hence thesis by A21;
end;
