1

If I have an equation, $$ x^2 = 4 $$

Then this can be solved to give, $$ x = 2 \vee x = -2 $$

Is their a way of representing multiple values for an expression, without breaking the rules of math.

I am thinking of something more general than just $ \pm 2 $.

For example, $ \pm 2 + \pm 2 $ could be 4, 0, or -4.

But if the $ \pm 2 $ where actually the same value from the same expression. $$ x = \pm 2 $$

Then the 0 would be impossible. $$ x + x = 2*x = \pm 4 $$

So in general it is necessary to track where values came from.

So something that in general, manages and tracks where the values come from so as to avoid contradictions.

  • you last example doesn't work (+2)+(-2) =0 –  Sep 04 '17 at 12:55
  • You want "$x = 2 \color{blue}{\vee} x = -2$" instead of "$x = 2 \color{red}{\wedge} x = -2$" because $x$ can't be 2 and -2 at the same time (there would be no $x$ satisfying that last expression). – StackTD Sep 04 '17 at 13:03
  • check this out: https://math.stackexchange.com/questions/1250325/does-22-4-imply-2-pm-sqrt4/2233600#2233600 – farruhota Sep 04 '17 at 13:12
  • I was thought that $\pm2\pm 2$ means either $+2+2$ or $-2-2$ but not $+2-2$ or $-2+2$. That is that it applies to the whole equation.Usually one would have to write both $\pm 2\pm 2$ and $\pm 2\mp 2$ to get all the 4 combinations(3 in this case). Though I guess this can be ambiguous. – kingW3 Sep 04 '17 at 13:34
  • @ kingW3 You are correct. There is a convention that goes that way. But you have put me in a quandary, because I am not sure everyone follows that convention. – Peter Driscoll Sep 04 '17 at 13:48

1 Answers1

1

I want to to represent both values in a single expression, without breaking the rules of math. I use this notation, $$ [2::x=2, -2::x=-2] $$

this is defined to mean 2, if x = 2, or -2 , if x = -2.

Lets me abstract the details by naming the conditions $x=2$ and $x=-2$ as $x_1$ and $x_2$.

$$ [2::x_1, -2::x_2] $$

I call this a value set. Then we can manipulate these expressions, safely using some rules. For example I might want to add the value to itself.

$$ [2::x_1, -2::x_2] + [2::x_1, -2::x_2] $$

The rules for applying an operator or function to value sets are simple, but for brevity I will just give the result. $$ [2+2::x_1 \wedge x_1, 2+-2::x_1 \wedge x_2, -2+2::x_2 \wedge x_1, -2+-2::x_2 \wedge x_2]$$

I could refer back to the definitions of $x_1$ and $x_2$. But I want to abstract away all the details of what the symbols mean. Instead I use the rules,

$$ x_n \wedge x_n = x_n $$

$$ n \ne m \implies x_n \wedge x_m = \text{false} $$

and this gives me,

$$ [2::x_1, -2::x_2] + [2::x_1, -2::x_2] = [4::x_1, 0::\text{false}, 0::\text{false}, -4::x_2]$$

and the false terms can be removed to give, $$ [2::x_1, -2::x_2] + [2::x_1, -2::x_2] = [4::x_1, -4::x_2]$$

I have implemented these things, along with relational evaluation in some C++ classes as an embedded language it works fine, so far. I know it as narrowing, and it is similar to some techniques used in Constraint Logic Programming.

But I am really interested in if this kind of method has been considered in math. My question is, is there a name for this. Is it a common technique? Do you see any problems or issues I should be aware of, from the mathematical point of view?

  • You can't "break mathematics". You can create new mathematical structures as long as they are logically consistent. You seem to be implementing such a structure in your program, because you find it useful there. That's just fine. I haven't read your definitions carefully, but it's possible that you are just using ordinary sets and defining $A+B$ as the set of all sums $a+b$ where $a \in A$ and $b \in B$. The definition of "set" automatically deletes duplicates. As an abstraction, the elements of $A$ and $B$ need not be numbers, just things it's possible to add. – Ethan Bolker Sep 04 '17 at 13:29
  • @ Ethan Bolker Yes that is what I am doing; creating cartesian products of values and eliminating combinations of values that are associated with one variable having two different values. :) – Peter Driscoll Sep 04 '17 at 13:56