A question on polynomials Let $D=\{0,1\}$.
Are there infinite values of $n\in \Bbb N$ for which there is a polynomial $p(x_1,x_2,\dots,x_n)\in \Bbb R[x_1,x_2,\dots,x_n]$ and a rational function $r(x_1,x_2,\dots,x_n)\in \Bbb R(x_1,x_2,\dots,x_n)$ of lower degree such that:
$p(x_1,x_2,\dots,x_n)|_{x_i\in D}=r(x_1,x_2,\dots,x_n)|_{x_i\in D}\in D?$
 A: Still, such $p$ exists. 
Let $Q=\{0,1\}^n$, and for every $q \in Q$ denote, as usual, $x^q=\prod_{i=1}^n x_i^{q_i}$. For every set of values $(a_q)_{q\in Q}$ there exists a unique multiaffine polynomial 
$$
  p(x)=\sum_{q\in Q} p_qx^q
$$ 
such that $p(q) = a_q$ for all $q\in Q$. This polynomial can be represented as
$$
  p(x)=\sum_{q\in Q}a_q\prod_{i\colon q_i=1}x_i\prod_{j\colon q_j=0}(1-x_j),
$$
as each summand attains $a_q$ at $q$ and attains $0$ at all other elements of $Q$. Therefore, the coefficient at $x_1\dots x_n$ is
$$
  p_{1,1,\dots,1}=\sum_{q\in Q}(-1)^{n-\sum_i q_i}a_q.
$$
So, if an odd number of $a_p$'s are ones, and the others are zeroes, then $p_{1,1,\dots,1}$ is odd and thus nonzero.
Having stated this, we now set $n=k^2$ for integer $k>1$ and rename the variables as $y_{ij}$ ($i,j=1,\dots,k$). Consider two polynomials $f$, $g$ of degree $k$ each:
$$
  f(y)=\sum_{i=1}^k\prod_{j=1}^k (1-y_{ij}), \\
  g(y)=\sum_{1\leq j_1,\dots,j_k\leq k}\prod_{i=1}^k y_{ij_i}.
$$
Then for every $y\in Q$, we have $f(y)\neq0$ if and only if $y_{i1}=\dots=y_{ik}=0$ for some $i$, and $g(y)\neq 0$ exactly if such $i$ does not exist. Thus means that the sets of zeroes of $f$ and $g$ on $Q$ are disjoint, and their union is $Q$. Thus, the function
$$
  r(y)=\frac{f(y)}{f(y)+g(y)}
$$
attains $0$ at all zeroes of $f$ on $Q$, and attains $1$ at all other points of $Q$.
Finally, I claim that the polynomial $p(y)$ reconstructed from $r(y)$ is of degree $n$. By the first paragraph, it suffices to show that $f$ has an odd number of zeroes on $Q$. Each such zero is a combination $(y_{ij})_{i,j=1}^k$ where for every $i=1,\dots,k$ we have $(y_{i1},\dots,y_{ik})\neq (0,\dots,0)$. So for each such string we have $2^k-1$ choices, and $f$ has $(2^k-1)^k$ zeroes, i.e. an odd number of them. 
