We are given three binary indicator variables $X_{ij}, Y_{jk}$ and $Z_{jl}$. Write linear constraints such that,
a) if $X_{ij}$ is equal to 1, then for that $j$ when $X_{ij} = 1$, exactly one $Y_{jk} = 1$, while if $X_{ij}$ is equal to 0, then for that $j$ all $\sum_{k} Y_{jk}$ should be 0
b) if $X_{ij}$ and $Y_{jk}$ is equal to 1, exactly one $Z_{jl} = 1$, while $X_{ij} = 0$ implies $Y_{jk} = 0$ from the first constraint and also ensure $\sum_{l} Z_{jl} = 0$ for that $j$
The first constraint can be expressed as $(1 - X_{ij}) + \sum_{k}{Y_{jk} = 1}, \forall i, j$ derived from the boolean CNF expression
The second constraint can be expressed as $(1 - X_{ij}) (1 - Y_{jk}) + \sum_{l}{Z_{jl} = 1} , \forall i, j, k$, but is quadratic. How can this be expressed linearly?