
theorem Th4:
  for n,k,m being Nat st k <= n & m = [\ n/2 /] holds n choose m >= n choose k
proof
  defpred P[Nat] means for k,m being Nat st k <= m & m = [\ $1/2 /] holds $1
  choose m >= $1 choose k;
A1: 1/2 - 1 < 0;
A2: for n being Nat st P[n] holds P[n+1]
  proof
    let n be Nat;
    assume
A3: P[n];
    for k,m1 being Nat st k <= m1 & m1 = [\ (n+1)/2 /] holds (n+1) choose
    m1 >= (n+1) choose k
    proof
      [\ n/2 /]<=n/2 by INT_1:def 6;
      then -[\ n/2 /] >= -n/2 by XREAL_1:24;
      then
A4:   -[\ n/2 /]+(n+1) >= -n/2+(n+1) by XREAL_1:6;
      set m = [\ n/2 /];
      let k,m1 be Nat;
      assume
A5:   k <= m1;
      set nk1 = n + 1 - k;
      set l = n - m;
      reconsider m as Element of NAT by INT_1:53;
      2*n >= 1*n by XREAL_1:64;
      then
A6:   n/2 >= [\ n/2 /] & 2*n/2 >= n/2 by INT_1:def 6,XREAL_1:72;
      then
A7:   n >= m by XXREAL_0:2;
      n - m = n -' m by A6,XREAL_1:233,XXREAL_0:2;
      then reconsider l as Element of NAT;
      ((n+1)!)/(n!) = (n+1)*(n!)/(n!) by NEWTON:15
        .= (n+1)*((n!)/(n!)) by XCMPLX_1:74
        .= (n+1)*1 by XCMPLX_1:60;
      then
A8:  (n!)/((n+1)!) = 1/(n+1) by XCMPLX_1:57;
A9:  -n/2+(n+1)=n/2+1;
      set nk = n-k;
      set l1 = (n+1) -' m1;
A10:  1*m1 <= 2*m1 by XREAL_1:64;
      assume
A11:  m1 = [\ (n+1)/2 /];
      then m1 <= (n+1)/2 by INT_1:def 6;
      then
A12:  m1*2 <= (n+1)/2*2 by XREAL_1:64;
      then
A13:  n+1 >= m1 & l1=(n+1) - m1 by A10,XREAL_1:233,XXREAL_0:2;
A14:  (n+1)/2 >= [\ (n+1)/2 /] by INT_1:def 6;
A15:  n >= k
      proof
        per cases;
        suppose
          n=0;
          hence thesis by A1,A5,A11,INT_1:def 6;
        end;
        suppose
          n<>0;
          then n+1>0+1 by XREAL_1:6;
          then n>=1 by NAT_1:13;
          then n+n>=1+n by XREAL_1:6;
          then 2*n/2>=(n+1)/2 by XREAL_1:72;
          then n>=[\ (n+1)/2 /] by A14,XXREAL_0:2;
          hence thesis by A5,A11,XXREAL_0:2;
        end;
      end;
      then n - k = n -' k by XREAL_1:233;
      then reconsider nk as Element of NAT;
      n/2 - 1 < [\ n/2 /] by INT_1:def 6;
      then
A16:  n/2 - 1 +1 < [\ n/2 /]+1 by XREAL_1:6;
      n + 1 - k = nk + 1;
      then reconsider nk1 as Element of NAT;
      0+n<=1+n by XREAL_1:6;
      then
A17:  k<=n+1 by A15,XXREAL_0:2;
      then
A18:  (n+1) choose k = ((n+1)!)/((nk1!)*(k!)) by NEWTON:def 3;
A19:  (nk1!)/(nk!) = (nk+1)*(nk!)/(nk!) by NEWTON:15
        .= (nk+1)*((nk!)/(nk!)) by XCMPLX_1:74
        .= (nk+1)*1 by XCMPLX_1:60;
      n choose k = (n!)/((nk!)*(k!)) by A15,NEWTON:def 3;
      then
      (n choose k)/((n+1) choose k) = ((n!)/((nk!)*(k!)))/(((n+1)!)/((nk1
      !)*(k!))) by A17,NEWTON:def 3
        .= ((n!)/((nk!)*(k!)))/((n+1)!)*((nk1!)*(k!)) by XCMPLX_1:82
        .= ((n!)/(((n+1)!)*((nk!)*(k!))))*((nk1!)*(k!)) by XCMPLX_1:78
        .= ((1/(n+1))/((nk!)*(k!)))*((nk1!)*(k!)) by A8,XCMPLX_1:78
        .= (1/(n+1))/(((nk!)*(k!))/((nk1!)*(k!))) by XCMPLX_1:82
        .= (1/(n+1))/(((nk!)/(nk1!))/((k!)/(k!))) by XCMPLX_1:84
        .= (1/(n+1))/(((nk!)/(nk1!))/1) by XCMPLX_1:60
        .= (1/(n+1))/(1/(nk+1)) by A19,XCMPLX_1:57
        .= (1*(nk+1))/(1*(n+1)) by XCMPLX_1:84
        .= (nk+1)/(n+1);
      then
