reserve X,Z for set;
reserve x,y,z for object;
reserve A,B,C for Subset of X;

theorem Th83:
  for A being RelStr, B being Subset of A, s being FinSequence of A
    st s is B-asc_ordering holds
      the InternalRel of A is_connected_in B
proof
  let A be RelStr, B be Subset of A;
  let s be FinSequence of A;
  assume A1: s is B-asc_ordering;
  then A2: s is weakly-ascending;
  for x,y being object st x in B & y in B & x <> y holds
    [x,y] in the InternalRel of A or [y,x] in the InternalRel of A
  proof
    let x,y be object;
    assume that
      A3: x in B & y in B and
      A4: x <> y;
    reconsider x, y as Element of A by A3;
    A5: x in rng s & y in rng s by A1, A3;
    consider i being Nat such that
      A6: i in dom s and
      A7: x = s.i by FINSEQ_2:10, A5;
    A8: x = s/.i by A6, A7, PARTFUN1:def 6;
    consider j being Nat such that
      A9: j in dom s and
      A10: y = s.j by FINSEQ_2:10, A5;
    A11: y = s/.j by A9, A10, PARTFUN1:def 6;
    per cases by XXREAL_0:1;
    suppose i < j;
      hence thesis by A6, A9, A8, A11, A2, ORDERS_2:def 5;
    end;
    suppose i = j;
      hence thesis by A7, A10, A4;
    end;
    suppose j < i;
      hence thesis by A6, A9, A8, A11, A2, ORDERS_2:def 5;
    end;
  end;
  hence thesis by RELAT_2:def 6;
end;
