reserve x,X,Y for set;
reserve g,r,r1,r2,p,p1,p2 for Real;
reserve R for Subset of REAL;
reserve seq,seq1,seq2,seq3 for Real_Sequence;
reserve Ns for increasing sequence of NAT;
reserve n for Nat;
reserve W for non empty set;
reserve h,h1,h2 for PartFunc of W,REAL;
reserve e1,e2 for ExtReal;
reserve h,h1,h2 for PartFunc of REAL,REAL;

theorem
  (h|[.p,g.] is increasing or h|[.p,g.] is decreasing) implies h|[.p,g.]
  is one-to-one
proof
  assume
A1: h|[.p,g.] is increasing or h|[.p,g.] is decreasing;
  now
    per cases by A1;
    suppose
A2:   h|[.p,g.] is increasing;
      now
        let p1,p2 be Element of REAL;
        assume that
A3:     p1 in dom(h|[.p,g.]) and
A4:     p2 in dom(h|[.p,g.]) and
A5:     (h|[.p,g.]).p1 = (h|[.p,g.]).p2;
A6:     p1 in [.p,g.] /\ dom h & p2 in [.p,g.] /\ dom h by A3,A4,RELAT_1:61;
A7:     h.p1=(h|[.p,g.]).p2 by A3,A5,FUNCT_1:47
          .=h.p2 by A4,FUNCT_1:47;
        thus p1=p2
        proof
          assume
A8:       p1<>p2;
          now
            per cases by A8,XXREAL_0:1;
            suppose
              p1<p2;
              hence contradiction by A2,A7,A6,Th20;
            end;
            suppose
              p2<p1;
              hence contradiction by A2,A7,A6,Th20;
            end;
          end;
          hence contradiction;
        end;
      end;
      hence thesis;
    end;
    suppose
A9:   h|[.p,g.] is decreasing;
      now
        let p1,p2 be Element of REAL;
        assume that
A10:    p1 in dom(h|[.p,g.]) and
A11:    p2 in dom(h|[.p,g.]) and
A12:    (h|[.p,g.]).p1 = (h|[.p,g.]).p2;
A13:    p1 in [.p,g.] /\ dom h & p2 in [.p,g.] /\ dom h by A10,A11,RELAT_1:61;
A14:    h.p1=(h|[.p,g.]).p2 by A10,A12,FUNCT_1:47
          .=h.p2 by A11,FUNCT_1:47;
        thus p1=p2
        proof
          assume
A15:      p1<>p2;
          now
            per cases by A15,XXREAL_0:1;
            suppose
              p1<p2;
              hence contradiction by A9,A14,A13,Th21;
            end;
            suppose
              p2<p1;
              hence contradiction by A9,A14,A13,Th21;
            end;
          end;
          hence contradiction;
        end;
      end;
      hence thesis;
    end;
  end;
  hence thesis;
end;
