
theorem Th26:
  for f,g being nonpair-yielding FinSequence for n being Nat holds
  InputVertices ((n+1)-BitAdderStr(f,g)) =
  (InputVertices (n-BitAdderStr(f,g)))\/
  ((InputVertices BitAdderWithOverflowStr(f.(n+1),g.(n+1),
  n-BitMajorityOutput(f,g)) \ {n-BitMajorityOutput(f,g)})) &
  InnerVertices (n-BitAdderStr(f,g)) is Relation &
  InputVertices (n-BitAdderStr(f,g)) is without_pairs
proof
  let f,g be nonpair-yielding FinSequence;
  deffunc Sn(Nat) = $1-BitAdderStr(f,g);
  deffunc S(set, Nat)
  = BitAdderWithOverflowStr(f.($2+1),g.($2+1), $1);
  deffunc H(Nat) = $1-BitMajorityOutput(f,g);
  consider h being ManySortedSet of NAT such that
A1: for n being Element of NAT holds h.n = H(n) from PBOOLE:sch 5;
A2: for n being Nat holds h.n = H(n)
   proof let n be Nat;
     n in NAT by ORDINAL1:def 12;
    hence thesis by A1;
   end;
  deffunc h(Nat) = h.$1;
  deffunc o(set, Nat) = MajorityOutput(f.($2+1),g.($2+1), $1);
  set k = (0-tuples_on BOOLEAN)-->FALSE;
A3: 0-BitAdderStr(f,g) = 1GateCircStr(<*>, k) by Th7;
  then
A4: InnerVertices Sn(0) is Relation by FACIRC_1:38;
A5: InputVertices Sn(0) is without_pairs by A3,FACIRC_1:39;
  h(0) = 0-BitMajorityOutput(f,g) by A2;
  then
A6: h.(0) in InnerVertices Sn(0);
A7: for n being Nat, x being set
  holds InnerVertices S(x,n) is Relation by FACIRC_1:88;
A8: now
    let n be Nat, x be set such that
A9: x = h(n);
A10: h(n) = n-BitMajorityOutput(f,g) by A2;
    then
A11: x <> [<*f.(n+1),g.(n+1)*>, '&'] by A9,Th25;
    x <> [<*f.(n+1),g.(n+1)*>, 'xor'] by A9,A10,Th25;
    hence InputVertices S(x, n) = {f.(n+1), g.(n+1), x} by A11,Th22;
  end;
A12: 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
A13: InputVertices S(x, n) = {f.(n+1), g.(n+1), x} by A8;
    thus (InputVertices S(x, n)) \ {x} is without_pairs
    proof
      let a be pair object;
      assume
A14:  a in (InputVertices S(x, n)) \ {x};
      then a in InputVertices S(x, n) by XBOOLE_0:def 5;
      then
A15:  a = f.(n+1) or a = g.(n+1) or a = x by A13,ENUMSET1:def 1;
      not a in {x} by A14,XBOOLE_0:def 5;
      hence contradiction by A15,TARSKI:def 1;
    end;
  end;
A16: now
    let n be Nat, S be non empty ManySortedSign, x be set;
    assume that
A17: S = Sn(n) and
A18: x = h.n;
A19: x = n-BitMajorityOutput(f,g) by A2,A18;
A20: h(n+1) = (n+1)-BitMajorityOutput(f,g ) by A2;
    thus Sn(n+1) = S +* S(x,n) by A17,A19,Th12;
    thus h.(n+1) = o(x, n) by A19,A20,Th12;
    InputVertices S(x, n) = {f.(n+1), g.(n+1), x} by A8,A18;
    hence x in InputVertices S(x,n) by ENUMSET1:def 1;
A21: InnerVertices S(x, n) =
    {[<*f.(n+1),g.(n+1)*>, 'xor'], 2GatesCircOutput(f.(n+1),g.(n+1),x,'xor')}
    \/ {[<*f.(n+1),g.(n+1)*>,'&'], [<*g.(n+1),x*>,'&'],
    [<*x,f.(n+1)*>,'&']} \/ {MajorityOutput(f.(n+1),g.(n+1),x)} by Th23;
    o(x,n) in {o(x,n)} by TARSKI:def 1;
    hence o(x, n) in InnerVertices S(x, n) by A21,XBOOLE_0:def 3;
  end;
A22: 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(A4,A5,A6,A7
  ,A12,
  A16);
  let n be Nat;
  h.n = n-BitMajorityOutput(f,g) by A2;
  hence thesis by A22;
end;
