
theorem
  for n be Nat for x,y being FinSeqLen of n for a,b being set holds
  (n+1)-BitGFA0Str(x^<*a*>, y^<*b*>) = n-BitGFA0Str(x, y) +*
  BitGFA0Str(a, b, n-BitGFA0CarryOutput(x, y)) &
  (n+1)-BitGFA0Circ(x^<*a*>, y^<*b*>) = n-BitGFA0Circ(x, y) +*
  BitGFA0Circ(a, b, n-BitGFA0CarryOutput(x, y)) &
  (n+1)-BitGFA0CarryOutput(x^<*a*>, y^<*b*>) =
  GFA0CarryOutput(a, b, n-BitGFA0CarryOutput(x, y))
proof
  set f0 = 1GateCircStr(<*>,(0-tuples_on BOOLEAN)-->FALSE);
  set g0 = 1GateCircuit(<*>,(0-tuples_on BOOLEAN)-->FALSE);
  set h0 = [<*>, (0-tuples_on BOOLEAN)-->FALSE];
  let n be Nat;
  let x,y be FinSeqLen of n;
  let a,b be set;
  set p = x^<*a*>, q = y^<*b*>;
  consider f,g,h being ManySortedSet of NAT such that
A1: n-BitGFA0Str(p,q) = f.n and
A2: n-BitGFA0Circ(p,q) = g.n and
A3: f.0 = f0 and
A4: g.0 = g0 and
A5: h.0 = h0 and
A6: for n being Nat, S being non empty ManySortedSign,
  A being non-empty MSAlgebra over S
  for z be set st S = f.n & A = g.n & z = h.n holds
  f.(n+1) = S +* BitGFA0Str(p.(n+1), q.(n+1), z) &
  g.(n+1) = A +* BitGFA0Circ(p.(n+1), q.(n+1), z) &
  h.(n+1) = GFA0CarryOutput(p.(n+1), q.(n+1), z) by Def2;
A7: n-BitGFA0CarryOutput(x^<*a*>, y^<*b*>) = h.n by A3,A4,A5,A6,Th1;
A8: (n+1)-BitGFA0Str(x^<*a*>, y^<*b*>) = f.(n+1) by A3,A4,A5,A6,Th1;
A9: (n+1)-BitGFA0Circ(x^<*a*>, y^<*b*>) = g.(n+1) by A3,A4,A5,A6,Th1;
A10: (n+1)-BitGFA0CarryOutput(x^<*a*>, y^<*b*>) = h.(n+1) by A3,A4,A5,A6,Th1;
A11: len x = n by CARD_1:def 7;
A12: len y = n by CARD_1:def 7;
A13: p.(n+1) = a by A11,FINSEQ_1:42;
A14: q.(n+1) = b by A12,FINSEQ_1:42;
A15: x^<*> = x by FINSEQ_1:34;
A16: y^<*> = y by FINSEQ_1:34;
  then
A17: n-BitGFA0Str(p, q) = n-BitGFA0Str(x, y) by A15,Th5;
A18: n-BitGFA0Circ(p, q) = n-BitGFA0Circ(x, y) by A15,A16,Th5;
  n-BitGFA0CarryOutput(p, q) = n-BitGFA0CarryOutput(x, y) by A15,A16,Th5;
  hence thesis by A1,A2,A6,A7,A8,A9,A10,A13,A14,A17,A18;
end;
