
theorem Th15:
  for X being set for L,S being non empty RelStr st the RelStr of
  L = the RelStr of S holds L|^X = S|^X
proof
  let X be set;
  let L,S be non empty RelStr such that
A1: the RelStr of L = the RelStr of S;
  reconsider tXL = (X)--> L as RelStr-yielding ManySortedSet of X;
  reconsider tXS = (X)--> S as RelStr-yielding ManySortedSet of X;
A2: for x being object st x in dom (Carrier tXS) holds (Carrier tXS).x = (
  Carrier tXL).x
  proof
    let x be object;
    assume x in dom (Carrier tXS);
    then
A3: x in X;
    then
A4: ex R1 being 1-sorted st tXL.x = R1 & (Carrier tXL).x =
    the carrier of R1 by PRALG_1:def 15;
    ex R being 1-sorted st tXS.x = R & (Carrier tXS).x =
    the carrier of R by A3,PRALG_1:def 15;
    hence (Carrier tXS).x = the carrier of S by A3,FUNCOP_1:7
      .= (Carrier tXL).x by A1,A3,A4,FUNCOP_1:7;
  end;
A5: dom (Carrier tXS) = X by PARTFUN1:def 2
    .= dom (Carrier tXL) by PARTFUN1:def 2;
A6: the carrier of S|^X = the carrier of product tXS by YELLOW_1:def 5
    .= product Carrier tXS by YELLOW_1:def 4
    .= product Carrier tXL by A5,A2,FUNCT_1:2
    .= the carrier of product tXL by YELLOW_1:def 4
    .= the carrier of L|^X by YELLOW_1:def 5;
A7: the InternalRel of L|^X c= the InternalRel of S|^X
  proof
    reconsider tXS=(X) --> S as RelStr-yielding ManySortedSet of X;
    reconsider tXL=(X) --> L as RelStr-yielding ManySortedSet of X;
    let x be object;
    assume
A8: x in the InternalRel of L|^X;
    then consider a,b being object such that
A9: x = [a,b] and
A10: a in the carrier of L|^X and
A11: b in the carrier of L|^X by RELSET_1:2;
    reconsider a,b as Element of L|^X by A10,A11;
A12: L|^X = product tXL by YELLOW_1:def 5;
    then
A13: the carrier of L|^X=product Carrier tXL by YELLOW_1:def 4;
    a <= b by A8,A9,ORDERS_2:def 5;
    then consider f,g being Function such that
A14: f = a and
A15: g = b and
A16: for i be object st i in X ex R being RelStr, xi,yi being Element of
    R st R = tXL.i & xi = f.i & yi = g.i & xi <= yi by A12,A13,YELLOW_1:def 4;
    reconsider a1=a,b1=b as Element of S|^X by A6;
A17: ex f,g being Function st f = a1 & g = b1 &
for i be object st i in X ex
R being RelStr, xi,yi being Element of R st R = tXS.i & xi = f.i & yi = g.i &
    xi <= yi
    proof
      take f,g;
      thus f=a1 & g=b1 by A14,A15;
      let i be object;
      assume
A18:  i in X;
      then consider R being RelStr, xi,yi being Element of R such that
A19:  R = tXL.i and
A20:  xi = f.i and
A21:  yi = g.i and
A22:  xi <= yi by A16;
      take R1=S;
      reconsider xi1=xi,yi1=yi as Element of R1 by A1,A18,A19,FUNCOP_1:7;
      take xi1,yi1;
      thus R1=tXS.i by A18,FUNCOP_1:7;
      thus xi1 = f.i & yi1 = g.i by A20,A21;
      the InternalRel of R = the InternalRel of L by A18,A19,FUNCOP_1:7;
      then [xi1,yi1] in the InternalRel of R1 by A1,A22,ORDERS_2:def 5;
      hence thesis by ORDERS_2:def 5;
    end;
A23: S|^X = product tXS by YELLOW_1:def 5;
    then the carrier of S|^X=product Carrier tXS by YELLOW_1:def 4;
    then a1 <= b1 by A17,A23,YELLOW_1:def 4;
    hence thesis by A9,ORDERS_2:def 5;
  end;
  the InternalRel of S|^X c= the InternalRel of L|^X
  proof
    reconsider tXL=(X) --> L as RelStr-yielding ManySortedSet of X;
    reconsider tXS=(X) --> S as RelStr-yielding ManySortedSet of X;
    let x be object;
    assume
A24: x in the InternalRel of S|^X;
    then consider a,b being object such that
A25: x = [a,b] and
A26: a in the carrier of S|^X and
A27: b in the carrier of S|^X by RELSET_1:2;
    reconsider a,b as Element of S|^X by A26,A27;
A28: S|^X = product tXS by YELLOW_1:def 5;
    then
A29: the carrier of S|^X=product Carrier tXS by YELLOW_1:def 4;
    a <= b by A24,A25,ORDERS_2:def 5;
    then consider f,g being Function such that
A30: f = a and
A31: g = b and
A32: for i be object st i in X ex R being RelStr, xi,yi being Element of
    R st R = tXS.i & xi = f.i & yi = g.i & xi <= yi by A28,A29,YELLOW_1:def 4;
    reconsider a1=a,b1=b as Element of L|^X by A6;
A33: ex f,g being Function st f = a1 & g = b1 &
for i be object st i in X ex
R being RelStr, xi,yi being Element of R st R = tXL.i & xi = f.i & yi = g.i &
    xi <= yi
    proof
      take f,g;
      thus f=a1 & g=b1 by A30,A31;
      let i be object;
      assume
A34:  i in X;
      then consider R being RelStr, xi,yi being Element of R such that
A35:  R = tXS.i and
A36:  xi = f.i and
A37:  yi = g.i and
A38:  xi <= yi by A32;
      take R1=L;
      reconsider xi1=xi,yi1=yi as Element of R1 by A1,A34,A35,FUNCOP_1:7;
      take xi1,yi1;
      thus R1=tXL.i by A34,FUNCOP_1:7;
      thus xi1 = f.i & yi1 = g.i by A36,A37;
      the InternalRel of R = the InternalRel of S by A34,A35,FUNCOP_1:7;
      then [xi1,yi1] in the InternalRel of R1 by A1,A38,ORDERS_2:def 5;
      hence thesis by ORDERS_2:def 5;
    end;
A39: L|^X = product tXL by YELLOW_1:def 5;
    then the carrier of L|^X=product Carrier tXL by YELLOW_1:def 4;
    then a1 <= b1 by A33,A39,YELLOW_1:def 4;
    hence thesis by A25,ORDERS_2:def 5;
  end;
  hence thesis by A7,A6,XBOOLE_0:def 10;
end;
