
theorem Th12:
  for x being set, X being non empty finite set for n being
Element of NAT for p being FinSeqLen of n for g being Function of n-tuples_on X
, X for s being State of 1GateCircuit(p,g) holds s*p is Element of n-tuples_on
  X
proof
  let x be set, X be non empty finite set;
  let n being Element of NAT;
  let p being FinSeqLen of n;
  let g be Function of n-tuples_on X, X;
  let s be State of 1GateCircuit(p,g);
  set S = 1GateCircStr(p,g), A=1GateCircuit(p,g);
A1: rng (s*p) c= X
  proof
    let o be object;
A2: rng s c= X
    proof
      reconsider tc = the carrier of S as non empty set;
      let z be object;
      reconsider tS = the Sorts of A as non-empty ManySortedSet of tc;
      assume z in rng s;
      then consider a being object such that
A3:   a in dom s and
A4:   z = s.a by FUNCT_1:def 3;
      reconsider a as Vertex of S by A3,CIRCUIT1:3;
      dom s = dom tS by CARD_3:9;
      then s.a in (the Sorts of A).a by A3,CARD_3:9;
      hence thesis by A4,CIRCCOMB:54;
    end;
    assume o in rng (s*p);
    then o in rng s by FUNCT_1:14;
    hence thesis by A2;
  end;
A5: rng p c= dom s
  proof
    let o be object;
    assume o in rng p;
    then o in rng p \/ {[p,g]} by XBOOLE_0:def 3;
    then o in the carrier of S by CIRCCOMB:def 6;
    hence thesis by CIRCUIT1:3;
  end;
  then s*p is FinSequence by FINSEQ_1:16;
  then reconsider sx=s*p as FinSequence of X by A1,FINSEQ_1:def 4;
  len sx = len p by A5,FINSEQ_2:29
    .= n by CARD_1:def 7;
  hence thesis by FINSEQ_2:92;
end;
