reserve I for non empty set;
reserve M for ManySortedSet of I;
reserve Y,x,y,y1,i,j for set;
reserve k for Element of NAT;
reserve p for FinSequence;
reserve S for non void non empty ManySortedSign;
reserve A for non-empty MSAlgebra over S;

theorem Th10:
  for Y be set for X be Subset of EqRelLatt Y holds x in Y & y in
Y implies ( [x,y] in "\/" X iff ex f being FinSequence st 1 <= len f & x = f.1
& y = f.(len f) & for i be Nat st 1 <= i & i < len f holds [f.i,f.(i
  +1)] in union X )
proof
  let Y be set;
  let X be Subset of EqRelLatt Y;
  assume that
A1: x in Y and
A2: y in Y;
  reconsider Y9 = Y as non empty set by A1;
  reconsider x9 = x, y9 = y as Element of Y9 by A1,A2;
  reconsider R = union X as Relation of Y9 by Th6;
  R = R~ by Th9;
  then
A3: R \/ R~ = R;
A4: [x,y] in "\/" X implies R reduces x,y
  proof
    assume [x,y] in "\/" X;
    then [x9,y9] in EqCl R by Th8;
    then x,y are_convertible_wrt R by MSUALG_6:41;
    hence thesis by A3,REWRITE1:def 4;
  end;
  thus [x,y] in "\/" X implies ex f being FinSequence st 1 <= len f & x = f.1
& y = f.(len f) & for i be Nat st 1 <= i & i < len f holds [f.i,f.(i
  +1)] in union X
  proof
    assume [x,y] in "\/" X;
    then consider f be FinSequence such that
A5: len f > 0 and
A6: x = f.1 & y = f.(len f) and
A7: for i be Nat st i in dom f & i+1 in dom f holds [f.i,f
    .( i+1)] in R by A4,REWRITE1:11;
    take f;
    0 + 1 <= len f by A5,NAT_1:13;
    hence 1 <= len f & x = f.1 & y = f.(len f) by A6;
    let i be Nat;
    assume 1 <= i & i < len f;
    then i in dom f & i+1 in dom f by Th1;
    hence thesis by A7;
  end;
A8: R reduces x,y implies [x,y] in "\/" X
  proof
    assume R reduces x,y;
    then x,y are_convertible_wrt R by REWRITE1:25;
    then [x9,y9] in EqCl R by MSUALG_6:41;
    hence thesis by Th8;
  end;
  thus ( ex f being FinSequence st 1 <= len f & x = f.1 & y = f.(len f) & for
  i be Nat st 1 <= i & i < len f holds [f.i,f.(i+1)] in union X )
  implies [x,y] in "\/" X
  proof
    given f be FinSequence such that
A9: 1 <= len f and
A10: x = f.1 & y = f.(len f) and
A11: for i be Nat st 1 <= i & i < len f holds [f.i,f.(i+1)]
    in union X;
A12: now
      let i be Nat;
      assume i in dom f & i+1 in dom f;
      then 1 <= i & i < len f by Th1;
      hence [f.i,f.(i+1)] in union X by A11;
    end;
    0 + 1 <= len f by A9;
    then len f > 0 by NAT_1:13;
    hence thesis by A8,A10,A12,REWRITE1:11;
  end;
end;
