reserve x, y, z, v for set,
  n, m, k for Nat;
reserve G, G1, G2, G3 for Graph;
reserve x, y for Element of (the carrier of G);

theorem Th9:
  (the Source of G1) tolerates (the Source of G2) &
  (the Target of G1) tolerates (the Target of G2) &
  (the Source of G1) tolerates (the Source of G3) &
  (the Target of G1) tolerates (the Target of G3) &
  (the Source of G2) tolerates (the Source of G3) &
  (the Target of G2) tolerates (the Target of G3) implies
  (G1 \/ G2) \/ G3 = G1 \/ (G2 \/ G3)
proof
  assume that
A1: (the Source of G1) tolerates (the Source of G2) and
A2: (the Target of G1) tolerates (the Target of G2) and
A3: (the Source of G1) tolerates (the Source of G3) and
A4: (the Target of G1) tolerates (the Target of G3) and
A5: (the Source of G2) tolerates (the Source of G3) and
A6: (the Target of G2) tolerates (the Target of G3);
  A7: for v being object
st v in dom(the Source of (G1 \/ G2)) /\ dom(the Source of G3) holds
  (the Source of (G1 \/ G2)).v = (the Source of G3).v
  proof
    let v be object;
    assume
A8: v in dom (the Source of (G1 \/ G2)) /\ dom (the Source of G3);
then A9: v in dom (the Source of G3) by XBOOLE_0:def 4;
 v in dom (the Source of (G1 \/ G2)) by A8,XBOOLE_0:def 4;
