# How can I input a logical proposition using a compact (implicit) notation?

I have:

$$\bigwedge_{i=1}^{9} \bigwedge_{n=1}^{9} \bigvee_{j=1}^{9}~p(i,j,n)$$

How can I write it in Wolfram Mathematica code?

I tried this way, but it does not work:

ToExpression["\\bigwedge_{i=1}^{9} \\bigwedge_{n=1}^{9} \\bigvee_{j=1}^{9}~p(i,j,n)",TeXForm]


During evaluation of In[2]:= ToExpression::esntx: Could not parse \bigwedge_{i=1}^{9} \bigwedge_{n=1}^{9} \bigvee_{j=1}^{9}~p(i,j,n) as input.

$Failed What is the mistake in my above code? ## 2 Answers Well, Mathematica can only parse its own language, not$\LaTeX$. The Mathematica equivalent would be P = Array[p, {9, 9, 9}]; Apply[And, Apply[And, Apply[Or, Transpose[P, {1, 3, 2}], {2}], {1}], {0}];  • But what about this ToExpression["input",TeXForm]? From here: reference.wolfram.com/language/tutorial/… convert TeX input to the Wolfram Language? Aug 24, 2018 at 16:51 •$\vee$and$\wedge$are interpreted quite differently among various mathematical subdisciplines, so Mathematica cannot assign unique meanings to them. Best is not to rely on such a way to code. See, ToExpression["\\sum_{i=1}^10 i", TeXForm] results in 0; complete nonsense. Aug 24, 2018 at 16:56 • Do you know any good tutorial/book/etc where is explained notation that is used in proposition in my post? Currently reading discrete math book but there is no explanation of that notation. I even do not know what to search in google to find that information. I tryied to search "index notation", "array notation", "compact for of propositions" but without luck. Maybe you know? Aug 24, 2018 at 17:06 • I don't exactly know what you mean. In mathematical logic,$\wedge$means "and" and$\vee$stands for "or". The notations of the form$\bigvee_{i=1}^9$and$\bigwedge_{i=1}^9$are analogous to the sum notation$\sum_{i=1}^9$. The latter should be explained in the first chapters of any beginner's analysis textbook. Aug 24, 2018 at 17:15 • Only single character superscripts are supported by Mathematica's TeXForm parser. Using ToExpression["\\sum_{i=1}^{10} i", TeXForm] works. Aug 24, 2018 at 17:41 If you want to be able to input your notation into Mathematica directly, you can define special MakeExpression rules: MakeExpression[RowBox[{UnderoverscriptBox["\[Wedge]",u__],r_}],form_]:=Replace[ MakeExpression[RowBox[{UnderoverscriptBox["\[Sum]",u],r}],form], HoldComplete[Sum[a__]]:>HoldComplete[NaryWedge[a]] ] NaryWedge[e_, iter_] := With[{list = Table[e, iter]}, And @@ list /; ListQ @ list ] MakeExpression[RowBox[{UnderoverscriptBox["\[Vee]",u__],r_}],form_]:=Replace[ MakeExpression[RowBox[{UnderoverscriptBox["\[Sum]",u],r}],form], HoldComplete[Sum[a__]]:>HoldComplete[NaryVee[a]] ] NaryVee[e_, iter_] := With[{list = Table[e, iter]}, Or @@ list /; ListQ @ list ]  For example:$p(7)\lor p(8)\lor p(9)$Now, you might like to have the vee and wedge symbols slightly larger. To do this we can introduce input auto replacement rules: CurrentValue[EvaluationNotebook[],{InputAutoReplacements,"vv"}] = StyleBox[ "\[Vee]", FontWeight->Plain, FontFamily->"Impact" ]; CurrentValue[EvaluationNotebook[],{InputAutoReplacements,"ww"}] = StyleBox[ "\[Wedge]", FontWeight->Plain, FontFamily->"Impact" ];  A short animation: • I pasted that code and executed. After I write ww and press Space. There appears$\bigwedge$but the cursor is to the right side of$\bigwedge$. How can I input upper and lower part of that$\bigwedge\$? Sep 15, 2018 at 19:07
• Use Ctrl-4 for underscript and Ctrl-5 to switch between under and overscript. See this tutorial for more details. Sep 15, 2018 at 19:09
• Very good example. It works great! Thank you. Sep 15, 2018 at 19:21