A20:  (n choose k)/(((n+1) choose k)/((n+1) choose k)) = (nk+1)/(n+1)*((n
      +1) choose k) by XCMPLX_1:82;
A21:  n choose k = (n choose k)/1
        .= (nk+1)/(n+1)*((n+1) choose k) by A18,A20,XCMPLX_1:60;
      then
A22:  (n choose k)*((n+1)/(l+1)) = ((nk+1)/(n+1)*((n+1) choose k)*(n+1))/
      (l+1) by XCMPLX_1:74
        .= ((nk+1)/(n+1)*(n+1)*((n+1) choose k))/(l+1)
        .= (((n+1)/(n+1))*(nk+1)*((n+1) choose k))/(l+1) by XCMPLX_1:75
        .= (1*(nk+1)*((n+1) choose k))/(l+1) by XCMPLX_1:60
        .= ((n+1) choose k)*((nk+1)/(l+1)) by XCMPLX_1:74;
A23:  (n choose k)*((n+1)/(m+1)) = ((nk+1)/(n+1)*((n+1) choose k)*(n+1))/
      (m+1) by A21,XCMPLX_1:74
        .= ((nk+1)/(n+1)*(n+1)*((n+1) choose k))/(m+1)
        .= (((n+1)/(n+1))*(nk+1)*((n+1) choose k))/(m+1) by XCMPLX_1:75
        .= (1*(nk+1)*((n+1) choose k))/(m+1) by XCMPLX_1:60
        .= ((n+1) choose k)*((nk+1)/(m+1)) by XCMPLX_1:74;
      per cases;
      suppose
        n is even;
        then consider k1 be Nat such that
A24:    n = 2*k1 by ABIAN:def 2;
A25:    [\ (n+1)/2 /] = [\ 2*k1/2 + 1/2 /] by A24
          .= k1 + [\ 1/2 /] by INT_1:28
          .= k1 + 0 by A1,INT_1:def 6
          .= [\ n/2 /] by A24;
        then
A26:    n choose m >= n choose k by A3,A5,A11;
        -k>=-[\ n/2 /] by A5,A11,A25,XREAL_1:24;
        then -k+(n+1)>=-[\ n/2 /]+(n+1) by XREAL_1:6;
        then
        (n-k+1)/(n-[\ n/2 /]+1)>= (n-[\ n/2 /]+1)/(n-[\ n/2 /]+1) by A4,A9,
XREAL_1:72;
        then (n-k+1)/(n-[\ n/2 /]+1)>=1 by A4,A9,XCMPLX_1:60;
        then
A27:    ((n-k+1)/(n-[\ n/2 /]+1))*((n+1) choose k)>= 1*((n+1) choose k)
        by XREAL_1:64;
A28:    l1 = (n + 1 - m1) by A12,A10,XREAL_1:233,XXREAL_0:2
          .= l + 1 by A11,A25;
        (n+1) choose m1 = ((n+1)!)/((m1!)*(l1!)) by A13,NEWTON:def 3
          .= ((n+1)*(n!))/((m!)*((l + 1)!)) by A11,A25,A28,NEWTON:15
          .= ((n+1)*(n!))/((m!)*((l + 1)*(l!))) by NEWTON:15
          .= ((n+1)*(n!))/((l + 1)*((m!)*(l!)))
          .= ((n+1)/(l+1))/(((m!)*(l!))/(n!)) by XCMPLX_1:84
          .= ((n!)/((m!)*(l!)))*((n+1)/(l+1)) by XCMPLX_1:80
          .= (n choose m)*((n+1)/(l+1)) by A7,NEWTON:def 3;
        then
        (n+1) choose m >= ((n+1) choose k)*((nk+1)/(l+1)) by A11,A22,A25,A26,
XREAL_1:64;
        hence thesis by A11,A25,A27,XXREAL_0:2;
      end;
      suppose
        n is not even;
        then consider j be Integer such that
A29:    n = 2*j+1 by ABIAN:1;
A30:    [\ (n+1)/2 /] = j + 0 + 1 by A29
          .= j + [\ 1/2 /] + 1 by A1,INT_1:def 6
          .= [\ j + 1/2 /] + 1 by INT_1:28
          .= [\ n/2 /] + 1 by A29;
A31:    l1 = (n + 1 - m1) by A12,A10,XREAL_1:233,XXREAL_0:2
          .= l by A11,A30;
        per cases by A5,A11,A30,XXREAL_0:1;
        suppose
          k=m+1;
          hence thesis by A11,A30;
        end;
        suppose
          k<m+1;
          then
