Article RFINSEQ2, MML version 4.99.1005

:: RFINSEQ2:funcnot 1 => RFINSEQ2:func 1
definition
  let a1 be FinSequence of REAL;
  func max_p A1 -> Element of NAT means
    (len a1 = 0 implies it = 0) &
     (len a1 <= 0 or it in dom a1 &
      (for b1 being Element of NAT
      for b2, b3 being Element of REAL
            st b1 in dom a1 & b2 = a1 . b1 & b3 = a1 . it
         holds b2 <= b3) &
      (for b1 being Element of NAT
            st b1 in dom a1 & a1 . b1 = a1 . it
         holds it <= b1));
end;

:: RFINSEQ2:def 1
theorem
for b1 being FinSequence of REAL
for b2 being Element of NAT holds
      b2 = max_p b1
   iff
      (len b1 = 0 implies b2 = 0) &
       (len b1 <= 0 or b2 in dom b1 &
        (for b3 being Element of NAT
        for b4, b5 being Element of REAL
              st b3 in dom b1 & b4 = b1 . b3 & b5 = b1 . b2
           holds b4 <= b5) &
        (for b3 being Element of NAT
              st b3 in dom b1 & b1 . b3 = b1 . b2
           holds b2 <= b3));

:: RFINSEQ2:funcnot 2 => RFINSEQ2:func 2
definition
  let a1 be FinSequence of REAL;
  func min_p A1 -> Element of NAT means
    (len a1 = 0 implies it = 0) &
     (len a1 <= 0 or it in dom a1 &
      (for b1 being Element of NAT
      for b2, b3 being Element of REAL
            st b1 in dom a1 & b2 = a1 . b1 & b3 = a1 . it
         holds b3 <= b2) &
      (for b1 being Element of NAT
            st b1 in dom a1 & a1 . b1 = a1 . it
         holds it <= b1));
end;

:: RFINSEQ2:def 2
theorem
for b1 being FinSequence of REAL
for b2 being Element of NAT holds
      b2 = min_p b1
   iff
      (len b1 = 0 implies b2 = 0) &
       (len b1 <= 0 or b2 in dom b1 &
        (for b3 being Element of NAT
        for b4, b5 being Element of REAL
              st b3 in dom b1 & b4 = b1 . b3 & b5 = b1 . b2
           holds b5 <= b4) &
        (for b3 being Element of NAT
              st b3 in dom b1 & b1 . b3 = b1 . b2
           holds b2 <= b3));

:: RFINSEQ2:funcnot 3 => RFINSEQ2:func 3
definition
  let a1 be FinSequence of REAL;
  func max A1 -> Element of REAL equals
    a1 . max_p a1;
end;

:: RFINSEQ2:def 3
theorem
for b1 being FinSequence of REAL holds
   max b1 = b1 . max_p b1;

:: RFINSEQ2:funcnot 4 => RFINSEQ2:func 4
definition
  let a1 be FinSequence of REAL;
  func min A1 -> Element of REAL equals
    a1 . min_p a1;
end;

:: RFINSEQ2:def 4
theorem
for b1 being FinSequence of REAL holds
   min b1 = b1 . min_p b1;

:: RFINSEQ2:th 1
theorem
for b1 being FinSequence of REAL
for b2 being Element of NAT
      st 1 <= b2 & b2 <= len b1
   holds b1 . b2 <= b1 . max_p b1 & b1 . b2 <= max b1;

:: RFINSEQ2:th 2
theorem
for b1 being FinSequence of REAL
for b2 being Element of NAT
      st 1 <= b2 & b2 <= len b1
   holds b1 . min_p b1 <= b1 . b2 & min b1 <= b1 . b2;

:: RFINSEQ2:th 3
theorem
for b1 being FinSequence of REAL
for b2 being Element of REAL
      st b1 = <*b2*>
   holds max_p b1 = 1 & max b1 = b2;

:: RFINSEQ2:th 4
theorem
for b1 being FinSequence of REAL
for b2 being Element of REAL
      st b1 = <*b2*>
   holds min_p b1 = 1 & min b1 = b2;

:: RFINSEQ2:th 5
theorem
for b1 being FinSequence of REAL
for b2, b3 being Element of REAL
      st b1 = <*b2,b3*>
   holds max b1 = max(b2,b3) &
    max_p b1 = IFEQ(b2,max(b2,b3),1,2);

:: RFINSEQ2:th 6
theorem
for b1 being FinSequence of REAL
for b2, b3 being Element of REAL
      st b1 = <*b2,b3*>
   holds min b1 = min(b2,b3) &
    min_p b1 = IFEQ(b2,min(b2,b3),1,2);

:: RFINSEQ2:th 7
theorem
for b1, b2 being FinSequence of REAL
      st len b1 = len b2 & 0 < len b1
   holds max (b1 + b2) <= (max b1) + max b2;

:: RFINSEQ2:th 8
theorem
for b1, b2 being FinSequence of REAL
      st len b1 = len b2 & 0 < len b1
   holds (min b1) + min b2 <= min (b1 + b2);

:: RFINSEQ2:th 9
theorem
for b1 being FinSequence of REAL
for b2 being Element of REAL
      st 0 < len b1 & 0 < b2
   holds max (b2 * b1) = b2 * max b1 & max_p (b2 * b1) = max_p b1;

