How does this demand function satisfy the Weak axiom if it doesnt satisfy the necessary and sufficient conditions?
Your equivalence result is incorrect. The correct results are:


If $x(p,w)$ satisfies Walras' law, homogeneity of degree zero, and the weak axiom, then the Slutsky matrix is negative semidefinite, that is, $v \cdot S(p,w) v \leq 0$ for any vector $v$.
If the Slutsky matrix is negative definite for all vectors $v$ that are not proportional to $p$, that is, if $v \cdot S(p,w) v &lt; 0$ for such vectors $v$, and if $x(p,w)$ satisfies Walras' law and homogeneity of degree zero, then it satisfies the weak axiom.


Therefore, there is no contradiction in the fact that your demand function satisfies the weak axiom while its Slutsky matrix is only negative semidefinite (and not negative definite).