A32:      k<=m by NAT_1:13;
          then
A33:      n choose m >= n choose k by A3;
          n/2>=[\ n/2 /] by INT_1:def 6;
          then n/2*2>=[\ n/2 /]*2 by XREAL_1:64;
          then n - [\ n/2 /] >= [\ n/2 /]*2 - [\ n/2 /] by XREAL_1:9;
          then n - [\ n/2 /] >= k by A32,XXREAL_0:2;
          then n - [\ n/2 /] - (k - [\ n/2 /]) >= k - (k - [\ n/2 /]) by
XREAL_1:9;
          then n-k+1>=[\ n/2 /]+1 by XREAL_1:6;
          then (n-k+1)/([\ n/2 /]+1)>= ([\ n/2 /]+1)/([\ n/2 /]+1) by A16,
XREAL_1:72;
          then (n-k+1)/([\ n/2 /]+1)>=1 by A16,XCMPLX_1:60;
          then
A34:      ((n-k+1)/([\ n/2 /]+1))*((n+1) choose k)>= 1*((n+1) choose k)
          by XREAL_1:64;
          (n+1) choose m1 = ((n+1)!)/((m1!)*(l1!)) by A13,NEWTON:def 3
            .= ((n+1)*(n!))/(((m+1)!)*(l!)) by A11,A30,A31,NEWTON:15
            .= ((n+1)*(n!))/(((m!)*(m+1))*(l!)) by NEWTON:15
            .= ((n+1)*(n!))/((m + 1)*((m!)*(l!)))
            .= ((n+1)/(m+1))/(((m!)*(l!))/(n!)) by XCMPLX_1:84
            .= ((n!)/((m!)*(l!)))*((n+1)/(m+1)) by XCMPLX_1:80
            .= (n choose m)*((n+1)/(m+1)) by A7,NEWTON:def 3;
          then (n+1) choose m1 >= ((n+1) choose k)*((nk+1)/(m+1)) by A23,A33,
XREAL_1:64;
          hence thesis by A34,XXREAL_0:2;
        end;
      end;
    end;
    hence thesis;
  end;
A35: P[0];
A37: for n being Nat holds P[n] from NAT_1:sch 2(A35,A2);
  for n,k,m being Nat st k <= n & m = [\ n/2 /] holds n choose m >= n choose k
  proof
    let n,k,m be Nat;
    assume
A38: k <= n;
    assume
A39: m = [\ n/2 /];
    per cases;
    suppose
      k<=m;
      hence thesis by A37,A39;
    end;
    suppose
A40:  k>m;
      set r=n-'k;
A41:  n-'k=n-k by A38,XREAL_1:233;
      then
A42:  n choose k = n choose r by A38,NEWTON:20;
      per cases;
      suppose
A43:    n is even;
        -k < -m by A40,XREAL_1:24;
        then
A44:    -k+n < -m+n by XREAL_1:6;
        ex j be Nat st n = 2*j by A43,ABIAN:def 2;
        then n/2 = [\ n/2 /];
        hence thesis by A37,A39,A41,A42,A44;
      end;
      suppose
        n is not even;
        then consider j be Integer such that
A45:    n = 2*j+1 by ABIAN:1;
A46:    k>=m+1 by A40,NAT_1:13;
A47:    [\ n/2 /] = [\ j + 1/2 /] by A45
          .= j + [\ 1/2 /] by INT_1:28
          .= j + 0 by A1,INT_1:def 6
          .=j;
        per cases by A46,XXREAL_0:1;
        suppose
A48:      k=m+1;
          set nm1 = n-(m+1);
          set nm = n-m;
          2*n >= 1*n by XREAL_1:64;
          then
A49:      n/2 >= [\ n/2 /] & 2*n/2 >= n/2 by INT_1:def 6,XREAL_1:72;
          then
A50:      n>=m by A39,XXREAL_0:2;
          n - m = n -' m by A39,A49,XREAL_1:233,XXREAL_0:2;
          then reconsider nm as Element of NAT;
          2*m >= 1*m by XREAL_1:64;
          then
A51:      n>= m+1 by A39,A45,A47,XREAL_1:6;
          then n - (m+1) = n -' (m+1) by XREAL_1:233;
          then reconsider nm1 as Element of NAT;
A52:      n choose (m+1) = (n!)/((nm1!)*((m+1)!)) by A51,NEWTON:def 3;
          nm = m+1 by A39,A45,A47;
          hence thesis by A48,A50,A52,NEWTON:def 3;
        end;
        suppose
          k>m+1;
          then -k < -(m+1) by XREAL_1:24;
          then -k+n < -(m+1)+n by XREAL_1:6;
          hence thesis by A37,A39,A41,A42,A45,A47;
        end;
      end;
    end;
  end;
  hence thesis;
end;
