Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
% (find-angg "LATEX/2016-2-LA-logic.tex")
% (defun c () (interactive) (find-LATEXsh "lualatex -record 2016-2-LA-logic.tex"))
% (defun d () (interactive) (find-xpdfpage "~/LATEX/2016-2-LA-logic.pdf"))
% (defun e () (interactive) (find-LATEX "2016-2-LA-logic.tex"))
% (defun u () (interactive) (find-latex-upload-links "2016-2-LA-logic"))
% (find-xpdfpage "~/LATEX/2016-2-LA-logic.pdf")
% (find-sh0 "cp -v  ~/LATEX/2016-2-LA-logic.pdf /tmp/")
% (find-sh0 "cp -v  ~/LATEX/2016-2-LA-logic.pdf /tmp/pen/")
%   file:///home/edrx/LATEX/2016-2-LA-logic.pdf
%               file:///tmp/2016-2-LA-logic.pdf
%           file:///tmp/pen/2016-2-LA-logic.pdf
% http://angg.twu.net/LATEX/2016-2-LA-logic.pdf
%
% «.classical-logic»		(to "classical-logic")
% «.3-valued-logic»		(to "3-valued-logic")
% «.tautologies»		(to "tautologies")
% «.logics-as-objects»		(to "logics-as-objects")
% «.ZHA-logic»			(to "ZHA-logic")
% «.connectives»		(to "connectives")
% «.C-H-diagram-defs»		(to "C-H-diagram-defs")
% «.C-H-diagram»		(to "C-H-diagram")
% «.HAs-and-CCCs»		(to "HAs-and-CCCs")
% «.derived-rules»		(to "derived-rules")

% (find-LATEXsh "grep lao162p 2016-2-LA-logic.tex")


\documentclass[oneside]{book}
\usepackage[colorlinks]{hyperref} % (find-es "tex" "hyperref")
%\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
%
\usepackage{edrx15}               % (find-angg "LATEX/edrx15.sty")
\input edrxaccents.tex            % (find-angg "LATEX/edrxaccents.tex")
\input edrxchars.tex              % (find-LATEX "edrxchars.tex")
\input edrxheadfoot.tex           % (find-dn4ex "edrxheadfoot.tex")
%
\usepackage{proof}   % For derivation trees ("%:" lines)
\input diagxy        % For 2D diagrams ("%D" lines)
\xyoption{curve}     % For the ".curve=" feature in 2D diagrams
%
\begin{document}

