reserve x,y for object,X,Y for set,
  D for non empty set,
  i,j,k,l,m,n,m9,n9 for Nat,
  i0,j0,n0,m0 for non zero Nat,
  K for Field,
  a,b for Element of K,
  p for FinSequence of K,
  M for Matrix of n,K;

theorem Th4:
  for perm being Element of Permutations n st perm <> idseq n holds
  (ex i st i in Seg n & perm.i > i) & ex j st j in Seg n & perm.j < j
proof
  let p be Element of Permutations n such that
A1: p <> idseq n;
  reconsider p9=p as Permutation of Seg n by MATRIX_1:def 12;
  dom p9=Seg n by FUNCT_2:52;
  then consider x be object such that
A2: x in Seg n and
A3: p.x<>x by A1,FUNCT_1:17;
  consider i be Nat such that
A4: i=x and
A5: 1<=i and
A6: i<=n by A2;
  now
    per cases by A3,A4,XXREAL_0:1;
    suppose
      p.i>i;
      hence ex j st j in Seg n & p.j > j by A2,A4;
    end;
    suppose
A7:   p.i<i;
      then reconsider i1=i-1 as Nat by NAT_1:20;
      thus ex j st j in Seg n & p.j > j
      proof
        reconsider pS=p9.:Seg i as finite set;
A8:     dom p9=Seg n by FUNCT_2:52;
        Seg i c= Seg n by A6,FINSEQ_1:5;
        then (Seg i),pS are_equipotent by A8,CARD_1:33;
        then
A9:     card Seg i=card pS by CARD_1:5;
        assume
A10:    for j st j in Seg n holds p.j<=j;
        p.:Seg i c= Seg i1
        proof
          let x be object;
          assume x in p.:Seg i;
          then consider y be object such that
A11:      y in dom p9 and
A12:      y in Seg i and
A13:      p.y=x by FUNCT_1:def 6;
          consider j be Nat such that
A14:      j=y and
          1<=j and
A15:      j<=i by A12;
          per cases by A15,XXREAL_0:1;
          suppose
            j=i;
            then p.j<i1+1 by A7;
            then
A16:        p.j <= i1 by NAT_1:13;
A17:        rng p9=Seg n by FUNCT_2:def 3;
            p.j in rng p by A11,A14,FUNCT_1:def 3;
            then p.j>=1 by A17,FINSEQ_1:1;
            hence thesis by A13,A14,A16;
          end;
          suppose
A18:        j<i;
            p.j <=j by A10,A11,A14;
            then p.j < i1+1 by A18,XXREAL_0:2;
            then
A19:        p.j<= i1 by NAT_1:13;
A20:        rng p9=Seg n by FUNCT_2:def 3;
            p.j in rng p by A11,A14,FUNCT_1:def 3;
            then p.j>=1 by A20,FINSEQ_1:1;
            hence thesis by A13,A14,A19;
          end;
        end;
        then
A21:    card pS <= card Seg i1 by NAT_1:43;
        card Seg i=i by FINSEQ_1:57;
        then i1+1 <= i1 by A9,A21,FINSEQ_1:57;
        hence thesis by NAT_1:13;
      end;
    end;
  end;
  hence ex j st j in Seg n & p.j > j;
  per cases by A3,A4,XXREAL_0:1;
  suppose
    p.i<i;
    hence thesis by A2,A4;
  end;
  suppose
A22: p.i>i;
    thus ex j st j in Seg n & p.j < j
    proof
      set NI=nat_interval(i,n);
      reconsider pN=p9.:NI as finite set;
A23:  i in NI by A6,SGRAPH1:2;
      assume
A24:  for j st j in Seg n holds p.j>=j;
A25:  pN c= NI
      proof
        let x be object;
A26:    rng p9=Seg n by FUNCT_2:def 3;
        assume x in pN;
        then consider j be object such that
A27:    j in dom p9 and
A28:    j in NI and
A29:    p.j=x by FUNCT_1:def 6;
        reconsider j as Nat by A28;
        reconsider pj=p.j as Element of NAT by ORDINAL1:def 12;
A30:    j<=pj by A24,A27;
        i<=j by A28,SGRAPH1:2;
        then
A31:    i <=pj by A30,XXREAL_0:2;
        pj in rng p9 by A27,FUNCT_1:def 3;
        then pj<=n by A26,FINSEQ_1:1;
        hence thesis by A29,A31,SGRAPH1:1;
      end;
      dom p9=Seg n by FUNCT_2:52;
      then NI, pN are_equipotent by A5,CARD_1:33,SGRAPH1:4;
      then card NI=card pN by CARD_1:5;
      then NI=pN by A25,CARD_2:102;
      then consider j be object such that
A32:  j in dom p9 and
A33:  j in NI and
A34:  p.j=i by A23,FUNCT_1:def 6;
      reconsider j as Nat by A33;
A35:  i<=j by A33,SGRAPH1:2;
      j <= i by A24,A32,A34;
      hence thesis by A22,A34,A35,XXREAL_0:1;
    end;
  end;
end;
