reserve a for set;
reserve L for lower-bounded sup-Semilattice;
reserve x for Element of L;

theorem Th31:
  (Rel2Map L) * (Map2Rel L) = id (the carrier of MonSet L)
proof
  set LS = (Rel2Map L) * (Map2Rel L);
  set R = id (the carrier of MonSet L);
A1: dom LS = the carrier of MonSet L by FUNCT_2:def 1;
A2: dom R = the carrier of MonSet L;
  for a being object st a in the carrier of MonSet L holds LS.a = R.a
  proof
    let a be object;
    assume
A3: a in the carrier of MonSet L;
    then consider s be Function of L, InclPoset Ids L such that
A4: a = s and s is monotone
    and for x be Element of L holds s.x c= downarrow x by Def13;
    LS.s in the carrier of MonSet L by A3,A4,FUNCT_2:5;
    then consider Ls be Function of L, InclPoset Ids L such that
A5: LS.s = Ls and Ls is monotone
    and for x be Element of L holds Ls.x c= downarrow x by Def13;
    set AR = (Map2Rel L).s;
    AR in the carrier of InclPoset Aux L by A3,A4,FUNCT_2:5;
    then AR in Aux L by YELLOW_1:1;
    then reconsider AR as auxiliary Relation of L by Def8;
    dom (Map2Rel L) = the carrier of MonSet L by FUNCT_2:def 1;
    then Ls = (Rel2Map L).AR by A3,A4,A5,FUNCT_1:13;
    then
A6: Ls = AR-below by Def14;
A7: dom Ls = the carrier of L by FUNCT_2:def 1;
A8: dom s = the carrier of L by FUNCT_2:def 1;
    now
      let b be object;
      assume
A9:   b in the carrier of L;
      then reconsider b9 = b as Element of L;
A10:  Ls.b c= s.b
      proof
        let d be object;
        assume d in Ls.b;
        then d in AR-below b9 by A6,Def12;
        then
A11:    [d,b9] in AR by Th13;
        ex AR9 be auxiliary Relation of L st ( AR9 = (Map2Rel L).s)
&
(for d,b9 be object holds [d,b9] in AR9 iff ex d9,b99 be Element of L, s9 be
Function of L, InclPoset Ids L st d9 = d & b99 = b9 & s9 = s & d9 in s9. b99)
        by A3,A4,Def15;
        then ex d9,b99 be Element of L, s9 be Function of L, InclPoset
        Ids L st ( d9 = d)&( b99 = b9)&( s9 = s)&( d9 in s9.b99) by A11;
        hence thesis;
      end;
      s.b c= Ls.b
      proof
        let d be object;
        assume
A12:    d in s.b;
        s.b in the carrier of InclPoset Ids L by A9,FUNCT_2:5;
        then s.b in Ids L by YELLOW_1:1;
        then ex X be Ideal of L st ( s.b = X);
        then reconsider d9 = d as Element of L by A12;
        ex AR9 be auxiliary Relation of L st ( AR9 = (Map2Rel L).s)
&
(for d,b9 be object holds [d,b9] in AR9 iff ex d9,b99 be Element of L, s9 be
Function of L, InclPoset Ids L st d9 = d & b99 = b9 & s9 = s & d9 in s9. b99)
        by A3,A4,Def15;
        then [d9,b9] in AR by A12;
        then d9 in AR-below b9;
        hence thesis by A6,Def12;
      end;
      hence Ls.b = s.b by A10;
    end;
    then Ls = s by A7,A8,FUNCT_1:2;
    hence thesis by A3,A4,A5,FUNCT_1:18;
  end;
  hence thesis by A1,A2,FUNCT_1:2;
end;