:: RFINSEQ2:th 10
theorem
for b1 being FinSequence of REAL
for b2 being Element of REAL
      st 0 < len b1 & 0 < b2
   holds min (b2 * b1) = b2 * min b1 & min_p (b2 * b1) = min_p b1;

:: RFINSEQ2:th 11
theorem
for b1 being FinSequence of REAL
      st 0 < len b1
   holds max - b1 = - min b1 & max_p - b1 = min_p b1;

:: RFINSEQ2:th 12
theorem
for b1 being FinSequence of REAL
      st 0 < len b1
   holds min - b1 = - max b1 & min_p - b1 = max_p b1;

:: RFINSEQ2:th 13
theorem
for b1 being FinSequence of REAL
for b2 being Element of NAT
      st 1 <= b2 & b2 < len b1
   holds max (b1 /^ b2) <= max b1 & min b1 <= min (b1 /^ b2);

:: RFINSEQ2:th 14
theorem
for b1, b2 being FinSequence of REAL
      st b1,b2 are_fiberwise_equipotent
   holds max b1 = max b2;

:: RFINSEQ2:th 15
theorem
for b1, b2 being FinSequence of REAL
      st b1,b2 are_fiberwise_equipotent
   holds min b1 = min b2;

:: RFINSEQ2:funcnot 5 => RFINSEQ2:func 5
definition
  let a1 be FinSequence of REAL;
  func sort_d A1 -> non-increasing FinSequence of REAL means
    a1,it are_fiberwise_equipotent;
end;

:: RFINSEQ2:def 5
theorem
for b1 being FinSequence of REAL
for b2 being non-increasing FinSequence of REAL holds
      b2 = sort_d b1
   iff
      b1,b2 are_fiberwise_equipotent;

:: RFINSEQ2:th 16
theorem
for b1 being FinSequence of REAL
      st (len b1 = 0 or len b1 = 1)
   holds b1 is non-decreasing;

:: RFINSEQ2:th 17
theorem
for b1 being FinSequence of REAL holds
      b1 is non-decreasing
   iff
      for b2, b3 being Element of NAT
            st b2 in dom b1 & b3 in dom b1 & b2 < b3
         holds b1 . b2 <= b1 . b3;

:: RFINSEQ2:th 18
theorem
for b1 being non-decreasing FinSequence of REAL
for b2 being Element of NAT holds
   b1 | b2 is non-decreasing FinSequence of REAL;

:: RFINSEQ2:th 19
theorem
for b1, b2 being non-decreasing FinSequence of REAL
      st b1,b2 are_fiberwise_equipotent
   holds b1 = b2;

:: RFINSEQ2:funcnot 6 => RFINSEQ2:func 6
definition
  let a1 be FinSequence of REAL;
  func sort_a A1 -> non-decreasing FinSequence of REAL means
    a1,it are_fiberwise_equipotent;
end;

:: RFINSEQ2:def 6
theorem
for b1 being FinSequence of REAL
for b2 being non-decreasing FinSequence of REAL holds
      b2 = sort_a b1
   iff
      b1,b2 are_fiberwise_equipotent;

:: RFINSEQ2:th 20
theorem
for b1 being non-increasing FinSequence of REAL holds
   sort_d b1 = b1;

:: RFINSEQ2:th 21
theorem
for b1 being non-decreasing FinSequence of REAL holds
   sort_a b1 = b1;

:: RFINSEQ2:th 22
theorem
for b1 being FinSequence of REAL holds
   sort_d sort_d b1 = sort_d b1;

:: RFINSEQ2:th 23
theorem
for b1 being FinSequence of REAL holds
   sort_a sort_a b1 = sort_a b1;

:: RFINSEQ2:th 24
theorem
for b1 being FinSequence of REAL
      st b1 is non-increasing
   holds - b1 is non-decreasing;

:: RFINSEQ2:th 25
theorem
for b1 being FinSequence of REAL
      st b1 is non-decreasing
   holds - b1 is non-increasing;

:: RFINSEQ2:th 26
theorem
for b1, b2 being FinSequence of REAL
for b3 being Function-like quasi_total bijective Relation of dom b2,dom b2
      st b1 = b3 * b2 & 1 <= len b2
   holds - b1 = b3 * - b2;

:: RFINSEQ2:th 27
theorem
for b1, b2 being FinSequence of REAL
      st b1,b2 are_fiberwise_equipotent
   holds - b1,- b2 are_fiberwise_equipotent;

:: RFINSEQ2:th 28
theorem
for b1 being FinSequence of REAL holds
   sort_d - b1 = - sort_a b1;

:: RFINSEQ2:th 29
theorem
for b1 being FinSequence of REAL holds
   sort_a - b1 = - sort_d b1;

:: RFINSEQ2:th 30
theorem
for b1 being FinSequence of REAL holds
   dom sort_d b1 = dom b1 & len sort_d b1 = len b1;

:: RFINSEQ2:th 31
theorem
for b1 being FinSequence of REAL holds
   dom sort_a b1 = dom b1 & len sort_a b1 = len b1;

:: RFINSEQ2:th 32
theorem
for b1 being FinSequence of REAL
      st 1 <= len b1
   holds max_p sort_d b1 = 1 & min_p sort_a b1 = 1 & (sort_d b1) . 1 = max b1 & (sort_a b1) . 1 = min b1;