2

I know how the notation for "such that" looks like when talking about sets, but I don't understand how it's represented logically in terms of AND/OR and conditional IF statements.

To clarify my question, how would one represent the logic of "such that" in computer software? After all, the meaning of "such that" is a constraint, so does it mean that I would simply translate "x such that y>0" to "x AND y>0" ? Or maybe it should be "If y>0 then x"?

Thanks

  • I don't see any relation between $x$ and $y$, so "$x$ such than $y>0$" either means the same as "$x$" (if $y$ happens to be greater than $0$), or cannot be fulfilled (if $y\le 0$). – celtschk Aug 30 '16 at 03:57
  • 1
    Unclear what you're asking IMO. – barak manos Aug 30 '16 at 04:38
  • Wouldn't it be a for or while loop? – fleablood Aug 30 '16 at 05:38
  • There are a couple of reasons why we might use "such that" in mathematics, and not all of those are useful in programming. The phrase "there exists an integer $x$ such that $x$ is equal to $\sqrt{4}$" is not going to be something that you code in a computer. On the other hand, if you are wishing to brute force write out all entries of a set like ${x\in S~:~x\equiv 2\pmod{3}}$ you can run a loop and brute force check each element of $S$ to see if it meets the conditions and if it does add it to the set. Depending on the situation, this may not be particularly efficient. – JMoravitz Aug 30 '16 at 06:19

2 Answers2

2

In discussions of sets, the phrase "such that" is usually encountered between bound variables and predicates in either predicate logic statements or in set builder notation (where the predicate is a constraint).   Often both at once.

$$\{x\in \Bbb Z \mid \exists n\in Z:(2n=x)\}$$

This may be pronounced: "The set of integers $x$ such that there is some integer n such that $2n=x$."


In predicate logic statements, the colon is an optional punctuation mark to make the statement parse better.   It may be omitted without impacting the statement, but helps visually separate the predicate from the bound variable.   $\forall x\in \Bbb R: x^2\geq 0$ has the same meaning as $\forall x\in\Bbb R~~x^2\geq 0$, however some clarity may be lost.   Parenthesis serve the same purpose.

However, in set construction notation the separator is mandatory; though a vertical bar or a colon may be used, depending on available typesetting or style choice.

Graham Kemp
  • 129,094
  • If I omit the "such that" part then I lose information. It needs to be implemented in the logic that a computer is restricted to, which is Boolean Algebra basically. How would you represent it in that type of logic, where the notion of "such that" doesn't even exist, but only pure logical constructs? – Pineapple29 Aug 30 '16 at 14:38
  • The information is structural. You have a class with members consisting of: quantifier, bound variable, domain, predicate. – Graham Kemp Aug 30 '16 at 21:47
0

Usually when we use set-builder notation, we have something like,

$$S = \{ \text{some expression involving x} | \text{ some condition on x}\}.$$

Suppose we put all the elements that satisfy the condition and put them in a set called $A$ and let's denote the expression involving $x$ as $f(x)$. Then we can write, $$S = \{ f(x) | x \in A\}$$ and say

$$x \in A \implies f(x) \in S.$$

benguin
  • 3,846
  • So in short, "such that" can be translated to a condition (If Then)? Nobody else seems to agree on this simple translation.. – Pineapple29 Aug 31 '16 at 23:34