reserve X for non empty set;
reserve e,e1,e2,e19,e29 for Equivalence_Relation of X,
  x,y,x9,y9 for set;
reserve A for non empty set,
  L for lower-bounded LATTICE;

theorem Th17:
  for d being BiFunction of A,L st d is symmetric for q being
  Element of [:A,A,the carrier of L,the carrier of L:] holds new_bi_fun(d,q) is
  symmetric
proof
  let d be BiFunction of A,L;
  assume
A1: d is symmetric;
  let q be Element of [:A,A,the carrier of L,the carrier of L:];
  set f = new_bi_fun(d,q), x = q`1_4, y = q`2_4, a = q`3_4, b = q`4_4;
  let p,q be Element of new_set A;
A2: p in A or p in {{A},{{A}},{{{A}}}} by XBOOLE_0:def 3;
A3: q in A or q in {{A},{{A}},{{{A}}}} by XBOOLE_0:def 3;
  per cases by A2,A3,ENUMSET1:def 1;
  suppose
    p in A & q in A;
    then reconsider p9 = p, q9 = q as Element of A;
    thus f.(p,q) = d.(p9,q9) by Def10
      .= d.(q9,p9) by A1
      .= f.(q,p) by Def10;
  end;
  suppose
A4: p in A & q = {A};
    then reconsider p9 = p as Element of A;
    thus f.(p,q) = d.(p9,x)"\/"a by A4,Def10
      .= f.(q,p) by A4,Def10;
  end;
  suppose
A5: p in A & q = {{A}};
    then reconsider p9 = p as Element of A;
    thus f.(p,q) = d.(p9,x)"\/"a"\/"b by A5,Def10
      .= f.(q,p) by A5,Def10;
  end;
  suppose
A6: p in A & q = {{{A}}};
    then reconsider p9 = p as Element of A;
    thus f.(p,q) = d.(p9,y)"\/"b by A6,Def10
      .= f.(q,p) by A6,Def10;
  end;
  suppose
A7: p = {A} & q in A;
    then reconsider q9 = q as Element of A;
    thus f.(p,q) = d.(q9,x)"\/"a by A7,Def10
      .= f.(q,p) by A7,Def10;
  end;
  suppose
    p = {A} & q = {A};
    hence thesis;
  end;
  suppose
A8: p = {A} & q = {{A}};
    hence f.(p,q) = b by Def10
      .= f.(q,p) by A8,Def10;
  end;
  suppose
A9: p = {A} & q = {{{A}}};
    hence f.(p,q) = a"\/"b by Def10
      .= f.(q,p) by A9,Def10;
  end;
  suppose
A10: p = {{A}} & q in A;
    then reconsider q9 = q as Element of A;
    thus f.(p,q) = d.(q9,x)"\/"a"\/"b by A10,Def10
      .= f.(q,p) by A10,Def10;
  end;
  suppose
A11: p = {{A}} & q = {A};
    hence f.(p,q) = b by Def10
      .= f.(q,p) by A11,Def10;
  end;
  suppose
    p = {{A}} & q = {{A}};
    hence thesis;
  end;
  suppose
A12: p = {{A}} & q = {{{A}}};
    hence f.(p,q) = a by Def10
      .= f.(q,p) by A12,Def10;
  end;
  suppose
A13: p = {{{A}}} & q in A;
    then reconsider q9 = q as Element of A;
    thus f.(p,q) = d.(q9,y)"\/"b by A13,Def10
      .= f.(q,p) by A13,Def10;
  end;
  suppose
A14: p = {{{A}}} & q = {A};
    hence f.(p,q) = a"\/"b by Def10
      .= f.(q,p) by A14,Def10;
  end;
  suppose
A15: p = {{{A}}} & q = {{A}};
    hence f.(p,q) = a by Def10
      .= f.(q,p) by A15,Def10;
  end;
  suppose
    p = {{{A}}} & q = {{{A}}};
    hence thesis;
  end;
end;
