title: Predicate to check each element of the diagonal of matrix NxN
body: <p>I need to write a Prolog predicate to check if all element on the diagonal of matrix NxN is equal to the sum of all other elements in the same row.</p>
  
  <p>For example:</p>
  
  <pre><code>check([[1, 0, 1], [1, 2, 1], [7, 8, 15]]) =&gt; true
  </code></pre>
  
  <p>Any help (tip, resource to read,...) is really appreciated.</p>