\catcode`\^^J=10
\directlua{dednat6dir = "dednat6/"}
\directlua{dofile(dednat6dir.."dednat6.lua")}
\directlua{texfile(tex.jobname)}
\directlua{verbose()}
\directlua{output(preamble1)}
\def\expr#1{\directlua{output(tostring(#1))}}
\def\eval#1{\directlua{#1}}
\def\pu{\directlua{pu()}}

% \directlua{dofile "edrxtikz.lua"} % (find-LATEX "edrxtikz.lua")
% %L V.__tostring = function (v) return format("(%.3f,%.3f)", v[1], v[2]) end

\def\und#1#2{\underbrace{#1}_{#2}}
\def\und#1#2{\underbrace{#1}_{\textstyle #2}}
\def\subf#1{\underbrace{#1}_{}}
\def\p{\phantom{(}}

\def\cur{\operatorname{cur}}
\def\uncur{\operatorname{uncur}}
\def\app{\operatorname{app}}
\def\ren{\operatorname{ren}}

\def∧{\&}

\def\namedfunction#1#2#3#4#5{
  \begin{array}{rrcl}
    #1: & #2 & → & #3 \\
        & #4 & â†Ķ & #5 \\
  \end{array}
  }






%  ____                 _                _   _             _      
% |___ \    __   ____ _| |_   _  ___  __| | | | ___   __ _(_) ___ 
%   __) |___\ \ / / _` | | | | |/ _ \/ _` | | |/ _ \ / _` | |/ __|
%  / __/_____\ V / (_| | | |_| |  __/ (_| | | | (_) | (_| | | (__ 
% |_____|     \_/ \__,_|_|\__,_|\___|\__,_| |_|\___/ \__, |_|\___|
%                                                    |___/        
%
% «classical-logic» (to ".classical-logic")
% (lao162p 1 "classical-logic")

{\bf Classical logic}

\ssk

Idea:

0 means ``false''

1 means ``true''

\msk

Operations:

\ssk

$\begin{array}[t]{ccllll}
  P & Q & P∧Q   & PâˆĻQ   & P→Q   & P↔Q   \\ \hline
  0 & 0 & 0∧0=0 & 0âˆĻ0=0 & 0→0=1 & 0↔0=1 \\
  0 & 1 & 0∧1=0 & 0âˆĻ1=1 & 0→1=1 & 0↔1=0 \\
  1 & 0 & 1∧0=0 & 1âˆĻ0=1 & 1→0=0 & 1↔0=0 \\
  1 & 1 & 1∧1=1 & 1âˆĻ1=1 & 1→1=1 & 1↔1=1 \\
  \end{array}
  %
  \qquad
  %
  \begin{array}[t]{ll}
  P & ÂŽP \\ \hline
  0 & ÂŽ0=1 \\
  1 & ÂŽ1=0 \\
  \end{array}
$

\msk

We will use a more compact form.

\ssk

If $P=1$ and $Q=0$, then

$\und{\und P 1 → \und Q 0} 0$

So:

\msk

$\begin{array}[t]{ccccccc}
  P & Q & P∧Q & PâˆĻQ & P→Q & P↔Q \\ \hline
  0 & 0 &  0   &  0  &  1   &  1  \\
  0 & 1 &  0   &  1  &  1   &  0  \\
  1 & 0 &  0   &  1  &  0   &  0  \\
  1 & 1 &  1   &  1  &  1   &  1  \\
  \end{array}
  %
  \qquad
  %
  \begin{array}[t]{ccccccc}
  P & ÂŽP \\ \hline
  0 & 1 \\
  1 & 0 \\
  \end{array}
$

\msk

Constants:

$âŠĪ = 1$

$âŠĨ = 0$



\newpage

%  _____                 _                _   _             _      
% |___ /     __   ____ _| |_   _  ___  __| | | | ___   __ _(_) ___ 
%   |_ \ ____\ \ / / _` | | | | |/ _ \/ _` | | |/ _ \ / _` | |/ __|
%  ___) |_____\ V / (_| | | |_| |  __/ (_| | | | (_) | (_| | | (__ 
% |____/       \_/ \__,_|_|\__,_|\___|\__,_| |_|\___/ \__, |_|\___|
%                                                     |___/        
%
% «3-valued-logic» (to ".3-valued-logic")
% (lao162p 2 "3-valued-logic")

{\bf Our first non-classical logic}

\ssk

Idea:

00 means ``false''

11 means ``true''

01 is something intermediate between true and false

\msk

Operations:

\ssk

$\begin{array}[t]{ccccccc}
  P  & Q  & P∧Q & PâˆĻQ & P→Q & P↔Q \\ \hline
  00 & 00 &  00 &  00  &  11  &  11  \\
  00 & 01 &  00 &  01  &  11  &  00  \\
  00 & 11 &  00 &  11  &  11  &  00  \\
  01 & 00 &  00 &  01  &  00  &  00  \\
  01 & 01 &  01 &  01  &  11  &  11  \\
  01 & 11 &  01 &  11  &  11  &  01  \\
  11 & 00 &  00 &  11  &  00  &  00  \\
  11 & 01 &  01 &  11  &  01  &  01  \\
  11 & 11 &  11 &  11  &  11  &  11  \\
  \end{array}
  %
  \qquad
  %
  \begin{array}[t]{ccccccc}
  P  & ÂŽP \\ \hline
  00 & 11 \\
  01 & 00 \\
  11 & 00 \\
  \end{array}
$

\msk

Constants:

$âŠĪ = 11$

$âŠĨ = 00$




\newpage

%  _____           _        _             _           
% |_   _|_ _ _   _| |_ ___ | | ___   __ _(_) ___  ___ 
%   | |/ _` | | | | __/ _ \| |/ _ \ / _` | |/ _ \/ __|
%   | | (_| | |_| | || (_) | | (_) | (_| | |  __/\__ \
%   |_|\__,_|\__,_|\__\___/|_|\___/ \__, |_|\___||___/
%                                   |___/             
%
% «tautologies» (to ".tautologies")
% (lao162p 3 "tautologies")

{\bf Tautologies}

\ssk

We can calculate the result of $®®P→P$

when $P=0$ (left) and

when $P=1$ (right) with:

\msk

$\und {{\und {® {\und {® \und P 0} 1}} 0} → {\und P 0}} 1
 \qquad
 \und {{\und {® {\und {® \und P 1} 0}} 1} → {\und P 1}} 1
$

\bsk

The {\it subformulas} of $®®P→P$ are:

\msk

$\subf{\subf{® \subf{® \subf P}} → {\subf P}}$

\bsk

If we write the result of each subformula

under its central connective we get:

\msk

\def\f#1{\framebox{1}}
 
$\begin{array}{ccccc}
 ® & ® & P & → & P \\ \hline
   &   & 0 &    & 0 \\[-7pt]
   & 1 &   &    &   \\[-7pt]
 0 &   &   &    &   \\[-7pt]
   &   &   & \f{1} &   \\
 \end{array}
 \qquad
 \begin{array}{ccccc}
 ® & ® & P & → & P \\ \hline
   &   & 1 &    & 1 \\[-7pt]
   & 0 &   &    &   \\[-7pt]
 1 &   &   &    &   \\[-7pt]
   &   &   & \f{1} &   \\
 \end{array}
$

\msk

We can write all results in the same line...

We get something more compact but harder to read,

\msk

$\begin{array}{ccccc}
 ® & ® & P & → & P \\ \hline
 0 & 1 & 0 & \f1 & 0 \\
 \end{array}
 \qquad
 \begin{array}{ccccc}
 ® & ® & P & → & P \\ \hline
 1 & 0 & 1 & \f1 & 1 \\
 \end{array}
$


\bsk

We can put each case in a single line.

Here we also add a column at the left with the values of $P$.

\msk


$\begin{array}{ccccccc}
 P & & ® & ® & P & → & P \\ \hline
 % (®\p & (®\p & \p\p P)) & → & P \\ \hline
 0 & & 0 & 1 & 0 & \f1 & 0 \\
 0 & & 1 & 0 & 1 & \f1 & 1 \\
 \end{array}
$





\newpage


%     _                _     _           _       
%    / \   ___    ___ | |__ (_) ___  ___| |_ ___ 
%   / _ \ / __|  / _ \| '_ \| |/ _ \/ __| __/ __|
%  / ___ \\__ \ | (_) | |_) | |  __/ (__| |_\__ \
% /_/   \_\___/  \___/|_.__// |\___|\___|\__|___/
%                         |__/                   
%
% «logics-as-objects» (to ".logics-as-objects")
% (lao162p 4 "logics-as-objects")

\def\p#1{\phantom{#1}}
\def\L{\mathsf{L}}
\def\CL{\mathsf{CL}}
\def\TL{\mathsf{L}_3}
\def\ul{_{\L}}
\def\ucl{_{\CL}}
\def\utl{_{\TL}}

\def\fo #1 #2 #3 {((#1,#2),#3)}
\def\ba #1 #2 #3 #4 {
  \foo 0 0 #1 , \\
  \foo 0 1 #2 , \\
  \foo 1 0 #3 , \\
  \foo 1 1 #4 \p, \\
}
\def\foc#1 #2 {(#1,#2)}
\def\co #1 #2 {
  \fooc 0 #1 ,\\
  \fooc 1 #2 \p,\\
}
\def\com {0,\\ 1\p,\\}
\def\cand{\ba 0 0 0 1 }
\def\cor {\ba 0 1 1 1 }
\def\cimp{\ba 1 1 0 1 }
\def\ciff{\ba 1 0 0 1 }
\def\cnot{\co 1 0 }

\def\foo#1 #2 #3 {((#1,#2),#3)}
\def\bar#1 #2 #3 #4 #5 #6 #7 #8 #9 {
  \foo 00 00 #1 , \\
  \foo 00 01 #2 , \\
  \foo 00 11 #3 ,   \\
  \foo 01 00 #4 , \\
  \foo 01 01 #5 , \\
  \foo 01 11 #6 ,   \\
  \foo 11 00 #7 , \\
  \foo 11 01 #8 , \\
  \foo 11 11 #9 \p, \\
}
\def\fooc #1 #2 {(#1,#2)}
\def\col#1 #2 #3 {
  \fooc 00 #1 ,\\
  \fooc 01 #2 ,\\
  \fooc 11 #3 \p,\\
}
\def\tom {00,\\ 01,\\ 11\p,\\}
\def\tand{\bar 00 00 00  00 01 01  00 01 11 }
\def\tor {\bar 00 01 11  01 01 11  11 11 11 }
\def\timp{\bar 11 11 11  00 11 11  00 01 11 }
\def\tiff{\bar 11 00 00  00 11 01  00 01 11 }
\def\tnot{\col 11 00 00 }



{\bf Logics as mathematical objects}

\msk

{\sl First definition.} A logic $\L$ is an 8-uple:
%
$$\begin{array}{rcl}
    \L & = & (ÎĐ,   âŠĪ,   âŠĨ,   ∧,   âˆĻ,   →,   ↔,   ÂŽ) \\
       & = & (ÎĐ\ul,âŠĪ\ul,âŠĨ\ul,∧\ul,âˆĻ\ul,→\ul,↔\ul,ÂŽ\ul) \\
  \end{array}
$$
\bsk

We saw two logics in the previous pages --

Classical Logic, $\CL$, and a three-valued logic, $\TL$:

\msk

$\CL = (ÎĐ\ucl, âŠĪ\ucl, âŠĨ\ucl, ∧\ucl, âˆĻ\ucl, →\ucl, ↔\ucl, ÂŽ\ucl) =$

$\psm{\csm{\com}, 1, 0, \csm{\cand}, \csm{\cor}, \csm{\cimp}, \csm{\ciff}, \csm{\cnot}}$

\msk

$\TL = (ÎĐ\utl, âŠĪ\utl, âŠĨ\utl, ∧\utl, âˆĻ\utl, →\utl, ↔\utl, ÂŽ\utl) =$

$\psm{\csm{\tom}, 11, 00, \csm{\tand}, \csm{\tor}, \csm{\timp}, \csm{\tiff}, \csm{\tnot}}$


\bsk

{\sl Second definition.} A logic $\L$ is {\sl given by} a 6-uple:
%
$$(ÎĐ\ul,âŠĪ\ul,âŠĨ\ul,∧\ul,âˆĻ\ul,→\ul)$$

where the missing fields, $↔\ul$ and $®\ul$, are defined from the other ones:
%
$$\begin{array}{rcl}
    P↔\ul Q & := & (P→\ul Q) ∧\ul (Q→\ul P) \\
      ÂŽ\ul P & := & P→\ul âŠĨ\ul \\
  \\
       ↔\ul & := & λP,Q:ÎĐ\ul. ((P→\ul Q) ∧\ul (Q→\ul P)) \\
       ÂŽ\ul & := & λP:ÎĐ\ul. (P→\ul âŠĨ\ul) \\
  \end{array}
$$


\bsk

We will see other definitions of a ``logic'' soon --

in them $ÎĐ\ul$ is the set of points of a partial order $(ÎĐ, â‰Ī)$,

and in {\sl most} of them the constants `$âŠĪ$', `$âŠĨ$'

and the operations `$∧$', `$âˆĻ$' and `$→$' (and `$↔$' and `$ÂŽ$')

are induced by the order...

\newpage




%  ______   _    _      _             _      
% |__  / | | |  / \    | | ___   __ _(_) ___ 
%   / /| |_| | / _ \   | |/ _ \ / _` | |/ __|
%  / /_|  _  |/ ___ \  | | (_) | (_| | | (__ 
% /____|_| |_/_/   \_\ |_|\___/ \__, |_|\___|
%                               |___/        
%
% «ZHA-logic» (to ".ZHA-logic")
% (lao162p 5 "ZHA-logic")
% (find-planarhas 0)
% (find-planarhaspage 2 "One page intro (to the main theorem)")
% (find-planarhastext 2 "One page intro (to the main theorem)")
% (find-planarhas "one-page-intro")

{\bf Logics from partial orders}

\ssk

%R f = function (spec, def)
%R     local opts = {def=def, scale="12pt", meta="s"}
%R     local mp = mpnew(opts, spec):addlrs():addarrows("w"):output()
%R   end
%R f("1",             "zhaone")
%R f("1R",            "zhatwo")
%R f("1RL",           "zhatree")
%R f("12321L",        "zhaohouse")
%R f("12LRLRLR1",     "zhasquig")
%R f("123LLRR21",     "zhabigguill")
%R f("1234567654321", "zharect")
%R f("123RRR45R4321", "zharectcut")
%R f("123RRR43212R1", "zharectcutcut")
%R f("1234321",       "zhasixteen")
\pu

Each one of the 6 partial orders below ``is'' a logic,
%
{
%
$$\zhaone
  \quad \zhatwo
  \quad \zhatree
  \quad \zhaohouse
  \quad \zhasquig
  \quad \zhabigguill
$$
%
% $$\zharect
%   \zharectcut
%   \zharectcutcut
% $$
}

with these definitions for the constants and operations:
%
\def∧{\mathbin{\&}}
%
$$\def\o#1{\mathop{\mathsf{#1}}}
  \def\o#1{\mathbin{\mathsf{#1}}}
  \def\a#1#2{\ang{#1,#2}}
  \def\ab{\a ab}
  \def\cd{\a cd}
  \begin{array}{rcl}
  %
  \ab â‰Ī \cd &:=& aâ‰Īc∧bâ‰Īd \\
  \ab â‰Ĩ \cd &:=& aâ‰Ĩc∧bâ‰Ĩd \\[5pt]
  %
  \ab \o{above} \cd &:=& aâ‰Ĩc∧bâ‰Ĩd \\
  \ab \o{below} \cd &:=& aâ‰Īc∧bâ‰Īd \\
  \ab \o{leftof} \cd &:=& aâ‰Ĩc∧bâ‰Īd \\
  \ab \o{rightof} \cd &:=& aâ‰Īc∧bâ‰Ĩd \\[5pt]
  %
  \o{valid}(\ab) &:=& \ab∈ÎĐ\ul \\
  \o{ne}(\ab) &:=& \o{if}   \o{valid}(\a a{b+1})
                   \o{then} \o{ne}(\a a{b+1})
                   \o{else} \ab \;
                   \o{end} \\
  \o{nw}(\ab) &:=& \o{if}   \o{valid}(\a {a+1}b)
                   \o{then} \o{nw}(\a {a+1}b)
                   \o{else} \ab \;
                   \o{end} \\[5pt]
  %
  \ab ∧ \cd &:=& \a{\o{min}(a,c)}{\o{min}(b,d)} \\
  \ab âˆĻ \cd &:=& \a{\o{max}(a,c)}{\o{max}(b,d)} \\[5pt]
  %
  \ab \to \cd &:=& \begin{array}[t]{llll}
               \o{if}     & \ab \o{below} \cd   & \o{then} & âŠĪ           \\
               \o{elseif} & \ab \o{leftof} \cd  & \o{then} & \o{ne}(\ab∧\cd) \\
               \o{elseif} & \ab \o{rightof} \cd & \o{then} & \o{nw}(\ab∧\cd) \\
               \o{elseif} & \ab \o{above} \cd   & \o{then} & \cd            \\
               \o{end}
               \end{array} \\[5pt]
  %
  âŠĪ   &:=& \o{sup}(ÎĐ) \\
  âŠĨ   &:=& \a00 \\
  ÂŽ\ab &:=& \ab→âŠĨ \\
  \ab↔\cd &:=& (\ab→\cd)∧ (\cd→\ab)\\
  \end{array}
$$

Exercise: calculate / represent graphically:

{
\def\o#1{\mathbin{\mathsf{#1}}}
\def\a#1#2{\ang{#1,#2}}
\def\ab{\a ab}
\def\cd{\a cd}

a) $λ\ab:ÎĐ_{10}.\, \abâ‰Ī\a11$

b) $λ\ab:ÎĐ_{10}.\, \abâ‰Ī\a12$

c) $λ\ab:ÎĐ_{10}.\, \abâ‰Ĩ\a11$

d) $λ\ab:ÎĐ_{10}.\, \ab \o{leftof} \a11$

e) $λ\ab:ÎĐ_{10}.\, \ab \o{rightof} \a11$

f) $λ\ab:ÎĐ_{10}.\, \ab \o{above} \a11$

g) $λ\ab:ÎĐ_{10}.\, \ab \o{below} \a11$

}

\newpage



%   ____                            _   _                
%  / ___|___  _ __  _ __   ___  ___| |_(_)_   _____  ___ 
% | |   / _ \| '_ \| '_ \ / _ \/ __| __| \ \ / / _ \/ __|
% | |__| (_) | | | | | | |  __/ (__| |_| |\ V /  __/\__ \
%  \____\___/|_| |_|_| |_|\___|\___|\__|_| \_/ \___||___/
%                                                        
% «connectives» (to ".connectives")
% (lao162p 6 "connectives")

\def\LT{\mathsf{L}_{10}}
\def\LS{\mathsf{L}_{16}}
\def\ult{_{\LT}}
\def\uls{_{\LS}}

{\bf Logics from partial orders, 2: connectives}

\ssk


$$ÎĐ\ult=\zhaohouse
  \quad
  ÎĐ\uls=\zhasixteen
$$

$$\def\o#1{\mathop{\mathsf{#1}}}
  \def\o#1{\mathbin{\mathsf{#1}}}
  \def\a#1#2{\ang{#1,#2}}
  \def\ab{\a ab}
  \def\cd{\a cd}
  \begin{array}{rcl}
  %
  % \ab â‰Ī \cd &:=& aâ‰Īc∧bâ‰Īd \\
  % \ab â‰Ĩ \cd &:=& aâ‰Ĩc∧bâ‰Ĩd \\[5pt]
  %
  % \ab \o{above} \cd &:=& aâ‰Ĩc∧bâ‰Ĩd \\
  % \ab \o{below} \cd &:=& aâ‰Īc∧bâ‰Īd \\
  % \ab \o{leftof} \cd &:=& aâ‰Ĩc∧bâ‰Īd \\
  % \ab \o{rightof} \cd &:=& aâ‰Īc∧bâ‰Ĩd \\[5pt]
  %
  \o{valid}(\ab) &:=& \ab∈ÎĐ\ul \\
  \o{ne}(\ab) &:=& \o{if}   \o{valid}(\a a{b+1})
                   \o{then} \o{ne}(\a a{b+1})
                   \o{else} \ab \;
                   \o{end} \\
  \o{nw}(\ab) &:=& \o{if}   \o{valid}(\a {a+1}b)
                   \o{then} \o{nw}(\a {a+1}b)
                   \o{else} \ab \;
                   \o{end} \\[5pt]
  %
  \ab ∧ \cd &:=& \a{\o{min}(a,c)}{\o{min}(b,d)} \\
  \ab âˆĻ \cd &:=& \a{\o{max}(a,c)}{\o{max}(b,d)} \\[5pt]
  %
  \ab → \cd &:=& \begin{array}[t]{llll}
               \o{if}     & \ab \o{below} \cd   & \o{then} & âŠĪ           \\
               \o{elseif} & \ab \o{leftof} \cd  & \o{then} & \o{ne}(\ab∧\cd) \\
               \o{elseif} & \ab \o{rightof} \cd & \o{then} & \o{nw}(\ab∧\cd) \\
               \o{elseif} & \ab \o{above} \cd   & \o{then} & \cd            \\
               \o{end}
               \end{array} \\
  %
  âŠĪ   &:=& \o{sup}(ÎĐ) \\
  âŠĨ   &:=& \a00 \\
  ÂŽ\ab &:=& \ab→âŠĨ \\
  \ab↔\cd &:=& (\ab→\cd)∧ (\cd→\ab)\\
  \end{array}
$$

Exercise: calculate / represent graphically:

{
\def\o#1{\mathbin{\mathsf{#1}}}
\def\a#1#2{\ang{#1,#2}}
\def\ab{\a ab}
\def\cd{\a cd}

\begin{tabular}{rl}
   h) & $λ\ab:ÎĐ\ult.\, \o{ne}(\ab)$ \\
   i) & $λ\ab:ÎĐ\ult.\, \o{nw}(\ab)$ \\
   j) & $10 ∧\ult 11$, \; $10 âˆĻ\ult 11$, \; $20 →\ult 11$ \\
  j') & $02 ∧\ult 11$, \; $02 âˆĻ\ult 11$, \; $02 →\ult 11$ \\
 j'') & $10 ∧\uls 11$, \; $10 âˆĻ\uls 11$, \; $20 →\uls 11$ \\
   l) & $λP:ÎĐ\uls.\, P→11$ \\
  l') & $λQ:ÎĐ\uls.\, 22→Q$ \\
 l'') & $λP:ÎĐ\uls.\, P↔12$ \\
   m) & $λP:ÎĐ\uls.\, ÂŽP$ \\
   n) & $λP:ÎĐ\uls.\, ÂŽÂŽP$ \\
   o) & $λP:ÎĐ\uls.\, (Pâ‰Ī21)∧(Pâ‰Ī12)$ \\
  o') & $λP:ÎĐ\uls.\, Pâ‰Ī(21∧12)$ \\
 o'') & $λP:ÎĐ\uls.\, (Pâ‰Ī(21∧12))↔((Pâ‰Ī21)∧(Pâ‰Ī12))$ \\
   p) & $λP:ÎĐ\uls.\, (21â‰ĪP)∧(12â‰ĪP)$ \\
  p') & $λP:ÎĐ\uls.\, (21âˆĻ12)â‰ĪP$ \\
 p'') & $λP:ÎĐ\uls.\, ((21âˆĻ12)â‰ĪP)↔((21â‰ĪP)∧(12â‰ĪP))$ \\
   q) & $λP:ÎĐ\uls.\, P∧21$ \\
  q') & $λP:ÎĐ\uls.\, (P∧21)â‰Ī12$ \\
 q'') & $λP:ÎĐ\uls.\, Pâ‰Ī(21→12)$ \\
q''') & $λP:ÎĐ\uls.\, (Pâ‰Ī(21→12))↔((P∧21)â‰Ī12)$
\end{tabular}


}


\newpage


%   ____      _   _       _ _                   _       __     
%  / ___|    | | | |   __| (_) __ _  __ _    __| | ___ / _|___ 
% | |   _____| |_| |  / _` | |/ _` |/ _` |  / _` |/ _ \ |_/ __|
% | |__|_____|  _  | | (_| | | (_| | (_| | | (_| |  __/  _\__ \
%  \____|    |_| |_|  \__,_|_|\__,_|\__, |  \__,_|\___|_| |___/
%                                   |___/                      
%
% «C-H-diagram-defs» (to ".C-H-diagram-defs")
% (lao162p 7 "C-H-diagram-defs")

%: HA rules:
%:  
%:                          P∧Qâ‰ĪR 
%:        -----π   -----π'  -----â™Ŋ
%:        Q∧Râ‰ĪQ    Q∧Râ‰ĪR    Pâ‰ĪQ{→}R 
%:                                
%:        ^P-pi    ^P-pi'   ^P-sharp
%:                                
%:        Pâ‰ĪQ  Pâ‰ĪR          Pâ‰ĪQ{→}R 
%:  ---!  --------\ang{,}   -----♭  
%:  Pâ‰ĪâŠĪ     Pâ‰ĪQ∧R           P∧Qâ‰ĪR 
%:  
%:  ^P-T    ^P-ang          ^P-flat
%:  
%:                   
%:        -----Îđ   -----Îđ'
%:        Pâ‰ĪPâˆĻQ    Qâ‰ĪPâˆĻQ
%:  
%:        ^P-iota  ^P-iota'
%:  
%:        Pâ‰ĪR  Qâ‰ĪR
%:  ---ÂĄ  --------[,]
%:  âŠĨâ‰ĪP    PâˆĻQâ‰ĪR
%:  
%:  ^P-F   ^P-[,]
%:

%: CCC rules:
%:                                   f:A×B→C 
%:           -------π   --------π'   -----------â™Ŋ
%:           π:B×C→B    π':B×C→C     f^â™Ŋ:A→B{→}C 
%:                                
%:           ^F-pi      ^F-pi'       ^F-sharp                     
%:                                
%:            f:A→B  g:A→C           g:A→B{→}C 
%:  ------¡  ---------------\ang{,}  ---------♭
%:  !:A→1    \ang{f,g}:A→B×C         g^♭:A×B→C 
%:  
%:  ^F-T     ^F-ang                  ^F-flat
%:                                 
%:           -------Îđ  --------Îđ' 
%:           Îđ:A→A+B   Îđ':B→A+B   
%:                                 
%:           ^F-iota   ^F-iota'
%:                                 
%:            f:A→C  g:B→C         
%:  ------ÂĄ  ---------------[,]
%:  ¡:0→A    [f,g]:A+B→C      
%:  
%:  ^F-F     ^F-[,]
%:  

\pu

\def\BiHArules{{
\def\PT {\ded{P-T}}
\def\PPA{\ded{P-pi}}
\def\PPB{\ded{P-pi'}}
\def\PPC{\ded{P-ang}}
\def\PEA{\ded{P-sharp}}
\def\PEB{\ded{P-flat}}
\def\PF {\ded{P-F}}
\def\PCA{\ded{P-iota}}
\def\PCB{\ded{P-iota'}}
\def\PCC{\ded{P-[,]}}
\mat{     & \PPA \qquad \PPB & \PEA \\\\
      \PT &       \PPC       & \PEB \\\\
          & \PCA \qquad \PCB &      \\\\
      \PF &       \PCC       &
}
}}

\def\BiCCCrules{{
\def\PT {\ded{F-T}}
\def\PPA{\ded{F-pi}}
\def\PPB{\ded{F-pi'}}
\def\PPC{\ded{F-ang}}
\def\PEA{\ded{F-sharp}}
\def\PEB{\ded{F-flat}}
\def\PF {\ded{F-F}}
\def\PCA{\ded{F-iota}}
\def\PCB{\ded{F-iota'}}
\def\PCC{\ded{F-[,]}}
\mat{     & \PPA \qquad \PPB & \PEA \\\\
      \PT &       \PPC       & \PEB \\\\
          & \PCA \qquad \PCB &      \\\\
      \PF &       \PCC       &
}
}}


% (find-dn4 "dednat4.lua" "lplacement")
%L forths[".PLABEL="] = function ()
%L     ds[1].lplacement = getword()
%L     ds[1].label = getword()
%L   end


%D diagram BiHAdiag
%D 2Dx     100  +15   +25    +25  +15     +25
%D 2D  100 T1   PB <- PBC -> PC   EC |--> EB->C 
%D 2D	   ^       ^   ^   ^      ^       ^     
%D 2D	   |        \  |  /       |       |     
%D 2D  +25 TA         PA         EAxB <-| EA    
%D 2D	                                        
%D 2D  +15 IA         CC			       
%D 2D	   ^        ^  ^  ^		       
%D 2D	   |       /   |   \		       
%D 2D  +25 I0   CA -> CAB <- CB                 
%D 2D
%D (( T1 .tex= âŠĪ TA .tex= P				       
%D    @ 0 @ 1 <-					       
%D ))
%D (( PB .tex= Q PBC .tex= Q∧R PC .tex= R PA .tex= P       
%D    @ 0 @ 1 <- @ 1 @ 2 ->				       
%D    @ 0 @ 3 <- @ 1 @ 3 <- @ 2 @ 3 <-			       
%D ))
%D (( EC .tex= R EB->C .tex= Q{→}R EAxB .tex= P∧Q EA .tex= P 
%D    @ 0 @ 1 |->					       
%D    @ 0 @ 2 <-  @ 1 @ 3 <-			       
%D    @ 2 @ 3 <-|					       
%D ))
%D (( IA .tex= P I0 .tex= âŠĨ				       
%D    @ 0 @ 1 <-					       
%D ))
%D (( CC .tex= R CA .tex= P CAB .tex= PâˆĻQ CB .tex= Q       
%D    @ 0 @ 1 <- @ 0 @ 2 <- @ 0 @ 3 <-			       
%D    @ 1 @ 2 -> @ 2 @ 3 <-                                  
%D ))
%D enddiagram
%D

%D diagram BiCCCdiag
%D 2Dx     100  +15   +25    +25  +15     +25
%D 2D  100 T1   PB <- PBC -> PC   EC |--> EB->C 
%D 2D	   ^       ^   ^   ^      ^       ^     
%D 2D	   |        \  |  /       |       |     
%D 2D  +25 TA         PA         EAxB <-| EA    
%D 2D	                                        
%D 2D  +15 IA         CC			       
%D 2D	   ^        ^  ^  ^		       
%D 2D	   |       /   |   \		       
%D 2D  +25 I0   CA -> CAB <- CB                 
%D 2D
%D (( T1 .tex= 1 TA .tex= A				       
%D    @ 0 @ 1 <- .plabel= l !				       
%D ))
%D (( PB .tex= B PBC   .tex= B{×}C   PC   .tex= C   PA .tex= A       
%D    @ 0 @ 1 <- .plabel= a π  @ 1 @ 2 -> .plabel= a π'
%D    @ 0 @ 3 <- .plabel= l f  @ 2 @ 3 <- .plabel= r g
%D    @ 1 @ 3 <- .plabel= m \ang{f,g}
%D ))
%D (( EC .tex= C EB->C .tex= B{→}C EAxB .tex= A{×}B EA .tex= A 
%D    @ 0 @ 1 |-> .plabel= a (B{→})
%D    @ 0 @ 2 <-  .plabel= l \sm{f\\g^♭} 
%D    @ 1 @ 3 <-  .plabel= r \sm{f^â™Ŋ\\g} 
%D    @ 2 @ 3 <-| .plabel= r (×B) 
%D    @ 0 @ 3 harrownodes nil 20 nil |-> sl^
%D    @ 0 @ 3 harrownodes nil 20 nil <-| sl_
%D #  @ 0 @ 2 <-  .PLABEL= _(0.43) g^\flat
%D #  @ 0 @ 2 <-  .PLABEL= _(0.57) f
%D #  @ 1 @ 3 <-  .PLABEL= ^(0.43) g
%D #  @ 1 @ 3 <-  .PLABEL= ^(0.57) f^\sharp
%D ))
%D (( IA .tex= A I0 .tex= 0				       
%D    @ 0 @ 1 <- .plabel= l ÂĄ					       
%D ))
%D (( CC .tex= C CA .tex= A CAB .tex= A{+}B CB .tex= B       
%D    @ 0 @ 1 <- .plabel= l f @ 0 @ 3 <- .plabel= r g
%D    @ 0 @ 2 <- .plabel= m [f,g]
%D    @ 1 @ 2 -> .plabel= b Îđ @ 2 @ 3 <-  .plabel= b Îđ'
%D ))
%D enddiagram
%D

\pu

\def\BiHAeqs{
\begin{array}{rl}
(id)   & ∀P.(Pâ‰ĪP)                    \\
(comp) & ∀P,Q,R.(Pâ‰ĪQ)∧(Qâ‰ĪR)→(Pâ‰ĪR)    \\
                                     \\
(âŠĪ)    & ∀P.(Pâ‰ĪâŠĪ)                    \\
(âŠĨ)    & ∀P.(âŠĨâ‰ĪP)                    \\
(∧)    & ∀P,Q,R.(Pâ‰ĪQ∧R)↔(Pâ‰ĪQ)∧(Pâ‰ĪR)  \\
(âˆĻ)    & ∀P,Q,R.(PâˆĻQâ‰ĪR)↔(Pâ‰ĪR)∧(Qâ‰ĪR)  \\
(→)    & ∀P,Q,R.(Pâ‰ĪQ→R)↔(P∧Qâ‰ĪR)      \\
                                     \\
(ÂŽ)    & ÂŽP := P→âŠĨ                   \\
(↔)    & P↔Q := (P→Q)∧(Q→P)          \\
\end{array}
}

\def\BiCCCeqs{
\begin{array}{rl}
(id)   & \id_A ∈ \Hom(A,A)                  \\
(comp) & (;)_{A,B,C}: \Hom(A,B)×\Hom(B,C)→\Hom(A,C) \\
                                     \\
(âŠĪ)    & ∀A.(\Hom(A,1)≃1)            \\
(âŠĨ)    & ∀A.(\Hom(0,A)≃1)            \\
(∧)    & ∀A,B,C.(\Hom(A,B×C)≃\Hom(A,B)×\Hom(A,C)) \\
(âˆĻ)    & ∀A,B,C.(\Hom(A+B,C)≃\Hom(A,C)×\Hom(B,C)) \\
(→)    & ∀A,B,C.(\Hom(A,C^B)≃\Hom(A×B,C)      \\
\end{array}
}


% (find-854file "" "fdiagest")
% (find-854file "" "%D diagram yoneda-and-friends")
% (find-dn4 "experimental.lua" "BOX")
\def\ctabular#1{\begin{tabular}{c}#1\end{tabular}}
\def\ltabular#1{\begin{tabular}{c}#1\end{tabular}}
% \def\fdiagwithboxest#1#2{\ltabular{#2 \\ \fdiagwithboxes{#1}}}
\def\fdiagest#1#2{\ltabular{#2 \\ \fdiag{#1}}}

\savebox{\myboxa}{$\diag{BiHAdiag}$}   \def\BiHAdiag {\usebox{\myboxa}}
\savebox{\myboxb}{$\diag{BiCCCdiag}$}  \def\BiCCCdiag{\usebox{\myboxb}}

% (find-es "tex" "savebox")

%   ____      _   _       _ _                                 
%  / ___|    | | | |   __| (_) __ _  __ _ _ __ __ _ _ __ ___  
% | |   _____| |_| |  / _` | |/ _` |/ _` | '__/ _` | '_ ` _ \ 
% | |__|_____|  _  | | (_| | | (_| | (_| | | | (_| | | | | | |
%  \____|    |_| |_|  \__,_|_|\__,_|\__, |_|  \__,_|_| |_| |_|
%                                   |___/                     
%
% «C-H-diagram» (to ".C-H-diagram")
% (lao162p 7 "C-H-diagram")

{\setlength{\parindent}{0em}

{\bf Curry Howard as a big diagram}

\ssk

The diagram below shows the connection between logic and $λ$-calculus.

We are now ready to understand the rules $(∧)$, $(âˆĻ)$, $(→)$ in the top left box.

\bsk

\noindent\hbox to \textwidth{\hss
\resizebox{1.5\textwidth}{!}{
$\begin{array}{rcl}
    \fbox{$\BiHAeqs$}    && \fbox{$\BiCCCeqs$}  \\\\
    \fbox{$\BiHArules$}  && \fbox{$\BiCCCrules$} \\\\
    \fbox{\BiHAdiag}     && \fbox{\BiCCCdiag}   \\
  \end{array}
$%
}%
\hss}

}

\newpage



%  ____            _               _ 
% |  _ \  ___ _ __(_)_   _____  __| |
% | | | |/ _ \ '__| \ \ / / _ \/ _` |
% | |_| |  __/ |  | |\ V /  __/ (_| |
% |____/ \___|_|  |_| \_/ \___|\__,_|
%                                    
% «derived-rules» (to ".derived-rules")
% (lao162p 8 "derived-rules")

{\bf Some derived rules}

\def\flip{\mathsf{flip}}
\def\MP{\mathsf{MP}}

%:
%:                      ------         ----      
%:                      A∧Câ‰ĪA  Aâ‰ĪB   A∧Câ‰ĪC  Câ‰ĪD    
%:                      ------------   ------------
%:  Aâ‰ĪB  Câ‰ĪD              A∧Câ‰ĪB         A∧Câ‰ĪD      
%:  ---------(∧)   :=     ---------------------    
%:  A∧Câ‰ĪB∧D                     A∧Câ‰ĪB∧D            
%:
%:   ^xandL                        ^xandR
%:  
%:                      ------         ----      
%:                      AâˆĻCâ‰ĨA  Aâ‰ĨB   AâˆĻCâ‰ĨC  Câ‰ĨD    
%:                      ------------   ------------
%:  Aâ‰ĨB  Câ‰ĨD              AâˆĻCâ‰ĨB         AâˆĻCâ‰ĨD      
%:  ---------(âˆĻ)   :=     ---------------------    
%:  AâˆĻCâ‰ĨBâˆĻD                     AâˆĻCâ‰ĨBâˆĻD            
%:
%:   ^xorL                        ^xorR
%:  
%:                            ------    ------
%:                            A∧Bâ‰ĪB    A∧Bâ‰ĪA
%:  ---------\flip_{∧}  :=    ----------------
%:  A∧Bâ‰ĪB∧A                     A∧Bâ‰ĪB∧A
%:
%:   ^flipandL                    ^flipandR
%:                                              ---------
%:                                              Q→Râ‰ĪQ→R 
%:                       ------------------   --------------
%:                       Q∧(Q→R)â‰Ī(Q→R)∧Q    (Q→R)∧Qâ‰ĪR
%:  -----------\MP_0 :=  -------------------------------
%:  Q∧(Q→R)â‰ĪR                   Q∧(Q→R)â‰ĪR
%:
%:    ^MP0L                         ^MP0R
%:
%:                          Pâ‰ĪQ  Pâ‰ĪQ→R
%:                          ------------    ----------\MP_0
%:  Pâ‰ĪQ  Pâ‰ĪQ→R             Pâ‰ĪQ∧(Q→R)    Q∧(Q→R)â‰ĪR
%:  ------------\MP  :=     --------------------------
%:      Pâ‰ĪR                         Pâ‰ĪR
%:
%:      ^MPL                         ^MPR
%:
%:
%:                    ------------
%:                    A∧(A→âŠĨ)â‰ĪâŠĨ
%:  ------(ÂŽÂŽ)  :=    --------------
%:  Aâ‰ĪÂŽÂŽA             Aâ‰Ī(A→âŠĨ)→âŠĨ
%:
%:
$$\pu
  \begin{array}{rcl}
  \ded{xandL}    &:=& \ded{xandR}    \\{}\\
  \ded{xorL}     &:=& \ded{xorR}     \\\\
  \ded{flipandL} &:=& \ded{flipandR} \\\\
  \ded{MP0L}     &:=& \ded{MP0R}     \\\\
  \ded{MPL}      &:=& \ded{MPR}      \\\\
  \end{array}
$$

Exercises:

a) Name all the rules used in the right column above.

b) Visualize $(∧)$ in $\L_{5×5}$ with $A=31$, $B=42$, $C=13$, $D=24$.

c) Visualize $(âˆĻ)$ in $\L_{5×5}$ with $A=42$, $B=31$, $C=24$, $D=13$.

d) Visualize $\MP_0$ in $\L_{3×3}$ with $Q=21$, $R=12$.

e) Visualize $\MP$ in $\L_{3×3}$ with $Q=21$, $R=12$, $P=01$.

f) Visualize $(ÂŽÂŽ)$ in $\LT$ with $A=10$.




\end{document}

% Local Variables:
% coding: utf-8-unix
% ee-anchor-format:     "«%s»"
% End: