negation

NOT is the truth-functional operator of negation. Its logical connective is represented ¬ , written \neg.

Boolean negation is an operation which takes as input one logical truth value; it returns a value of true when its operand is false, and a value of false when its operand is true.

Visually,

\documentclass{standalone}
\usepackage{tikz}
%
\definecolor{fillcolor}{HTML}{8A5CF5}
%
\tikzset{truthy/.style n args={1}{%
    fill=#1,draw,%
    inner sep=0,minimum size=1cm}}
%
\begin{document}
\begin{tikzpicture}
	\path (-2,-2) rectangle (2,2);
	\node at (0,0.5) {Negation of $P$};
	\node at (0,-0.5) {$\neg P$};
\end{tikzpicture}
\begin{tikzpicture}
	\node at (-1.5,0.5) {$P$};
	\node at (0.5,2.5) {$Q$};
	\node at (-1,0) {\small$1$};
	\node at (-1,1) {\small$0$};
	\node at (0,2) {\small$0$};
	\node at (1,2) {\small$1$};
    \node[truthy={none}] at (0,0) {$0$}; % bottom left
    \node[truthy={none}] at (1,0) {$0$}; % bottom right
    \node[truthy={fillcolor}] at (0,1) {$1$}; % top left
    \node[truthy={fillcolor}] at (1,1) {$1$}; % top right
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
	\path (-3,-2) rectangle (3,2);
	% P
	% not P and not Q
	\begin{scope}[even odd rule]
		\clip (-3,-2) rectangle (3,2) (-1,0) circle (1.5);
		\fill[fillcolor] (-3,-2) rectangle (3,2);
	\end{scope}
	%
    \draw (-1,0) circle (1.5);
    \draw (1,0) circle (1.5);
    \node at (-1.25,0) {$P$};
    \node at (1.25,0) {$Q$};
\end{tikzpicture}
\end{document}
\documentclass{standalone}
\usepackage{tikz}
%
\definecolor{fillcolor}{HTML}{8A5CF5}
%
\tikzset{truthy/.style n args={1}{%
    fill=#1,draw,%
    inner sep=0,minimum size=1cm}}
%
\begin{document}
\begin{tikzpicture}
	\path (-2,-2) rectangle (2,2);
	\node at (0,0.5) {Negation of $Q$};
	\node at (0,-0.5) {$\neg Q$};
\end{tikzpicture}
\begin{tikzpicture}
	\node at (-1.5,0.5) {$P$};
	\node at (0.5,2.5) {$Q$};
	\node at (-1,0) {\small$1$};
	\node at (-1,1) {\small$0$};
	\node at (0,2) {\small$0$};
	\node at (1,2) {\small$1$};
    \node[truthy={fillcolor}] at (0,0) {$1$}; % bottom left
    \node[truthy={none}] at (1,0) {$0$}; % bottom right
    \node[truthy={fillcolor}] at (0,1) {$1$}; % top left
    \node[truthy={none}] at (1,1) {$0$}; % top right
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
	\path (-3,-2) rectangle (3,2);
	% P
	% not P and not Q
	\begin{scope}[even odd rule]
		\clip (-3,-2) rectangle (3,2) (1,0) circle (1.5);
		\fill[fillcolor] (-3,-2) rectangle (3,2);
	\end{scope}
	%
    \draw (-1,0) circle (1.5);
    \draw (1,0) circle (1.5);
    \node at (-1.25,0) {$P$};
    \node at (1.25,0) {$Q$};
\end{tikzpicture}
\end{document}

The negation of a proposition P is generally written ¬P, where if P is true, then ¬P is false, and vice-versa. Per above, we would say "P" and "not P"

In a logic circuit, the NOT gate looks like

\documentclass[tikz]{standalone}
\usetikzlibrary{shapes.gates.logic.US}
%
\begin{document}
\begin{tikzpicture}
	\node[draw,not gate US,logic gate inputs=n] (gate) at (0,0) {};
	%
	\draw (gate.input) --++ (-0.25,0);
	\draw (gate.output) --++ (0.25,0);
\end{tikzpicture}
\end{document}
Powered by Forestry.md