
theorem Th29:
  for x,y,c being set st
  x <> [<*y,c*>, '&'] & y <> [<*c,x*>, '&'] & c <> [<*x,y*>, '&']
  for s being State of MajorityCirc(x,y,c)
  holds Following(s,2) is stable
proof
  let x,y,c be set;
  set S = MajorityStr(x,y,c);
  assume that
A1: x <> [<*y,c*>, '&'] and
A2: y <> [<*c,x*>, '&'] and
A3: c <> [<*x,y*>, '&'];
  let s be State of MajorityCirc(x,y,c);
A4: dom Following Following(s,2) = the carrier of S by CIRCUIT1:3;
A5: dom Following(s,2) = the carrier of S by CIRCUIT1:3;
  reconsider xx = x, yy = y, cc = c as Vertex of S by FACIRC_1:72;
  set a1 = s.xx, a2 = s.yy, a3 = s.cc;
  set ffs = Following(s,2), fffs = Following ffs;
A6: a1 = s.x;
A7: a2 = s.y;
A8: a3 = s.c;
A9: ffs.MajorityOutput(x,y,c) = a1 '&' a2 'or' a2 '&' a3 'or' a3 '&' a1 by A1
,A2,A3,Lm4;
A10: ffs.[<*x,y*>,'&'] = a1 '&' a2 by A1,A2,A3,A8,Lm4;
A11: ffs.[<*y,c*>,'&'] = a2 '&' a3 by A1,A2,A3,A6,Lm4;
A12: ffs.[<*c,x*>,'&'] = a3 '&' a1 by A1,A2,A3,A7,Lm4;
A13: ffs = Following Following s by FACIRC_1:15;
A14: InputVertices S = {x,y,c} by A1,A2,A3,Th20;
  then
A15: x in InputVertices S by ENUMSET1:def 1;
A16: y in InputVertices S by A14,ENUMSET1:def 1;
A17: c in InputVertices S by A14,ENUMSET1:def 1;
A18: (Following s).x = a1 by A15,CIRCUIT2:def 5;
A19: (Following s).y = a2 by A16,CIRCUIT2:def 5;
A20: (Following s).c = a3 by A17,CIRCUIT2:def 5;
A21: ffs.x = a1 by A13,A15,A18,CIRCUIT2:def 5;
A22: ffs.y = a2 by A13,A16,A19,CIRCUIT2:def 5;
A23: ffs.c = a3 by A13,A17,A20,CIRCUIT2:def 5;
  now
    let a be object;
    assume
A24: a in the carrier of S;
    then reconsider v = a as Vertex of S;
A25: v in InputVertices S \/ InnerVertices S by A24,XBOOLE_1:45;
    thus ffs.a = (fffs).a proof per cases by A25,XBOOLE_0:def 3;
      suppose v in InputVertices S;
        hence thesis by CIRCUIT2:def 5;
      end;
      suppose v in InnerVertices S;
        then v in {[<*x,y*>,'&'], [<*y,c*>,'&'], [<*c,x*>,'&']} \/
        {MajorityOutput(x,y,c)} by Th19;
        then v in {[<*x,y*>,'&'], [<*y,c*>,'&'], [<*c,x*>,'&']} or
        v in {MajorityOutput(x,y,c)} by XBOOLE_0:def 3;
        then v = [<*x,y*>,'&'] or v = [<*y,c*>,'&'] or v = [<*c,x*>,'&'] or
        v = MajorityOutput(x,y,c) by ENUMSET1:def 1,TARSKI:def 1;
        hence thesis by A9,A10,A11,A12,A21,A22,A23,Lm3,Th28;
      end;
    end;
  end;
  hence ffs = fffs by A4,A5,FUNCT_1:2;
end;
