16

As the title states, what is the difference between \lnot and \neg? The output seems the same to me but I want to know if they are the exact same thing, both semantically and as code definition.

\documentclass[border=1pt]{standalone}
\begin{document}
\(\lnot a \, \neg a\)
\end{document}

example

  • 2
    Similarly \land and \wedge represent the same symbol as do \lor and \vee. – egreg May 8 '18 at 21:54
23

For your disappointment, none. They are the same.

If you run

\documentclass{standalone}
\begin{document}
\(\show\lnot a \, \show\neg a\)
\end{document}

you'll get:

> \lnot=\mathchar"23A.
l.3 \(\show\lnot
                 a \, \show\neg a\)
? 
> \neg=\mathchar"23A.
l.3 \(\show\lnot a \, \show\neg
                                a\)

which shows that both are \mathchar"23A.


In fact, in plain.tex one finds:

\mathchardef\neg="023A \let\lnot=\neg

The same appears for other symbols as well:

\mathchardef\wedge="225E \let\land=\wedge
\mathchardef\vee="225F \let\lor=\vee
\def\neq{\not=} \let\ne=\neq
\mathchardef\leq="3214 \let\le=\leq
\mathchardef\geq="3215 \let\ge=\geq
\mathchardef\ni="3233 \let\owns=\ni
\mathchardef\leftarrow="3220 \let\gets=\leftarrow
\mathchardef\rightarrow="3221 \let\to=\rightarrow

My guess for the reason of this is that in different fields of applications these symbols get different names, so they have different names to make their utilization more intuitive.


In LaTeX, what happens is basically the same, but with a few more bells and whistles:

\DeclareMathSymbol{\neg}{\mathord}{symbols}{"3A}
    \let\lnot=\neg

This can be found in fontmath.ltx (loaded by latex.ltx).

  • 1
    I imagine that also semantically I could consider them the same, right? – gvgramazio May 8 '18 at 18:46
  • 3
    Yes, both are defined to be the same character. It's just two names for the same thing. – Phelype Oleinik May 8 '18 at 18:55
  • 2
    There is another redefinition of them in unicode-math, as the Unicode character U+00AC. It also defines \lnot as an alias for \neg. – Davislor May 8 '18 at 20:43
  • IIRC, ruby also has some under-the-hood-identical methods with different designations to, as @PhelypeOleinik said, "...make their utilization more intuitive."; that said, their documentation is usually nice enough to mention this. – kayleeFrye_onDeck May 8 '18 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.