reserve k, l, m, n, i, j for Nat,
  K, N for non empty Subset of NAT,
  Ke, Ne, Me for Subset of NAT,
  X,Y for set;
reserve f for Function of Segm n,Segm k;

theorem Th20:
  f is onto "increasing & n = k implies f = id n
proof
  assume that
A1: f is onto "increasing and
A2: n=k;
  now
    per cases;
    suppose
A3:   n=0;
      thus thesis by A3;
    end;
    suppose
A4:   n>0;
A5:   now
        let m9 be object such that
A6:     m9 in Segm n;
        reconsider m=m9 as Element of NAT by A6;
        m in rng f by A1,A2,A6,FUNCT_2:def 3;
        then
A7:     ex x be object st x in dom f & f.x =m by FUNCT_1:def 3;
        m in {m} by TARSKI:def 1;
        then reconsider F=f"{m} as non empty Subset of NAT by A7,FUNCT_1:def 7;
A8:     m < k by A2,A6,NAT_1:44;
        then
A9:    m <= min* f"{m} by A1,Th18;
        n-k+m =m by A2;
        then min* f"{m}<= m by A1,A8,Th19;
        then
A10:    min* F=m by A9,XXREAL_0:1;
        min* F in F by NAT_1:def 1;
        then f.m in {m} by A10,FUNCT_1:def 7;
        hence f.m9=m9 by TARSKI:def 1;
      end;
      dom f = n by A2,A4,FUNCT_2:def 1;
      hence thesis by A5,FUNCT_1:17;
    end;
  end;
  hence thesis;
end;
