
theorem
  for P being non empty PreferenceSpace holds
    P is total iff
      CharRel P is connected Order of the carrier of P
  proof
    let P be non empty PreferenceSpace;
Z1: P is total implies CharRel P is connected Order of the carrier of P
    proof
      assume
A1:   P is total;
      set R = the PrefRel of P,
          T = the ToleranceRel of P,
          X = the carrier of P,
          I = the InternalRel of P,
          C = CharRel P;
k2:   R \/ R~ \/ T \/ I = nabla X by PrefDef;
      T is total by PrefDef; then
A5:   field T = X by ORDERS_1:12;
      T is symmetric by PrefDef; then
Y5:   T = T~ by RELAT_2:13;
      R is asymmetric by PrefDef; then
Y6:   R /\ R~ = {} by Lemma17,XBOOLE_0:def 7;
a4:   field (R \/ T) = field R \/ field T by RELAT_1:18
        .= X by A5,XBOOLE_1:12;
      C \/ C~ = (R \/ T) \/ (R~ \/ T~) by RELAT_1:23
        .= [:X,X:] by A1,k2,XBOOLE_1:5; then
ss:   CharRel P is strongly_connected by RELAT_2:30,a4;
      C is_reflexive_in X by a4,ss,RELAT_2:def 9; then
A3:   dom C = X by ORDERS_1:13;
y1:   C /\ C~ = (R \/ T) /\ (R~ \/ T~) by RELAT_1:23
        .= T \/ (R /\ R~) by XBOOLE_1:24,Y5
        .= id X by Y6,A1;
Y9:   (R*R) \/ (R \/ id X) c= R \/ (R \/ id X) by XBOOLE_1:9,A1,RELAT_2:27;
y7:   R \/ (R \/ id X) c= R \/ id X \/ (R \/ id X) by XBOOLE_1:7,XBOOLE_1:9;
B9:   dom R c= X;
B10:  rng R c= X;
B11:  dom (id X) c= X;
B13:  (R \/ id X) * id X = (R * id X) \/ (id X * id X) by SYSREL:6;
W2:   id X * R = R by RELAT_1:51,B9;
W3:   R * id X = R by RELAT_1:53,B10;
W4:   id X * id X = id X by RELAT_1:51,B11;
      C * C = ((R \/ id X) * R) \/ ((R \/ id X) * id X) by RELAT_1:32,A1
        .= ((R * R) \/ (id X * R)) \/ ((R * id X) \/ (id X * id X))
          by SYSREL:6,B13
        .= (R * R) \/ (R \/ (R \/ id X)) by XBOOLE_1:4,W2,W3,W4
        .= (R * R) \/ (R \/ id X) by XBOOLE_1:6;
      hence thesis by y1,ss,A3,RELAT_2:27,XBOOLE_1:1,
        Y9,A1,y7,PARTFUN1:def 2,RELAT_2:22;
    end;
    CharRel P is connected Order of the carrier of P implies
      P is total
    proof
      assume
B1:   CharRel P is connected Order of the carrier of P;
      set R = the PrefRel of P,
          T = the ToleranceRel of P,
          I = the InternalRel of P,
          X = the carrier of P;
S1:   field (R \/ T) = X by B1,ORDERS_1:12;
B5:   dom (R \/ T) = X by PARTFUN1:def 2,B1;
      T is symmetric by PrefDef; then
S0:   T = T~ by RELAT_2:13;
B7:   R is asymmetric by PrefDef; then
B6:   R /\ R~ = {} by Lemma17,XBOOLE_0:def 7;
B9:   dom R c= X;
B10:  rng R c= X;
S6:   id X misses R by Lemma21,B7;
X1:   T = id X
      proof
W1:     id X c= T by XBOOLE_1:73,S6,RELAT_2:1,S1,B1;
S5:     (R \/ T) /\ (R \/ T)~ c= id X by B5,RELAT_2:22,B1;
        (R \/ T) /\ (R \/ T)~ = (R \/ T) /\ (R~ \/ T~) by RELAT_1:23
          .= T \/ (R /\ R~) by XBOOLE_1:24,S0
          .= T by B6;
        hence thesis by W1,XBOOLE_0:def 10,S5;
      end;
x2:   R * R c= R
      proof
B11:    dom (id X) c= X;
W2:     id X * R = R by RELAT_1:51,B9;
W3:     R * id X = R by RELAT_1:53,B10;
W4:     id X * id X = id X by RELAT_1:51,B11;
B14:    (R \/ id X) * R = (R * R) \/ (id X * R) by SYSREL:6;
B13:    (R \/ id X) * id X = (R * id X) \/ (id X * id X) by SYSREL:6;
        (R \/ id X) * (R \/ id X) = ((R \/ id X) * R) \/ ((R \/ id X) * id X)
          by RELAT_1:32
          .= (R * R) \/ (R \/ (R \/ id X)) by XBOOLE_1:4,W2,W3,W4,B14,B13
          .= (R * R) \/ (R \/ id X) by XBOOLE_1:6; then
        R * R c= R \/ id X by RELAT_2:27,B1,X1,XBOOLE_1:11;
        hence thesis by Lemma22,B7,XBOOLE_1:73;
      end;
      I = {}
      proof
        set Z = (R \/ R~) \/ T;
        R \/ T is_connected_in X & R \/ T is_reflexive_in X
          by S1,B1,RELAT_2:def 14,def 9; then
        R \/ T is strongly_connected by RELAT_2:def 15,S1,ORDERS_1:7; then
        [:X,X:] c= (R \/ T) \/ (R \/ T)~ by RELAT_2:30,S1; then
        [:X,X:] c= (R \/ T) \/ (R~ \/ T~) by RELAT_1:23; then
S2:     [:X,X:] c= (R \/ R~) \/ T by XBOOLE_1:5,S0;
s3:     Z \/ I = nabla X by PrefDef;
s4:     R, T, I are_mutually_disjoint by PrefDef;
        I is symmetric by PrefDef; then
        R~ misses I by s4,Lemma20; then
        I misses Z by s4,XBOOLE_1:114;
        hence thesis by XBOOLE_1:11,S2,Lemma19,s3;
      end;
      hence thesis by X1,x2,RELAT_2:27;
    end;
    hence thesis by Z1;
  end;
