
theorem
  for X being finite non empty set, n being Nat for p being FinSeqLen of
n for f being Function of n-tuples_on X, X for s being State of 1GateCircuit(p,
  f) holds Following s is stable
proof
  let X be finite non empty set, n be Nat;
  let p be FinSeqLen of n;
  let f be Function of n-tuples_on X, X;
  set S = 1GateCircStr(p,f);
  let s be State of 1GateCircuit(p,f);
  set s1 = Following s, s2 = Following s1;
A1: dom s1 = the carrier of S by CIRCUIT1:3;
A2: the carrier of S = rng p \/ {[p,f]} by CIRCCOMB:def 6;
A3: InputVertices S = rng p by CIRCCOMB:42;
A4: InnerVertices S = {[p,f]} by CIRCCOMB:42;
A5: now
    let a be object;
    assume a in the carrier of S;
    then reconsider v = a as Vertex of S;
    dom s = the carrier of S by CIRCUIT1:3;
    then
A6: dom (s*p) = dom p by A2,RELAT_1:27,XBOOLE_1:7;
A7: dom (s1*p) = dom p by A1,A2,RELAT_1:27,XBOOLE_1:7;
A8: now
      let i be object;
      assume
A9:   i in dom p;
      then
A10:  p.i in rng p by FUNCT_1:3;
      (s1*p).i = s1.(p.i) & (s*p).i = s.(p.i) by A7,A6,A9,FUNCT_1:12;
      hence (s1*p).i = (s*p).i by A3,A10,CIRCUIT2:def 5;
    end;
    v in rng p or v in {[p,f]} by A2,XBOOLE_0:def 3;
    then
    s2.v = s1.v or v = [p,f] & (v = [p,f] implies action_at v = v) & s2.v
= (Den(action_at v, 1GateCircuit(p,f))). (action_at v depends_on_in s1) & s1.v
    = (Den(action_at v, 1GateCircuit(p,f))). (action_at v depends_on_in s) & (
    action_at v = [p,f] implies action_at v depends_on_in s = s*p & action_at v
    depends_on_in s1 = s1*p) by A3,A4,Th1,CIRCCOMB:41,CIRCUIT2:def 5
,TARSKI:def 1;
    hence s2.a = s1.a by A7,A6,A8,FUNCT_1:2;
  end;
  dom s2 = the carrier of S by CIRCUIT1:3;
  hence Following s = Following Following s by A1,A5,FUNCT_1:2;
end;