then  v in (the carrier' of (G1 \/ G2));
then A10: v in (the carrier' of G1) \/ (the carrier' of G2) by A1,A2,Def5;
A11: now
      assume
A12:  v in (the carrier' of G1);
then   v in dom (the Source of G1) by FUNCT_2:def 1;
then A13:  v in dom (the Source of G1) /\ dom (the Source of G3) by A9,
XBOOLE_0:def 4;
      thus (the Source of (G1 \/ G2)).v = (the Source of G1).v by A1,A2,A12
,Def5
        .= (the Source of G3).v by A3,A13,PARTFUN1:def 4;
    end;
 now
      assume
A14:  v in (the carrier' of G2);
then   v in dom (the Source of G2) by FUNCT_2:def 1;
then A15:  v in dom (the Source of G2) /\ dom (the Source of G3) by A9,
XBOOLE_0:def 4;
      thus (the Source of (G1 \/ G2)).v = (the Source of G2).v by A1,A2,A14
,Def5
        .= (the Source of G3).v by A5,A15,PARTFUN1:def 4;
    end;
    hence thesis by A10,A11,XBOOLE_0:def 3;
  end;
  A16: for v being object
st v in dom(the Target of (G1 \/ G2)) /\ dom(the Target of G3) holds
  (the Target of (G1 \/ G2)).v = (the Target of G3).v
  proof
    let v be object;
    assume
A17: v in dom (the Target of (G1 \/ G2)) /\ dom (the Target of G3);
then A18: v in dom (the Target of G3) by XBOOLE_0:def 4;
 v in dom (the Target of (G1 \/ G2)) by A17,XBOOLE_0:def 4;
then  v in (the carrier' of (G1 \/ G2));
then A19: v in (the carrier' of G1) \/ (the carrier' of G2) by A1,A2,Def5;
A20: now
      assume
A21:  v in (the carrier' of G1);
then   v in dom (the Target of G1) by FUNCT_2:def 1;
then A22:  v in dom (the Target of G1) /\ dom (the Target of G3) by A18,
XBOOLE_0:def 4;
      thus (the Target of (G1 \/ G2)).v = (the Target of G1).v by A1,A2,A21
,Def5
        .= (the Target of G3).v by A4,A22,PARTFUN1:def 4;
    end;
 now
      assume
A23:  v in (the carrier' of G2);
then   v in dom (the Target of G2) by FUNCT_2:def 1;
then A24:  v in dom (the Target of G2) /\ dom (the Target of G3) by A18,
XBOOLE_0:def 4;
      thus (the Target of (G1 \/ G2)).v = (the Target of G2).v by A1,A2,A23
,Def5
        .= (the Target of G3).v by A6,A24,PARTFUN1:def 4;
    end;
    hence thesis by A19,A20,XBOOLE_0:def 3;
  end;
A25: (the Source of (G1 \/ G2)) tolerates (the Source of G3) by A7,
PARTFUN1:def 4;
A26: (the Target of (G1 \/ G2)) tolerates (the Target of G3) by A16,
PARTFUN1:def 4;
A27: for  v being object st
v in dom (the Source of G1) /\ dom(the Source of (G2 \/ G3)) holds
  (the Source of G1).v = (the Source of (G2 \/ G3)).v
  proof
    let v be object;
    assume
A28: v in dom (the Source of G1) /\ dom(the Source of (G2 \/ G3));
then A29: v in dom(the Source of G1) by XBOOLE_0:def 4;
 v in (the carrier' of (G2 \/ G3)) by A28;
then  v in (the carrier' of G2) \/ (the carrier' of G3) by A5,A6,Def5;
then  v in (the carrier' of G2) \/ dom(the Source of G3) by FUNCT_2:def 1;
then A30: v in dom(the Source of G2) \/ dom (the Source of G3) by FUNCT_2:def 1
;
A31: now
      assume
A32:  v in dom (the Source of G2);
then A33:  v in dom(the Source of G1) /\
      dom(the Source of G2) by A29,XBOOLE_0:def 4;
      thus (the Source of (G2 \/ G3)).v = (the Source of G2).v by A5,A6,A32
,Def5
        .= (the Source of G1).v by A1,A33,PARTFUN1:def 4;
    end;
 now
      assume
A34:  v in dom (the Source of G3);
then A35:  v in dom(the Source of G1) /\
      dom(the Source of G3) by A29,XBOOLE_0:def 4;
      thus (the Source of (G2 \/ G3)).v = (the Source of G3).v by A5,A6,A34
,Def5
        .= (the Source of G1).v by A3,A35,PARTFUN1:def 4;
    end;
    hence thesis by A30,A31,XBOOLE_0:def 3;
  end;
  A36: for v being object
st v in dom (the Target of G1) /\ dom (the Target of (G2 \/ G3)) holds
  (the Target of G1).v = (the Target of (G2 \/ G3)).v
  proof
    let v be object;
    assume
A37: v in dom (the Target of G1) /\ dom(the Target of (G2 \/ G3));
then A38: v in dom(the Target of G1) by XBOOLE_0:def 4;
 v in (the carrier' of (G2 \/ G3)) by A37;
then  v in (the carrier' of G2) \/ (the carrier' of G3) by A5,A6,Def5;
then  v in (the carrier' of G2) \/ dom(the Target of G3) by FUNCT_2:def 1;
then A39: v in dom(the Target of G2) \/ dom (the Target of G3) by FUNCT_2:def 1
;
A40: now
      assume
A41:  v in dom (the Target of G2);
then A42:  v in dom(the Target of G1) /\
      dom(the Target of G2) by A38,XBOOLE_0:def 4;
      thus (the Target of (G2 \/ G3)).v = (the Target of G2).v by A5,A6,A41
,Def5
        .= (the Target of G1).v by A2,A42,PARTFUN1:def 4;
    end;
 now
      assume
A43:  v in dom(the Target of G3);
then A44:  v in dom(the Target of G1) /\
      dom(the Target of G3) by A38,XBOOLE_0:def 4;
      thus (the Target of (G2 \/ G3)).v = (the Target of G3).v by A5,A6,A43
,Def5
        .= (the Target of G1).v by A4,A44,PARTFUN1:def 4;
    end;
    hence thesis by A39,A40,XBOOLE_0:def 3;
  end;
A45: (the Source of G1) tolerates (the Source of (G2 \/ G3)) by A27,
PARTFUN1:def 4;
A46: (the Target of G1) tolerates (the Target of (G2 \/ G3)) by A36,
PARTFUN1:def 4;
A47: the carrier' of ((G1 \/ G2) \/ G3) =
  (the carrier' of (G1 \/ G2)) \/ (the carrier' of G3) by A25,A26,Def5
    .= (the carrier' of G1) \/ (the carrier' of G2) \/ (the carrier' of G3)
  by A1,A2,Def5
    .= (the carrier' of G1) \/ ((the carrier' of G2) \/
  (the carrier' of G3)) by XBOOLE_1:4
    .= (the carrier' of G1) \/ (the carrier' of (G2 \/ G3)) by A5,A6,Def5
    .= (the carrier' of (G1 \/ (G2 \/ G3))) by A45,A46,Def5;
A48: the carrier of ((G1 \/ G2) \/ G3) =
  (the carrier of (G1 \/ G2)) \/ (the carrier of G3) by A25,A26,Def5
    .= (the carrier of G1) \/ (the carrier of G2) \/ (the carrier of G3)
  by A1,A2,Def5
    .= (the carrier of G1) \/
  ((the carrier of G2) \/ (the carrier of G3)) by XBOOLE_1:4
    .= (the carrier of G1) \/ (the carrier of (G2 \/ G3)) by A5,A6,Def5
    .= (the carrier of (G1 \/ (G2 \/ G3))) by A45,A46,Def5;
A49: dom (the Source of ((G1 \/ G2) \/ G3)) =the carrier' of (G1 \/ (G2 \/
  G3)) by A47,FUNCT_2:def 1
    .= dom (the Source of (G1 \/ (G2 \/ G3))) by FUNCT_2:def 1;
 for v being object
st v in dom (the Source of ((G1 \/ G2) \/ G3)) holds
  (the Source of ((G1 \/ G2) \/ G3)).v = (the Source of (G1 \/ (G2 \/ G3))).v
  proof
    let v being object such that
A50: v in dom (the Source of ((G1 \/ G2) \/ G3));
 dom (the Source of ((G1 \/ G2) \/ G3)) =
    the carrier' of ((G1 \/ G2) \/ G3) by FUNCT_2:def 1
      .= (the carrier' of (G1 \/ G2)) \/ (the carrier' of G3) by A25,A26,Def5
      .= (the carrier' of G1) \/ (the carrier' of G2) \/ (the carrier' of G3)
    by A1,A2,Def5;
then A51: v in (the carrier' of G1) \/ (the carrier' of G2) or
    v in (the carrier' of G3) by A50,XBOOLE_0:def 3;
A52: now
      assume
A53:  v in the carrier' of G1;
        (
the carrier' of G1) c= (the carrier' of G1) \/ (the carrier' of G2)
      by XBOOLE_1:7;
then
  (the carrier' of G1) c= the carrier' of (G1 \/ G2) by A1,A2,Def5;
      hence (the Source of ((G1 \/ G2) \/ G3)).v =
      (the Source of (G1 \/ G2)).v by A25,A26,A53,Def5
        .= (the Source of G1).v by A1,A2,A53,Def5
        .= (the Source of (G1 \/ (G2 \/ G3))).v by A45,A46,A53,Def5;
    end;
A54: now
      assume
A55:  v in the carrier' of G2;
        (
the carrier' of G2) c= (the carrier' of G1) \/ (the carrier' of G2)
      by XBOOLE_1:7;
then A56:  (the carrier' of G2) c= the carrier' of (G1 \/ G2) by A1,A2,Def5;
        (
the carrier' of G2) c= (the carrier' of G2) \/ (the carrier' of G3)
      by XBOOLE_1:7;
then A57:  (the carrier' of G2) c= the carrier' of (G2 \/ G3) by A5,A6,Def5;
      thus (the Source of ((G1 \/ G2) \/ G3)).v =
      (the Source of (G1 \/ G2)).v by A25,A26,A55,A56,Def5
        .= (the Source of G2).v by A1,A2,A55,Def5
        .= (the Source of (G2 \/ G3)).v by A5,A6,A55,Def5
        .= (the Source of (G1 \/ (G2 \/ G3))).v by A45,A46,A55,A57,Def5;
    end;
 now
      assume
A58:  v in the carrier' of G3;
        (
the carrier' of G3) c= (the carrier' of G2) \/ (the carrier' of G3)
      by XBOOLE_1:7;
then A59:  (the carrier' of G3) c= the carrier' of (G2 \/ G3) by A5,A6,Def5;
      thus (the Source of ((G1 \/ G2) \/ G3)).v =
      (the Source of G3).v by A25,A26,A58,Def5
        .= (the Source of (G2 \/ G3)).v by A5,A6,A58,Def5
        .= (the Source of (G1 \/ (G2 \/ G3))).v by A45,A46,A58,A59,Def5;
    end;
    hence thesis by A51,A52,A54,XBOOLE_0:def 3;
  end;
  then
A60: (the Source of ((G1 \/ G2) \/ G3)) = (the Source of (G1 \/ (G2 \/ G3 )))
  by A49;
A61: dom (the Target of ((G1 \/ G2) \/ G3)) =the carrier' of (G1 \/ (G2 \/
  G3)) by A47,FUNCT_2:def 1
    .= dom (the Target of (G1 \/ (G2 \/ G3))) by FUNCT_2:def 1;
 for v being object
st v in dom (the Target of ((G1 \/ G2) \/ G3)) holds
  (the Target of ((G1 \/ G2) \/ G3)).v = (the Target of (G1 \/ (G2 \/ G3))).v
  proof
    let v be object such that
A62: v in dom (the Target of ((G1 \/ G2) \/ G3));
 dom (the Target of ((G1 \/ G2) \/ G3)) =
    the carrier' of ((G1 \/ G2) \/ G3) by FUNCT_2:def 1
      .= (the carrier' of (G1 \/ G2)) \/ (the carrier' of G3) by A25,A26,Def5
      .= (the carrier' of G1) \/ (the carrier' of G2) \/ (the carrier' of G3)
    by A1,A2,Def5;
then A63: v in (the carrier' of G1) \/ (the carrier' of G2) or
    v in (the carrier' of G3) by A62,XBOOLE_0:def 3;
A64: now
      assume
A65:  v in the carrier' of G1;
        (
the carrier' of G1) c= (the carrier' of G1) \/ (the carrier' of G2)
      by XBOOLE_1:7;
then   (the carrier' of G1) c= the carrier' of (G1 \/ G2) by A1,A2,Def5;
      hence (the Target of ((G1 \/ G2) \/ G3)).v =
      (the Target of (G1 \/ G2)).v by A25,A26,A65,Def5
        .= (the Target of G1).v by A1,A2,A65,Def5
        .= (the Target of (G1 \/ (G2 \/ G3))).v by A45,A46,A65,Def5;
    end;
A66: now
      assume
A67:  v in the carrier' of G2;
        (
the carrier' of G2) c= (the carrier' of G1) \/ (the carrier' of G2)
      by XBOOLE_1:7;
then A68:  (the carrier' of G2) c= the carrier' of (G1 \/ G2) by A1,A2,Def5;
       (
the carrier' of G2) c= (the carrier' of G2) \/ (the carrier' of G3)
      by XBOOLE_1:7;
then A69: (the carrier' of G2) c= the carrier' of (G2 \/ G3) by A5,A6,Def5;
      thus (the Target of ((G1 \/ G2) \/ G3)).v =
      (the Target of (G1 \/ G2)).v by A25,A26,A67,A68,Def5
        .= (the Target of G2).v by A1,A2,A67,Def5
        .= (the Target of (G2 \/ G3)).v by A5,A6,A67,Def5
        .= (the Target of (G1 \/ (G2 \/ G3))).v by A45,A46,A67,A69,Def5;
    end;
 now
      assume
A70: v in the carrier' of G3;
       (
the carrier' of G3) c= (the carrier' of G2) \/ (the carrier' of G3)
      by XBOOLE_1:7;
then A71: (the carrier' of G3) c= the carrier' of (G2 \/ G3) by A5,A6,Def5;
      thus (the Target of ((G1 \/ G2) \/ G3)).v =
      (the Target of G3).v by A25,A26,A70,Def5
        .= (the Target of (G2 \/ G3)).v by A5,A6,A70,Def5
        .= (the Target of (G1 \/ (G2 \/ G3))).v by A45,A46,A70,A71,Def5;
    end;
    hence thesis by A63,A64,A66,XBOOLE_0:def 3;
  end;
  hence thesis by A47,A48,A60,A61,FUNCT_1:2;
end;
