Section lucas_lemma.
(* https://math.stackexchange.com/questions/1463758/proof-of-lucas-theorem-without-the-polynomial-hint *)
Variables (p : nat) (Hprime : prime p).
Let Hp : p <> 0.
Variables (n N n0 k K k0 : nat)
(G1 : n = N*p+n0)  (G2 : n0 < p)
(G3 : k = K*p+k0)  (G4 : k0 < p).
Let choice : (K <= N  /\ k0 <= n0)
\/ (n0 < k0 /\ K < N)
\/ ((n0 < k0 \/ N < K) /\ n < k).

Theorem lucas_lemma : rem (binomial n k) p = rem (binomial N K * binomial n0 k0) p.