Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
% (find-LATEX "2025bad-foundations.tex")
% (defun c () (interactive) (find-LATEXsh "lualatex -record 2025bad-foundations.tex" :end))
% (defun C () (interactive) (find-LATEXsh "lualatex 2025bad-foundations.tex" "Success!!!"))
% (defun D () (interactive) (find-pdf-page      "~/LATEX/2025bad-foundations.pdf"))
% (defun d () (interactive) (find-pdftools-page "~/LATEX/2025bad-foundations.pdf"))
% (defun e () (interactive) (find-LATEX "2025bad-foundations.tex"))
% (defun o () (interactive) (find-LATEX "2022on-the-missing.tex"))
% (defun u () (interactive) (find-latex-upload-links "2025bad-foundations"))
% (defun v () (interactive) (find-2a '(e) '(d)))
% (defun b () (interactive) (find-LATEX "education.bib"))
% (defun d0 () (interactive) (find-ebuffer "2025bad-foundations.pdf"))
% (defun cv () (interactive) (C) (ee-kill-this-buffer) (v) (g))
% (defun oe () (interactive) (find-2a '(o) '(e)))
%          (code-eec-LATEX "2025bad-foundations")
% (find-pdf-page   "~/LATEX/2025bad-foundations.pdf")
% (find-sh0 "cp -v  ~/LATEX/2025bad-foundations.pdf /tmp/")
% (find-sh0 "cp -v  ~/LATEX/2025bad-foundations.pdf /tmp/pen/")
%     (find-xournalpp "/tmp/2025bad-foundations.pdf")
%   file:///home/edrx/LATEX/2025bad-foundations.pdf
%               file:///tmp/2025bad-foundations.pdf
%           file:///tmp/pen/2025bad-foundations.pdf
%  http://anggtwu.net/LATEX/2025bad-foundations.pdf
% (find-LATEX "2019.mk")
% (find-Deps1-links "Caepro5 Piecewise2 Maxima2")
% (find-Deps1-cps   "Caepro5 Piecewise2 Maxima2 PictureDots1")
% (find-Deps1-cps   "Caepro5 Piecewise2 Maxima3 PictureDots1 Pygments1")
% (find-Deps1-anggs "Caepro5 Piecewise2 Maxima2")
% (find-MM-aula-links "2025bad-foundations" "2" "baf" "baf")

% «.defs»			(to "defs")
% «.defs-T-and-B»		(to "defs-T-and-B")
% «.defs-caepro»		(to "defs-caepro")
% «.defs-pict2e»		(to "defs-pict2e")
% «.defs-maxima»		(to "defs-maxima")
% «.defs-V»			(to "defs-V")
% «.defs-Verbatim»		(to "defs-Verbatim")
% «.defs-comprehensions»	(to "defs-comprehensions")
% «.defs-co»			(to "defs-co")
% «.defs-S»			(to "defs-S")
% «.defs-picturedots»		(to "defs-picturedots")
% «.defs-processsubfile»	(to "defs-processsubfile")
% «.defs-pygvbt»		(to "defs-pygvbt")
% «.defs-T1-T2-T3-T4»		(to "defs-T1-T2-T3-T4")
%
% «.title»		(to "title")
% «.abstract»		(to "abstract")
% «.dedic»		(to "dedic")
%
% «.bad-explanations»		(to "bad-explanations")
% «.degrees»			(to "degrees")
% «.items»			(to "items")
% «.aha-moment»			(to "aha-moment")
% «.lean»			(to "lean")
% «.qparts»			(to "qparts")
% «.lazy-nouns»			(to "lazy-nouns")
% «.lazy-sum»			(to "lazy-sum")
% «.trial-and-improve»		(to "trial-and-improve")
% «.flipped»			(to "flipped")
% «.pattern-matching»		(to "pattern-matching")
% «.chain-rule-links»		(to "chain-rule-links")
% «.chain-rule»			(to "chain-rule")
% «.expandable-links»		(to "expandable-links")
% «.expandable»			(to "expandable")
% «.comprehensions-links»	(to "comprehensions-links")
% «.comprehensions»		(to "comprehensions")
%   «.comprehensions-exercs»	(to "comprehensions-exercs")
%   «.comprehensions-answers»	(to "comprehensions-answers")
%   «.what-is-a-proposition»	(to "what-is-a-proposition")
%   «.solving-equations»	(to "solving-equations")
%   «.functions-of-xy»		(to "functions-of-xy")
%   «.a-game»			(to "a-game")
% «.comprehensions-game»	(to "comprehensions-game")
% «.comprehensions-gab»		(to "comprehensions-gab")
% «.expressions-as-trees»	(to "expressions-as-trees")
% «.proofs-with-justifications»	(to "proofs-with-justifications")
%
% «.references»			(to "references")
% «.make-with-bib»		(to "make-with-bib")


% ;-- headers

\documentclass[oneside,12pt]{article}
\usepackage[colorlinks,citecolor=DarkRed,urlcolor=DarkRed]{hyperref} % (find-es "tex" "hyperref")
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pict2e}
\usepackage[x11names,svgnames]{xcolor} % (find-es "tex" "xcolor")
\usepackage{colorweb}                  % (find-es "tex" "colorweb")
\usepackage{tocloft}                    % (find-es "tex" "tocloft")
\usepackage{indentfirst}
%\usepackage{tikz}
\usepackage{fancyvrb}           % for pygments
\usepackage{color}              % for pygments
%
% (find-LATEX "dednat7-test1.tex")
%\usepackage{proof}   % For derivation trees ("%:" lines)
%\input diagxy        % For 2D diagrams ("%D" lines)
%\xyoption{curve}     % For the ".curve=" feature in 2D diagrams
%
\usepackage{edrx21}               % (find-LATEX "edrx21.sty")
\input edrxaccents.tex            % (find-LATEX "edrxaccents.tex")
\input edrx21chars.tex            % (find-LATEX "edrx21chars.tex")
\input edrxheadfoot.tex           % (find-LATEX "edrxheadfoot.tex")
\input edrxgac2.tex               % (find-LATEX "edrxgac2.tex")
%
% (find-es "tex" "geometry")
%\usepackage[a6paper, landscape,
%            top=1.5cm, bottom=.25cm, left=1cm, right=1cm, includefoot
%           ]{geometry}
%
\usepackage[backend=biber,
   style=alphabetic]{biblatex}    % (find-es "tex" "biber")
\addbibresource{catsem-ab.bib}    % (find-LATEX "catsem-ab.bib")
\addbibresource{education.bib}    % (find-LATEX "education.bib")
%
\begin{document}

% «defs»  (to ".defs")
% (find-LATEX "edrx21defs.tex" "colors")
% (find-LATEX "edrx21.sty")

\def\drafturl{http://anggtwu.net/LATEX/2025-2-C2.pdf}
\def\drafturl{http://anggtwu.net/2025.2-C2.html}
\def\draftfooter{\tiny \href{\drafturl}{\jobname{}} \ColorBrown{\shorttoday{} \hours}}

% (find-LATEX "2024-1-C2-carro.tex" "defs-caepro")
% (find-LATEX "2024-1-C2-carro.tex" "defs-pict2e")

\catcode`\^^J=10
\directlua{dofile "dednat7load.lua"}  % (find-LATEX "dednat7load.lua")
\directlua{dednat7preamble()}         % (find-angg "LUA/DednatPreamble1.lua")
\directlua{dednat7oldheads()}         % (find-angg "LUA/Dednat7oldheads.lua")

% «defs-T-and-B»  (to ".defs-T-and-B")
\long\def\ColorDarkOrange#1{{\color{orange!90!black}#1}}
\def\T(Total: #1 pts){{\bf(Total: #1)}}
\def\T(Total: #1 pts){{\bf(Total: #1 pts)}}
\def\T(Total: #1 pts){\ColorRed{\bf(Total: #1 pts)}}
\def\B       (#1 pts){\ColorDarkOrange{\bf(#1 pts)}}

% «defs-caepro»  (to ".defs-caepro")
%L dofile "Caepro5.lua"              -- (find-angg "LUA/Caepro5.lua" "LaTeX")
\def\Caurl   #1{\expr{Caurl("#1")}}
\def\Cahref#1#2{\href{\Caurl{#1}}{#2}}
\def\Ca      #1{\Cahref{#1}{#1}}

% «defs-pict2e»  (to ".defs-pict2e")
%L dofile "Piecewise2.lua"           -- (find-LATEX "Piecewise2.lua")
%L --dofile "Escadas1.lua"           -- (find-LATEX "Escadas1.lua")
%L dofile "ExprDxDy1.lua"            -- (find-LATEX "ExprDxDy1.lua")
\def\pictgridstyle{\color{GrayPale}\linethickness{0.3pt}}
\def\pictaxesstyle{\linethickness{0.5pt}}
\def\pictnaxesstyle{\color{GrayPale}\linethickness{0.5pt}}
\celllower=2.5pt

% «defs-maxima»  (to ".defs-maxima")
% See: (find-LATEX "edrx21.sty" "maximablue-red")
%L dofile "Maxima3.lua"             -- (find-angg "LUA/Maxima3.lua")
%L MaximaTeX.__index.vbox = function (mt,rect)
%L     return format("\\maximavbox{%s}", table.concat(rect))
%L   end
\def\maximavbox#1{\vbox{#1}}
\pu

% «defs-V»  (to ".defs-V")
%L --- See: (find-angg "LUA/MiniV1.lua" "problem-with-V")
%L V = MiniV
%L v = V.fromab
\pu

% «defs-Verbatim»  (to ".defs-Verbatim")
% See: (find-LATEX "Verbatim3.lua" "Verbatim" " defvbt  =")
%      (find-LATEX "Verbatim3.lua" "dednat6" "defvbt =")
%      (find-LATEX "Verbatim3.lua" "dednat6-tests")
%      (find-LATEX "edrx21.sty" "defvbt")
%      (find-LATEX "edrx21.sty" "defvbt" "\\vbtbgboxcolor")
%L dofile "Verbatim3.lua"            -- (find-LATEX "Verbatim3.lua")
\pu
\def\vbtbgboxcolor{YellowOrangeLight!45}

% «defs-comprehensions»  (to ".defs-comprehensions")
% For: (find-angg "LUA/Comprehensions1.lua" "Comprehension-tests")
\def\comprehensionbox#1{\ensuremath{\sm{#1}}}
\def\comprehensionbox#1{\ensuremath{\mat{#1}}}
\def\comprehensionbox#1{\ensuremath{\fbox{\sm{#1}}}}
\def\comprehensionbox#1{\fbox{\ensuremath{\mat{#1}}}}
\def\comprehensionbox#1{\fbox{\ensuremath{\sm{#1}}}}
\def\comprehensionbox#1{\vbtbgbox{\ensuremath{\mat{#1}}}}
\def\V{\mathbf{V}}
\def\F{\mathbf{F}}
\def\Stop{\omit\vrule\phantom{$\scriptstyle($}\hss}
\def\Stop{\omit|\hss}
\def\HLine{\hline\\[0pt]}
\def\HLine{\hline}



% «defs-co»  (to ".defs-co")
% From: (find-LATEX "2022on-the-missing.tex" "defs")
% \co: a low-level way to typeset code; a poor man's "\verb"
\def\co#1{{%
  \def\%{\char37}%
  \def\\{\char92}%
  \def\^{\char94}%
  \def\~{\char126}%
  \tt#1%
  }}
\def\qco#1{`\co{#1}'}
\def\qqco#1{``\co{#1}''}

% «defs-S»  (to ".defs-S")
\input 2025-1-C2-S-defs.tex   % (find-LATEX "2025-1-C2-S-defs.tex")

% «defs-picturedots»  (to ".defs-picturedots")
%L dofile "PictureDots1.lua"          -- (find-LATEX "PictureDots1.lua")
\pu
\def\picturedots(#1,#2)(#3,#4)#5{\expr{
    PictureDots.from(#1,#2, #3,#4, "#5"):topict():pgat("patc")
  }}

% «defs-processsubfile»  (to ".defs-processsubfile")
% See: (find-LATEX "dednat7load.lua")
%L processsubfile = function (fname)
%L     local oldtf,oldtexfile = tf
%L     tf = TeXFile.read("2025bad-foundations-lean.tex")
%L     tf:processuntil(#tf)
%L     tf,texfile = oldtf,oldtexfile
%L   end

% «defs-pygvbt»  (to ".defs-pygvbt")
%L dofile "Pygments1.lua"            -- (find-LATEX "Pygments1.lua")
\pu

% «defs-T1-T2-T3-T4»  (to ".defs-T1-T2-T3-T4")
% See: (find-LATEX "2025bad-foundations-lean.tex" "defs")
%      (find-LATEX "2025bad-foundations-lean.tex" "T1-T2-T3-T4")
\input              2025bad-foundations-lean.tex   % loads the defs
%L processsubfile  "2025bad-foundations-lean.tex"  -- runs the "defpygvbt"s
\pu

% Test:
% \vbt{T1 T2 T3 T4}
% (find-dednat7debug-links "~/LATEX/2025bad-foundations.tex")









\newpage

% ;-- title
%
%  _____ _ _   _                               
% |_   _(_) |_| | ___   _ __   __ _  __ _  ___ 
%   | | | | __| |/ _ \ | '_ \ / _` |/ _` |/ _ \
%   | | | | |_| |  __/ | |_) | (_| | (_| |  __/
%   |_| |_|\__|_|\___| | .__/ \__,_|\__, |\___|
%                      |_|          |___/      
%
% «title»  (to ".title")
% (bafp 1 "title")
% (bafa   "title")


% (find-Deps1-cps   "Caepro5 Piecewise2 Maxima3 PictureDots1")
% (find-dednat7debug-links "~/LATEX/2025bad-foundations.tex")


\title{Bad Foundations \\ and Manipulable Objects}

\author{%
  Eduardo Ochs%
  %{\large Eduardo Ochs}%
  \thanks{eduardoochs@gmail.com}\\
  %{\small UFF, Rio das Ostras, RJ, Brasil}\\
  }

\maketitle

% «abstract»  (to ".abstract")
% Orig: (favp 1 "abstract")
%       (fava   "abstract")

\begin{abstract}

  Imagine a student---let's call him $E$, and make him a ``he''---that
  is enrolled in Calculus 2, and who believes that to pass in Maths
  courses he only needs to memorize methods and apply them quickly and
  without errors. Let's imagine that $E$ is an extreme case of ``bad
  foundations'', and that he knows how to solve $x+2=5$ by doing
  $x=5-2=3$, but he doesn't know how to substitute the $x$ in $x+2=5$
  by 3, and the only way that he knows of ``testing the solution'' is
  to apply the same method again and check that he got the same
  result.

  When we are teaching Calculus to classes that have many students
  that are extreme cases of bad foundations we need new strategies and
  tools; for example, we can't pretend that ``taking a particular
  case'' is an obvious operation anymore---instead we need ways to
  make these operations easy to visualize. (Justification)


\end{abstract}


% ;-- dedic
% «dedic»  (to ".dedic")
% (find-es "tex" "dedication")
% Para Walter Machado Pinheiro,
% que não leu e não vai ler
% documento nenhum

\cite{Boaler}
\cite{Hewitt1}
\cite{Hewitt2}
\cite{Hewitt3}

% (find-books "__analysis/__analysis.el" "sfard" "241" "3. Rituals")
% (find-books "__analysis/__analysis.el" "tall-amt" "28" "Most mathematics instruction, from elementary school through college courses,\nteaches what might be called rituals")

% (find-LATEX "2022on-the-missing.tex" "toc")

% (find-es "tex" "tocloft")
\renewcommand{\cfttoctitlefont}{\bfseries}
\setlength{\cftbeforesecskip}{2.5pt}

\tableofcontents



\newpage

% ;-- fateman

\newpage



% ;-- bad-explanations
% «bad-explanations»  (to ".bad-explanations")

\section{Bad Explanations}

Viciados em ChatGPT / história dos ratos

\cite{WrightMathWars}



% ;-- degrees
% «degrees»  (to ".degrees")
\section{Degrees of bad foundations}

The student E is a case of {\it Extremely Bad Foundations}. The
student E knows, for example, how to solve $2+x=5$ by doing $x=5-2=3$,
but he doesn't know how to substitute the $x$ in $2+x=5$ by 3, and he
believes that the only way to check if 3 is to apply the method --
$x=5-2=3$ -- again, and verify that he got the same answer.

% (find-books "__analysis/__analysis.el" "hewitt-1" "6" "y=2+x")
% lisptreeq(2*3+4*5+6/(7+8));
% lisptreeq(f(a,g(b,c),d));


% ;-- items
% «items»  (to ".items")
% (misp 9 "the-conventions")
% (misa   "the-conventions")
\section{Items}

\begin{itemize}

\item[(LL)] Learn as least as possible. See:
  % (c2m252introp 45 "qca-e-mapa")
  % (c2m252introa    "qca-e-mapa")

\item[(EC)] Evidence of cheating
  % (c2m251introp 42 "nao")
  % (c2m251introa    "nao")

\item[(OS)] Optimize for speed
  % (c2m251introp 20 "semicirculo")
  % (c2m251introa    "semicirculo")

\item[(OC)] Optimize for clarity

\item[(LR)] Level reduction: see chain rule
  % (find-books "__analysis/__analysis.el" "rest-is-algebra" "53" "3.6    Level Reduction")

\item[(JN)] Just notation: the f is ``just notation''

\item[(PM)] Pattern matching: they know how to do it in certain cases
  but not in general.

\item[(NF)] New formulas: they don't know how to obtain new formulas
  from formulas that they already know.

\item[(JS)] Justification for a step

\item[(SA)] Structured activities

\end{itemize}


\newpage %-- aha-moment

% «aha-moment»  (to ".aha-moment")
% (bafp 99 "aha-moment")
% (bafa    "aha-moment")
% (find-books "__analysis/__analysis.el" "sfard" "29" "For example, Paul Halmos")

\section{Aha! Moment}


% ;-- lean
% «lean»  (to ".lean")
% (bafp 6 "lean")
% (bafa   "lean")
% (find-es "lean" "calc")
% (adabp 12 "calc")
% (adaba    "calc")

\section{Lean}



% ;-- qparts
% «qparts»  (to ".qparts")
% (find-books "__analysis/__analysis.el" "drijvers-sae" "112" "Guess and check")
% (find-books "__analysis/__analysis.el" "drijvers-sae" "167" "FORMAL SUBSTITUTION")
% (find-books "__analysis/__analysis.el" "drijvers-sae" "180" "AN EXAMPLE: TRIAL-AND-IMPROVE")
% (bafp 99 "qparts")
% (bafa    "qparts")

\section{qparts}

%M (%i1) eq1 : RCV   _sss_ [f(u)=sin(u), fp(u)=cos(u), g(x)=x^2, gp(x)=2*x];
%M (%o1) \begin{pmatrix}&{\frac{d}{d\,x}}\,f\left(g\left(x\right)\right)\cr \mbox{ = }&f'\left(g\left(x\right)\right)\,g'\left(x\right)\cr \end{pmatrix}\,\begin{bmatrix}f\left(u\right) := \sin u\cr f'\left(u\right) := \cos u\cr g\left(x\right) := x^2\cr g'\left(x\right) := 2\,x\cr \end{bmatrix}=\begin{pmatrix}&{\frac{d}{d\,x}}\,\sin x^2\cr \mbox{ = }&\cos x^2\,\left(2\,x\right)\cr \end{pmatrix}
%M (%i2) eq2 : MVI1V _sss_ [f(u)=sin(u), fp(u)=cos(u), g(x)=x^2, gp(x)=2*x];
%M (%o2) \begin{pmatrix}&\int {f'\left(g\left(x\right)\right)\,g'\left(x\right)}{\;dx}\big.\cr \mbox{ = }&\int {f'\left(u\right)}{\;du}\big.\cr \end{pmatrix}\,\begin{bmatrix}f\left(u\right) := \sin u\cr f'\left(u\right) := \cos u\cr g\left(x\right) := x^2\cr g'\left(x\right) := 2\,x\cr \end{bmatrix}=\begin{pmatrix}&\int {\cos x^2\,\left(2\,x\right)}{\;dx}\big.\cr \mbox{ = }&\int {\cos u}{\;du}\big.\cr \end{pmatrix}
%M (%i3) eq3 : MVD1V _sss_ [f(u)=sin(u), fp(u)=cos(u), g(x)=x^2, gp(x)=2*x];
%M (%o3) \begin{pmatrix}&\int_{x=a}^{x=b}{f'\left(g\left(x\right)\right)\,g'\left(x\right)\;dx}\big.\cr \mbox{ = }&\int_{u=g\left(a\right)}^{u=g\left(b\right)}{f'\left(u\right)\;du}\big.\cr \end{pmatrix}\,\begin{bmatrix}f\left(u\right) := \sin u\cr f'\left(u\right) := \cos u\cr g\left(x\right) := x^2\cr g'\left(x\right) := 2\,x\cr \end{bmatrix}=\begin{pmatrix}&\int_{x=a}^{x=b}{\cos x^2\,\left(2\,x\right)\;dx}\big.\cr \mbox{ = }&\int_{u=a^2}^{u=b^2}{\cos u\;du}\big.\cr \end{pmatrix}
%M (%i4) qparts(eq1, [1,2,1,1,2],
%M             [1,2,2,1,2],
%M             [1,2,3,1,2],
%M             [1,2,4,1,2],
%M             [2,2,2]);
%M (%o4) \begin{pmatrix}&{\frac{d}{d\,x}}\,f\left(g\left(x\right)\right)\cr \mbox{ = }&f'\left(g\left(x\right)\right)\,g'\left(x\right)\cr \end{pmatrix}\,\begin{bmatrix}f\left(u\right) := \mbox{ ? }\cr f'\left(u\right) := \mbox{ ? }\cr g\left(x\right) := \mbox{ ? }\cr g'\left(x\right) := \mbox{ ? }\cr \end{bmatrix}=\begin{pmatrix}&{\frac{d}{d\,x}}\,\sin x^2\cr \mbox{ = }&\mbox{ ? }\cr \end{pmatrix}
%M (%i5) qparts(eq1, [1,2,1,1,2],
%M             [1,2,2,1,2],
%M             [1,2,3,1,2],
%M             [1,2,4,1,2],
%M             [2,1,2,1]);
%M (%o5) \begin{pmatrix}&{\frac{d}{d\,x}}\,f\left(g\left(x\right)\right)\cr \mbox{ = }&f'\left(g\left(x\right)\right)\,g'\left(x\right)\cr \end{pmatrix}\,\begin{bmatrix}f\left(u\right) := \mbox{ ? }\cr f'\left(u\right) := \mbox{ ? }\cr g\left(x\right) := \mbox{ ? }\cr g'\left(x\right) := \mbox{ ? }\cr \end{bmatrix}=\begin{pmatrix}&{\frac{d}{d\,x}}\,\mbox{ ? }\cr \mbox{ = }&\cos x^2\,\left(2\,x\right)\cr \end{pmatrix}
%M (%i6) qparts(eq2, [1,2,1,1,2],
%M             [1,2,2,1,2],
%M             [1,2,3,1,2],
%M             [1,2,4,1,2],
%M             [2,2,2,1]);
%M (%o6) \begin{pmatrix}&\int {f'\left(g\left(x\right)\right)\,g'\left(x\right)}{\;dx}\big.\cr \mbox{ = }&\int {f'\left(u\right)}{\;du}\big.\cr \end{pmatrix}\,\begin{bmatrix}f\left(u\right) := \mbox{ ? }\cr f'\left(u\right) := \mbox{ ? }\cr g\left(x\right) := \mbox{ ? }\cr g'\left(x\right) := \mbox{ ? }\cr \end{bmatrix}=\begin{pmatrix}&\int {\cos x^2\,\left(2\,x\right)}{\;dx}\big.\cr \mbox{ = }&\int {\mbox{ ? }}{\;du}\big.\cr \end{pmatrix}
%M (%i7) qparts(eq3, [1,2,1,1,2],
%M             [1,2,2,1,2],
%M             [1,2,3,1,2],
%M             [1,2,4,1,2],
%M             [2,2,2,1]);
%M (%o7) \begin{pmatrix}&\int_{x=a}^{x=b}{f'\left(g\left(x\right)\right)\,g'\left(x\right)\;dx}\big.\cr \mbox{ = }&\int_{u=g\left(a\right)}^{u=g\left(b\right)}{f'\left(u\right)\;du}\big.\cr \end{pmatrix}\,\begin{bmatrix}f\left(u\right) := \mbox{ ? }\cr f'\left(u\right) := \mbox{ ? }\cr g\left(x\right) := \mbox{ ? }\cr g'\left(x\right) := \mbox{ ? }\cr \end{bmatrix}=\begin{pmatrix}&\int_{x=a}^{x=b}{\cos x^2\,\left(2\,x\right)\;dx}\big.\cr \mbox{ = }&\int_{u=a^2}^{u=b^2}{\mbox{ ? }\;du}\big.\cr \end{pmatrix}
%M (%i8) 
%L
%L maximahead:sa("qparts", "")
\pu

\scalebox{0.6}{\def\colwidth{16cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth{16cm}
\ga{qparts}

}}




% ;-- lazy-nouns
% «lazy-nouns»  (to ".lazy-nouns")

\section{Lazy nouns}

Maxima has a configurable set of ``simplification rules'', and
simplifications happen by default; the section ``Introduction to
Simplification'' of the Maxima manual explains the details, and it
also explains why the most obvious way to turn off the simplifier
temporarily -- setting the variable \co{simp} to \co{false} -- is
usually a bad idea.

Some words in Maxima have variants that are ``less active'': the
result of \co{diff(y,x)} is 0, but the result of \co{'diff(y,x)} is
$\frac{dy}{dx}$. That happens because for Maxima \co{diff} is a
``verb'', and the \qco{'} in \co{'diff(y,x)} tells Maxima to convert
the verb \co{diff} to its ``nounified version'', and use that noun --
that has fewer simplification rules.

One way of




% ;-- lazy-sum
% «lazy-sum»  (to ".lazy-sum")
% (bafp 99 "lazy-sum")
% (bafa    "lazy-sum")

\section{lazy-sum}

%M (%i1) Sum([args]) := apply("+.", apply('makelist,args))$
%M (%i2) sum     (10^k,  k,2,4);
%M (%o2) 11100
%M (%i3) makelist(10^k,  k,2,4);
%M (%o3) \left[ 100 , 1000 , 10000 \right] 
%M (%i4) makelist(10^.k, k,2,4);
%M (%o4) \left[ 10^2 , 10^3 , 10^4 \right] 
%M (%i5) Sum     (10^.k, k,2,4);
%M (%o5) 10^2+10^3+10^4
%M (%i6) 
%L
%L maximahead:sa("lazy sum", "")
\pu

\scalebox{0.6}{\def\colwidth{9cm}\firstcol{

\vspace*{0cm}
\def\hboxthreewidth{9cm}
\ga{lazy sum}

}}


% ;-- trial-and-improve
% «trial-and-improve»  (to ".trial-and-improve")
% (bafp 99 "trial-and-improve")
% (bafa    "trial-and-improve")
% (find-books "__analysis/__analysis.el" "drijvers-sae" "180" "AN EXAMPLE: TRIAL-AND-IMPROVE")
% (find-es "maxima" "baf-1")

\section{trial-and-improve}




% ;-- flipped
% «flipped»  (to ".flipped")
% (find-books "__analysis/__analysis.el" "nachtigall")
% (find-books "__analysis/__analysis.el" "baig")
% (find-books "__analysis/__analysis.el" "krantz" "98" "4.5. The Flipped Classroom")

\section{Flipped}





% ;-- pattern-matching
% «pattern-matching»  (to ".pattern-matching")

\section{Pattern matching}



% ;-- chain-rule-links
% «chain-rule-links»  (to ".chain-rule-links")

% (c2m251stp 8 "chain-rule-red")
% (c2m251sta   "chain-rule-red")
% (c2m251sda   "chain-rule-red")


% ;-- chain-rule
% «chain-rule»  (to ".chain-rule")
\section{The chain rule}

$$\ga{Chain rule (Stewart p.150)}$$


% ;-- expandable-links
% «expandable-links»  (to ".expandable-links")


% ;-- expandable
% «expandable»  (to ".expandable")
\section{Expandable proofs}


I teach Mathematics ``in a bad campus of a good federal university in
Brazil'' -- see the appendix 1 for what that means -- and the courses
that I teach more often are Calculus 2 and 3 (``C2'' and ``C3'') for
students of Computer Science and Production Engineering. In the last
years the profile of the students arriving in my courses have changed
a lot, and now more than half of my students in C2 are like this:

\begin{itemize}

\item They remember that the chain rule is
  $\ddx f(g(x)) = f'(g(x))g'(x)$ and they derive functions like
  $\sin 42x$, but they don't have any idea of how to derivate
  functions like f(42x) and sin(g(x)),

\item They understand that $\sqrt{a^2 + b^2} = a+b$ is not always
  true, but they use steps like $\sqrt{a^2 + b^2} = a+b$ in their
  calculations, and when I ask them to tell me what rule that the used
  in that step they {\it can't} -- they just say ``oops, sorry, I got
  distracted, that won't happen again'', or ``I just followed the
  method''.

\item They don't do exercises, don't participate in group discussions,
  and don't ask any questions. In the tests a few of them cleary
  cheated, and most of the others gave answers that showed that they
  understood a few methods from the Calculus book that we used, but
  they understand very little high-school algebra -- their answers
  were full of ``basic'' errors that they didn't know how to debug.

\item {\sl I don't know how they think}. I've tried several ways to
  interact with them, but I've almost always failed miserably. One of
  my hypotheses is that they are addicted to ChatGPT and they are
  people who lost the notion of ``here and now''; they are mere
  spectators in the class, and that "prefer to study at home" using
  Youtube and ChatGPT -- but I don't know how true that is.

\end{itemize}

Item (1) means that they don't know how to obtain particular cases,
and don't understand how some rules are consequences of other rules. I
know that they saw some proofs in Calculus 1, but I infer that they
don't know the basic mechanisms behind proofs, and they didn't
understand anything of those proofs.

Item (2) means that they only have a very shallow notion of what is a
valid step in a calculation; they believe that they need to memorize
lots of rules and apply them without errors, and that's it. See
\cite[p.22]{McGowen} ("rules without reason").

% (find-books "__analysis/__analysis.el" "rest-is-algebra" "3" "Sepideh Stewart and Stacy Reeder")
% (find-books "__analysis/__analysis.el" "rest-is-algebra" "5" "lack of sense regarding denotation")
% (find-books "__analysis/__analysis.el" "rest-is-algebra" "19" "Mercedes McGowen")
% (find-books "__analysis/__analysis.el" "rest-is-algebra" "22" "rules without reason")
% (find-books "__analysis/__analysis.el" "ma" "12" "removal of the reasoning system")

In the beginning I didn't know what to do with these students. Now I
believe that an approach based on ``manipulable objects'' might work.

I will call the students above ``students with bad foundations''. Some
cases are worse than the others; see \cite[p.5]{StewartReeder}, that
uses the expression ``lack of sense regarding denotation''. I will
refer to the more severe cases as ``students with {\sl very} bad
foundations''.



\subsection{Manipulable objects}

\newpage

% ;-- comprehensions-links
% «comprehensions-links»  (to ".comprehensions-links")
% (bafp 99 "comprehensions-links")
% (bafa    "comprehensions-links")
% (mpgp 8 "comprehension")
% (mpga   "comprehension")

% \picturedots(0,0)(3,4){ 1,4 2,4 1,3 }

% ;-- comprehensions
% «comprehensions»  (to ".comprehensions")
% (bafp 9 "comprehensions")
% (bafa   "comprehensions")

\section{Set comprehensions}

\def\und#1#2{\underbrace{#1}_{#2}}
\def\und#1#2{\underbrace{#1}_{\text{#2}}}
\def\und#1#2{\underbrace{\mathstrut#1}_{\mathstrut\text{#2}}}
\def\ug#1{\und{#1}{gen}}
\def\uf#1{\und{#1}{filt}}
\def\ue#1{\und{#1}{expr}}

My favorite way of presenting variables to students with bad
foundations is by starting from a certain set of exercises on set
comprehensions in the next section, in which all variables are bound
and vary over small finite sets, and all the resulting sets are easy
to draw; this lets us avoid most of the difficulties in
\cite[p.6]{EllermeijerHeck} -- ``The meaning of variable is variable
in mathematics'' -- in a first moment; we start by ``variables that
vary'', and then we build the other possible meanings for variables on
top of that.

I started using that approach in \cite{MPG}, that was in Portuguese
and for freshmen students, and reused it in \cite{OchsPH1} and other
papers. This appendix contains the exercises from \cite{MPG} with a
better introduction, and then a discussion of the rationale.

\msk

These two kinds of set comprehensions are written similarly but they
correspond to different programs:
%
%V for a=2,4 do
%V   print(10*a)
%V end
%L
%L defvbt "compr 10*a"
\pu
%
%V for a=2,4 do
%V   if a^2<10 then
%V     print(a)
%V   end
%V end
%L
%L defvbt "compr a^2<10"
\pu
%
$$\begin{array}{rclll}
  \setofst    {10a} {a∈\{2,3,4\}} &=& \{20,30,40\} && \myvcenter{\vbt{compr 10*a}} \\
  \setofst {a∈\{2,3,4\}} {a^2<10} &=& \{2,3\}      && \myvcenter{\vbt{compr a^2<10}} \\
  \end{array}
$$

One way to unify them is to create a third notation, that uses a
\qco{;} instead of a \qco{|}, and in which all expressions at the left
of the \qco{;} are either ``generators'' or ``filters'', and after the
\qco{;} we have a ``result expression''. Generators, filters, and
result expressions correspond to the \qco{for}s, \qco{if}s, and
\qco{print}s in the Lua programs above, and if we annotate the parts
with underbraces to indicate the generators, the filters, and result
expressions, we get this:
%
$$\begin{array}{rcl}
      \setofst {\ue{10a}} {\ug{a∈\{2,3,4\}}}
  &=& \setofsc {\ug{a∈\{2,3,4\}}} {\ue{10a}} \\
      \setofst {\ug{a∈\{2,3,4\}}} {\uf{a^2<10}}
  &=& \setofsc {\ug{a∈\{2,3,4\}},  \uf{a^2<10}} {\ue{a}} \\
  \end{array}
$$

\unitlength=4pt
\def\closeddot{\circle*{0.6}}

We can calculate the result of a set comprehension by using a tree.
For example, in this case,
%
$$\setofsc {\ug{x∈\{1,\ldots,5\}},\ug{y∈\{x,\ldots,6-x\}}} {\ue{(x,y)}}
  \;=\; \picturedots(0,0)(6,6){ 1,1 1,2 1,3 1,4 1,5 2,2 2,3 2,4 3,3 }
$$
%
we can draw -- or, rather, typeset -- that tree in several ways. Here
are two ways, that follow the same conventions but have different
columns:
%
$$\comprehensionbox{
    x & y & (x,y) \\\HLine
    1 & 1 & (1,1) \\
      & 2 & (1,2) \\
      & 3 & (1,3) \\
      & 4 & (1,4) \\
      & 5 & (1,5) \\
    2 & 2 & (2,2) \\
      & 3 & (2,3) \\
      & 4 & (2,4) \\
    3 & 3 & (3,3) \\
    4 & \Stop \\
    5 & \Stop \\
    }
  %
  \qquad
  %
  \comprehensionbox{
    x & 6-x & \{x,\ldots,6-x\} & y & (x,y) \\\HLine
    1 & 5 & \{1,2,3,4,5\} & 1 & (1,1) \\
      &   &               & 2 & (1,2) \\
      &   &               & 3 & (1,3) \\
      &   &               & 4 & (1,4) \\
      &   &               & 5 & (1,5) \\
    2 & 4 & \{2,3,4\} & 2 & (2,2) \\
      &   &           & 3 & (2,3) \\
      &   &           & 4 & (2,4) \\
    3 & 3 & \{3\} & 3 & (3,3) \\
    4 & 2 & \{\} & \Stop \\
    5 & 1 & \{\} & \Stop \\
    }
$$

Most students feel that the second tree/table is much easier to
follow, but that they wouldn't be able to draw it fully by
themselves... it is obvious how the columns of the first tree were
chosen, but it in the second one it is not -- {\sl hint: because this
  needs the idea of subexpressions}...

Most students find the the second table easier to follow than the
first one, but the columns in the first table were chosen in an
obvious way, and it is not so easy to explain how we chose the columns
of the second table. This is a nice example of how explanations can be
expanded and contracted.



% ;-- comprehensions-exercs
% «comprehensions-exercs»  (to ".comprehensions-exercs")
% (bafp 10 "comprehensions-exercs")
% (bafa    "comprehensions-exercs")

\subsection{Exercises}

SC1) Draw these sets:

$\begin{array}{rcl}
 A & := & \{(1,4), (2,4), (1,3)\} \\
 B & := & \{(1,3), (1,4), (2,4)\} \\
 C & := & \{(1,3), (1,4), (2,4), (2,4)\} \\
 D & := & \{(1,3), (1,4), (2,3), (2,4)\} \\
 E & := & \{(0,3), (1,2), (2,1), (3,0)\} \\
\end{array}
$

\msk

SC2) Draw these sets:

$\begin{array}{rcl}
 A & := & \{x∈\{1,2\}; (x,3-x)\} \\
 B & := & \{x∈\{1,2,3\}; (x,3-x)\} \\
 C & := & \{x∈\{0,1,2,3\}; (x,3-x)\} \\
 D & := & \{x∈\{0,0.5,1, \ldots, 3\}; (x,3-x)\} \\
 E & := & \{x∈\{1,2,3\}, y∈\{3,4\}; (x,y)\} \\
 F & := & \{x∈\{3,4\}, y∈\{1,2,3\}; (x,y)\} \\
 G & := & \{x∈\{3,4\}, y∈\{1,2,3\}; (y,x)\} \\
 H & := & \{x∈\{3,4\}, y∈\{1,2,3\}; (x,2)\} \\
 I & := & \{x∈\{1,2,3\}, y∈\{3,4\}, x+y<6; (x,y)\} \\
 J & := & \{x∈\{1,2,3\}, y∈\{3,4\}, x+y>4; (x,y)\} \\
 K & := & \{x∈\{1,2,3,4\}, y∈\{1,2,3,4\}; (x,y)\} \\
 L & := & \{x,y∈\{0,1,2,3,4\}; (x,y)\} \\
 M & := & \{x,y∈\{0,1,2,3,4\}, y=3; (x,y)\} \\
 N & := & \{x,y∈\{0,1,2,3,4\}, x=2; (x,y)\} \\
 O & := & \{x,y∈\{0,1,2,3,4\}, x+y=3; (x,y)\} \\
 P & := & \{x,y∈\{0,1,2,3,4\}, y=x; (x,y)\} \\
 Q & := & \{x,y∈\{0,1,2,3,4\}, y=x+1; (x,y)\} \\
 R & := & \{x,y∈\{0,1,2,3,4\}, y=2x; (x,y)\} \\
 S & := & \{x,y∈\{0,1,2,3,4\}, y=2x+1; (x,y)\} \\
\end{array}
$

\msk

SC3) Draw these sets:

$\begin{array}{rcl}
 A & := & \setofst{(x,0)}{x∈\{0,1,2,3\}} \\
 B & := & \setofst{(x,x/2)}{x∈\{0,1,2,3\}} \\
 C & := & \setofst{(x,x)}{x∈\{0,1,2,3\}} \\
 D & := & \setofst{(x,2x)}{x∈\{0,1,2,3\}} \\
 E & := & \setofst{(x,1)}{x∈\{0,1,2,3\}} \\
 F & := & \setofst{(x,1+x/2)}{x∈\{0,1,2,3\}} \\
 G & := & \setofst{(x,1+x)}{x∈\{0,1,2,3\}} \\
 H & := & \setofst{(x,1+2x)}{x∈\{0,1,2,3\}} \\
 I & := & \setofst{(x,2)}{x∈\{0,1,2,3\}} \\
 J & := & \setofst{(x,2+x/2)}{x∈\{0,1,2,3\}} \\
 K & := & \setofst{(x,2+x)}{x∈\{0,1,2,3\}} \\
 L & := & \setofst{(x,2+2x)}{x∈\{0,1,2,3\}} \\
 M & := & \setofst{(x,2)}{x∈\{0,1,2,3\}} \\
 N & := & \setofst{(x,2-x/2)}{x∈\{0,1,2,3\}} \\
 O & := & \setofst{(x,2-x)}{x∈\{0,1,2,3\}} \\
 P & := & \setofst{(x,2-2x)}{x∈\{0,1,2,3\}} \\
\end{array}
$

\bsk

Now we can define the cartesian product.

These definitions are standard:

$$\begin{array}{rcl}
  A×B &:=& \{a∈A,b∈B;(a,b)\} \\
  A^2 &:=& A×A \\
  \end{array}
$$

So, for example:
%
$$\begin{array}{rcl}
  \{1,2\}×\{3,4\} &=& \{(1,3),(1,4),(2,3),(2,4)\} \\
  \{3,4\}^2 &=& \{3,4\}×\{3,4\} \\
            &=& \{(3,3),(3,4),(4,3),(4,4)\} \\
  \end{array}
$$


SC4) Let:
%
$$\begin{array}{rcl}
  A &=& \{1,2,4\} \\
  B &=& \{2,3\} \\
  C &=& \{2,3,4\} \\
  \end{array}
$$

Draw these sets:

\begin{tabular}{lll}
a) $A×A$ & d) $B×A$ & g) $C×A$ \\
b) $A×B$ & e) $B×B$ & h) $C×B$ \\
c) $A×C$ & f) $B×C$ & i) $C×C$ \\
\end{tabular}

\msk

SC5) Draw these sets:

$\begin{array}{rcl}
 A &:=& \{x,y∈\{0,1,2,3\};(x,y)\} \\
 B &:=& \{x,y∈\{0,1,2,3\}, y=2; (x,y)\} \\
 C &:=& \{x,y∈\{0,1,2,3\}, x=1; (x,y)\} \\
 D &:=& \{x,y∈\{0,1,2,3\}, y=x; (x,y)\} \\
 E &:=& \{x,y∈\{0,1,2,3,4\}, y=2x; (x,y)\} \\
 F &:=& \{(x,y)∈\{0,1,2,3,4\}^2, y=2x; (x,y)\} \\
 G &:=& \{(x,y)∈\{0,1,2,3,4\}^2, y=x; (x,y)\} \\
 H &:=& \{(x,y)∈\{0,1,2,3,4\}^2, y=x/2; (x,y)\} \\
 I &:=& \{(x,y)∈\{0,1,2,3,4\}^2, y=x/2+1; (x,y)\} \\
 J &:=& \setofst {(x,y)∈\{0,1,2,3,4\}^2} {y=2x} \\
 K &:=& \setofst {(x,y)∈\{0,1,2,3,4\}^2} {y=x} \\
 L &:=& \setofst {(x,y)∈\{0,1,2,3,4\}^2} {y=x/2} \\
 M &:=& \setofst {(x,y)∈\{0,1,2,3,4\}^2} {y=x/2+1} \\
 N &:=& \setofst {(x,y)∈\{1,2,3\}^2} {0x+0y=0} \\
 O &:=& \setofst {(x,y)∈\{1,2,3\}^2} {0x+0y=2} \\
 P &:=& \setofst {(x,y)∈\{1,2,3\}^2} {x≥y} \\
 \end{array}
$

\msk

SC6) Draw these sets:

$\begin{array}{rcl}
 J' &:=& \setofst {(x,y)∈\R^2} {y=2x} \\
 K' &:=& \setofst {(x,y)∈\R^2} {y=x} \\
 L' &:=& \setofst {(x,y)∈\R^2} {y=x/2} \\
 M' &:=& \setofst {(x,y)∈\R^2} {y=x/2+1} \\
 N' &:=& \setofst {(x,y)∈\R^2} {0x+0y=0} \\
 O' &:=& \setofst {(x,y)∈\R^2} {0x+0y=2} \\
 P' &:=& \setofst {(x,y)∈\R^2} {x≥y} \\
 \end{array}
$


% ;-- comprehensions-answers
% «comprehensions-answers»  (to ".comprehensions-answers")

\subsection{Answers}

SC1)
$
A = B = C = \picturedots(0,0)(3,4){ 1,4 2,4 1,3 }
\quad
D = \picturedots(0,0)(3,4){ 1,4 2,4 1,3 2,3 }
\quad
E = \picturedots(0,0)(4,4){ 0,3 1,2 2,1 3,0 }
$

\bsk

SC2)
$     A = \picturedots(0,0)(4,4){     1,2 2,1     }
\quad B = \picturedots(0,0)(4,4){     1,2 2,1 3,0 }
\quad C = \picturedots(0,0)(4,4){ 0,3 1,2 2,1 3,0 }
\quad D = \picturedots(0,0)(4,4){ 0,3 .5,2.5 1,2 1.5,1.5 2,1 2.5,.5 3,0 }
$

\msk

$
\quad E = \picturedots(0,0)(4,4){ 1,3 2,3 3,3   1,4 2,4 3,4 }
\quad F = \picturedots(0,0)(4,4){ 3,1 4,1   3,2 4,2   3,3 4,3 }
\quad G = \picturedots(0,0)(4,4){ 1,3 2,3 3,3   1,4 2,4 3,4 }
\quad H = \picturedots(0,0)(4,4){ 3,2 4,2 }
\quad I = \picturedots(0,0)(4,4){ 1,3 2,3       1,4         }
\quad J = \picturedots(0,0)(4,4){     2,3 3,3   1,4 2,4 3,4 }
$

\msk

$
\quad K = \picturedots(0,0)(4,4){     1,4 2,4 3,4 4,4
                                      1,3 2,3 3,3 4,3
                                      1,2 2,2 3,2 4,2
                                      1,1 2,1 3,1 4,1 }
\quad L = \picturedots(0,0)(4,4){ 0,4 1,4 2,4 3,4 4,4
                                  0,3 1,3 2,3 3,3 4,3
                                  0,2 1,2 2,2 3,2 4,2
                                  0,1 1,1 2,1 3,1 4,1
                                  0,0 1,0 2,0 3,0 4,0 }
\quad M = \picturedots(0,0)(4,4){ 0,3 1,3 2,3 3,3 4,3 }
\quad N = \picturedots(0,0)(4,4){ 2,0 2,1 2,2 2,3 2,4 }
\quad O = \picturedots(0,0)(4,4){ 0,3 1,2 2,1 3,0 }
\quad P = \picturedots(0,0)(4,4){ 0,0 1,1 2,2 3,3 4,4 }
$

\msk

$
\quad Q = \picturedots(0,0)(4,4){ 0,1 1,2 2,3 3,4 }
\quad R = \picturedots(0,0)(4,4){ 0,0 1,2 2,4 }
\quad S = \picturedots(0,0)(4,4){ 0,1 1,3 }
$

\bsk

SC3)
$     A = \picturedots(0,0)(4,4){ 0,0 1,0  2,0 3,0   }
\quad B = \picturedots(0,0)(4,4){ 0,0 1,.5 2,1 3,1.5 }
\quad C = \picturedots(0,0)(4,4){ 0,0 1,1  2,2 3,3   }
\quad D = \picturedots(0,0)(4,7){ 0,0 1,2  2,4 3,6   }
$

$
\quad E = \picturedots(0,0)(4,4){ 0,1 1,1   2,1 3,1   }
\quad F = \picturedots(0,0)(4,4){ 0,1 1,1.5 2,2 3,2.5 }
\quad G = \picturedots(0,0)(4,4){ 0,1 1,2   2,3 3,4   }
\quad H = \picturedots(0,0)(4,7){ 0,1 1,3   2,5 3,7   }
$

$
\quad I = \picturedots(0,0)(4,4){ 0,2 1,2   2,2 3,2   }
\quad J = \picturedots(0,0)(4,4){ 0,2 1,2.5 2,3 3,3.5 }
\quad K = \picturedots(0,0)(4,4){ 0,2 1,3   2,4 3,5   }
\quad L = \picturedots(0,0)(4,8){ 0,2 1,4   2,6 3,8   }
$

$
\quad M = \picturedots(0,0)(4,4){ 0,2 1,2   2,2 3,2   }
\quad N = \picturedots(0,0)(4,4){ 0,2 1,1.5 2,1 3,.5 }
\quad O = \picturedots(0,-1)(4,4){ 0,2 1,1   2,0 3,-1  }
\quad P = \picturedots(0,-5)(4,3){ 0,2 1,0   2,-2 3,-4   }
$

\bsk

SC4)
$     A×A = \picturedots(0,0)(4,4){ 1,1 2,1 4,1   1,2 2,2 4,2   1,4 2,4 4,4 }
\quad B×A = \picturedots(0,0)(4,4){ 2,1 3,1       2,2 3,2       2,4 3,4     }
\quad C×A = \picturedots(0,0)(4,4){ 2,1 3,1 4,1   2,2 3,2 4,2   2,4 3,4 4,4 }
$

\msk

$
\quad A×B = \picturedots(0,0)(4,4){ 1,2 2,2 4,2   1,3 2,3 4,3 }
\quad B×B = \picturedots(0,0)(4,4){ 2,2 3,2       2,3 3,3     }
\quad C×B = \picturedots(0,0)(4,4){ 2,2 3,2 4,2   2,3 3,3 4,3 }
$

\msk

$
\quad A×C = \picturedots(0,0)(4,4){ 1,2 2,2 4,2   1,3 2,3 4,3   1,4 2,4 4,4 }
\quad B×C = \picturedots(0,0)(4,4){ 2,2 3,2       2,3 3,3       2,4 3,4     }
\quad C×C = \picturedots(0,0)(4,4){ 2,2 3,2 4,2   2,3 3,3 4,3   2,4 3,4 4,4 }
$

\bsk

SC5)
$     A = \picturedots(0,0)(4,4){ 0,3 1,3 2,3 3,3
                                  0,2 1,2 2,2 3,2
                                  0,1 1,1 2,1 3,1
                                  0,0 1,0 2,0 3,0 }
\quad B = \picturedots(0,0)(4,4){ 0,2 1,2 2,2 3,2 }
\quad C = \picturedots(0,0)(4,4){ 1,0 1,1 1,2 1,3 }
\quad D = \picturedots(0,0)(4,4){ 0,0 1,1 2,2 3,3 }
\quad E = \picturedots(0,0)(4,4){ 0,0 1,2 2,4 }
$

\msk

$
\quad F = \picturedots(0,0)(4,4){ 0,0 1,2 2,4         }
\quad G = \picturedots(0,0)(4,4){ 0,0 1,1 2,2 3,3 4,4 }
\quad H = \picturedots(0,0)(4,4){ 0,0 2,1 4,2         }
\quad I = \picturedots(0,0)(4,4){ 0,1 2,2 4,3         }
$

\msk

$
\quad J = \picturedots(0,0)(4,4){ 0,0 1,2 2,4         }
\quad K = \picturedots(0,0)(4,4){ 0,0 1,1 2,2 3,3 4,4 }
\quad L = \picturedots(0,0)(4,4){ 0,0 2,1 4,2         }
\quad M = \picturedots(0,0)(4,4){ 0,1 2,2 4,3         }
$

\msk

$
\quad N = \picturedots(0,0)(4,4){ 1,3 2,3 3,3
                                  1,2 2,2 3,2
                                  1,1 2,1 3,1 }
\quad O = \picturedots(0,0)(4,4){             }
\quad P = \picturedots(0,0)(4,4){         3,3
                                      2,2 3,2
                                  1,1 2,1 3,1 }
$


\newpage

% ;-- what-is-a-proposition
% «what-is-a-proposition»  (to ".what-is-a-proposition")

\subsection{What is a proposition?}

\def\villagesW{\picturedots(0,0)(5,4){ 1,3 2,3 3,3 4,3  1,2 2,2 3,2 4,2  1,1 2,1 3,1 4,1 }}
\def\villagesP{\picturedots(0,0)(5,4){ 1,3 2,3 3,3      1,2 2,2 3,2                      }}
\def\villagesQ{\picturedots(0,0)(5,4){     2,3 3,3 4,3      2,2 3,2 4,2                  }}
\def\villagesR{\picturedots(0,0)(5,4){                      2,2 3,2          2,1 3,1     }}

Here ``adults'' would prefer the terminology of Kripke frames, but
students prefer a terminology inspired by videogames. Imagine that we
are in a world that has these twelve villages,
%
$$W \;=\; \picturedots(0,0)(5,4){
  1,3 2,3 3,3 4,3
  1,2 2,2 3,2 4,2
  1,1 2,1 3,1 4,1
  }
$$

And these are the villages in which we can find `p'riests,
`q'artographers, and leathe`r'smiths:
%
$$P \;=\; \villagesP
  \quad
  Q \;=\; \villagesQ
  \quad
  R \;=\; \villagesR
$$

It's easy to visualize the villages that have both priests and
cartographers -- it is $P∩Q$:
%
$$P∩Q \;=\; \picturedots(0,0)(5,4){
      2,3 3,3
      2,2 3,2
                  }
$$

Until this point we were talking about sets that were easy to draw,
and everything was very concrete. Now note that each village has
coordinates. Saying simply `$x=4$' is confusing, but if we translate
that to the set of villages in which $x=4$ things become much easier
to visualize:
%
$$\setofst{(x,y)∈W}{x=4} \;\;=\;\; \picturedots(0,0)(5,4){
              4,3
              4,2
              4,1 }
$$

Note that we have:
%
$$\begin{array}{rclcl}
  P &=& \setofst{(x,y)∈W}{x≤3 ∧ y≥2} &=& \villagesP \\
  Q &=& \setofst{(x,y)∈W}{x≥2 ∧ y≥2} &=& \villagesQ \\
  R &=& \setofst{(x,y)∈W}{2≤x≤3 ∧ y≤2} &=& \villagesR \\
  \end{array}
$$

So, in a sense, $P$ ``is'' $x≤3 ∧ y≥2$. How do the books handle this?
This is a good opportunity to show that 1) some books explain their
abuses of language, 2) other books are simply sloppy, 3)
disambiguation and understanding abuses of language are usually tasks
left to the reader, 4) sometimes we need to invent new notations
ourselves to formalize abuses and sloppiness, 5) some things can be
formalized {\sl sort of} easily if we use dependent variables, 6)
[but] I am not aware of any book that explains the rules for dependent
variables really well, 7) we can look at computer languages to see how
they implement ideas that the books leave underspecified,



% ;-- solving-equations
% «solving-equations»  (to ".solving-equations")
% (bafp 14 "solving-equations")
% (bafa    "solving-equations")

\subsubsection{Solving equations}

% From: (find-angg "MAXIMA/2025-baf-strang.mac")
%
%M (%i1) eq1 : 1*x + 2*y = 3;
%M (%o1) 2\,y+x=3
%M (%i2) eq2 : 4*x + 5*y = 6;
%M (%o2) 5\,y+4\,x=6
%M (%i3) eq3 :         4*eq1;
%M (%o3) 4\,\left(2\,y+x\right)=12
%M (%i4) eq4 :  expand(4*eq1);
%M (%o4) 8\,y+4\,x=12
%M (%i5) eq5 : eq2 - eq4;
%M (%o5) -\left(3\,y\right)=-6
%M (%i6) eq6 : eq5 / -3;
%M (%o6) y=2
%M (%i7) eq7 : subst(eq6, eq1);
%M (%o7) x+4=3
%M (%i8) eq8 : eq7 - 4;
%M (%o8) x=-1
%L
%L maximahead:sa("strang by hand", "")
\pu

%M (%i1) eq1 : 1*x + 2*y = 3;
%M (%o1) 2\,y+x=3
%M (%i2) eq2 : 4*x + 5*y = 6;
%M (%o2) 5\,y+4\,x=6
%M (%i3) solve([eq1,eq2],[x,y]);
%M (%o3) \left[ \left[ x=-1 , y=2 \right]  \right] 
%M (%i4) 
%L
%L maximahead:sa("strang by solve", "")
\pu

Now we can discuss what means ``solving a set of equations'' --
remember that students with bad foundations don't understand that
well; see \cite[p.6]{Hewitt1}. Strang starts his book \cite{Strang4}
with the equations \co{eq1} and \co{eq2} below, and he derives
consequences from them until he reaches $x=-1$, $y=2$; these are two
translations of his argument to Maxima:
%
$$\def\maximavbox#1{\vtop{#1}}
  \def\hboxthreewidth{6cm}
  \scalebox{0.7}{
    \ga{strang by hand}
    \hspace*{-6cm}
    \ga{strang by solve}
  }
$$


\def\eqnp{\eqnpfull}

%V eq1: x + y = 3;
%V eq2: x - y = 1;
%V eq3: eq2+y;
%V eq4: subst(eq3,eq1);
%V eq5: eq4-1;
%V eq6: eq5/2;
%V eq7: subst(eq6,eq1);
%V eq8: eq7-1;
%L
%L defvbt "strang simpler"
\pu

%V eq1: x + y = 3;
%V eq2: x + y = 4;
%L
%L defvbt "strang no solution"
\pu

%V eq1:  x +  y = 4;
%V eq2: 2x + 2y = 8;
%L
%L defvbt "strang whole line"
\pu

We can't spend too much class time on exercises for the students with
the worst foundations, but we need to have a lot of material prepared
for them. Here is an exercise that I find very nice. Now our world has
the set of villages in the left below, and the second column shows how
to solve in Maxima a problem that is simpler than the `$x+2y=3,
4x+5y=6$' from Strang -- but it shows only the commands, not the log
with the input and output lines. The exercise is: a) write the log by
hand; b) complete the third column, that is translation of the
calculations to how we usually write them in Maths;
%
$$W \;=\; \picturedots(0,0)(5,5){
  1,4 2,4 3,4 4,4
  1,3 2,3 3,3 4,3
  1,2 2,2 3,2 4,2
  1,1 2,1 3,1 4,1
  }
  \qquad
  \myvcenter{\vbt{strang simpler}}
  \qquad
  \begin{array}{rcl}
    x+y &\eqnp{1} & 3 \\
    x-y &\eqnp{2} & 1 \\
    \ldots & \eqnp{3} & \ldots \\
    \ldots & \eqnp{4} & \ldots \\
    \ldots & \ldots   & \ldots \\
  \end{array}
$$
%
c) draw the set of worlds that obeys each one of the equations
\co{eq1} to \qco{eq8}, using a complete notation, like this:
%
$$\setofst{(x,y)∈W}{x+y=3}
  \;=\; \picturedots(0,0)(5,5){
  1,2
  2,1
  }
$$
%
d), e) do something similar for the two systems of equations below --
they're harder to understand, so read the next pages of Strang's book:
%
$$\mat{\vbt{strang no solution}\\
       \text{(no solution)}\\
      }
  \qquad
  \mat{\vbt{strang whole line}\\
       \text{(whole line)}\\
      }
$$

\newpage

% ;-- functions-of-xy
% «functions-of-xy»  (to ".functions-of-xy")
% (bafp 18 "functions-of-xy")
% (bafa    "functions-of-xy")

\subsubsection{Functions of $(x,y)$}

Up to this point we only saw one way to draw sets like this one:
%
$$\setofst{(x,y)∈W}{x+y≤4}$$
%
We calculated the result of the comprehension as a set of pairs, and
we drew these pairs. There are other ways, of course -- and one of
these ways is: for each $(x,y)∈W$ we check if $x+y≤4$ is true there or
not, and if that is true we draw a `$$'; if not, we draw nothing.

We can adapt that way to functions of $x$ and $y$ whose results are
not truth values. For example, if we draw the result of $x+y$ centered
on each point $(x,y)∈W$ we get this,
%
% Based on: (c3m251nfp 23 "piramide")
%           (c3m251nfa    "piramide")
%
%L PictBounds.setbounds(v(0,0), v(5,5))
%L fxy_x = Numerozinhos.from(1, 1, [[
%L   1 2 3 4
%L   1 2 3 4
%L   1 2 3 4
%L   1 2 3 4 ]])
%L fxy_y = Numerozinhos.from(1, 1, [[
%L   4 4 4 4
%L   3 3 3 3
%L   2 2 2 2
%L   1 1 1 1 ]])
%L fxy_xy = Numerozinhos.from(1, 1, [[
%L   5 6 7 8
%L   4 5 6 7
%L   3 4 5 6
%L   2 3 4 5 ]])
%L fxy_4 = Numerozinhos.from(1, 1, [[
%L   4 4 4 4
%L   4 4 4 4
%L   4 4 4 4
%L   4 4 4 4 ]])
%L fxy_bool = Numerozinhos.from(1, 1, [[
%L   F F F F
%L   T F F F
%L   T T F F
%L   T T T F ]])
%L fxy_x   :topict():sa("x    on W"):output()
%L fxy_y   :topict():sa("y    on W"):output()
%L fxy_xy  :topict():sa("x+y  on W"):output()
%L fxy_4   :topict():sa("4    on W"):output()
%L fxy_bool:topict():sa("bool on W"):output()
\pu
$$\ga{x+y on W}
$$
%
and this gives us a way to visualize (some) subexpressions, and how
they are combined:
%
$$\def\und#1#2{\underbrace{#1}_{\ga{#2 on W}}}
  \sa{x      _}{\und{x}{x}}
  \sa{y      _}{\und{y}{y}}
  \sa{4      _}{\und{4}{4}}
  \sa{x+y    _}{\und{\ga{x   _}+\ga{y _}}{x+y}}
  \sa{x+y<=4 _}{\und{\ga{x+y _}≤\ga{4 _}}{bool}}
  \setofst{(x,y)∈W}{\ga{x+y<=4 _}}
$$






% ;-- a-game
% «a-game»  (to ".a-game")

\subsection{Making and testing hypotheses: a game}



% ;-- rationale
% <rationale>

\section{rationale}




% https://en.wikipedia.org/wiki/Cooperative_board_game  
  


Set comprehensions are also a good tool for introducing how to make
and test hypotheses. Suppose that a student has found this as the
result of the exercise 2J:

$$[Compr] = [fig]$$

We can rewrite this as:

\begin{tabular}{lll}
  Let S2J = ... \\
  Let S2J' = ... \\
  Hypothesis: S2J = S2J'. \\
  Let's test the point bla. \\
  $bla ∈ S2J?$ (yes) \\
  $bla ∈ S2J'?$ (no) \\
  So $S2J != S2J'$. \\
\end{tabular}


The appendix C shows a way to structure that as a game.


\newpage %-- comprehensions-game

% «comprehensions-game»  (to ".comprehensions-game")
% (bafp 99 "comprehensions-game")
% (bafa    "comprehensions-game")
% https://plato.stanford.edu/entries/logic-games/#SemGam

\section{Comprehensions-game}





% ;-- expressions as trees
% «expressions-as-trees»  (to ".expressions-as-trees")
\subsection{Expressions as trees}

% ;-- proofs-with-justifications
% «proofs-with-justifications»  (to ".proofs-with-justifications")
\subsection{Proofs with justifications}

For example, a student with very bad foundations can write a
``sqrt(3)=20'' on his test and then show me this when reviewing his
grading,

% (%i)  sqrt(3)=20;
% (%o)  sqrt(3)=20;

to try to convince me that sqrt(3)=20 is not an error, {\sl because
Maxima said that that is true}.

% Grade appeal




\cite{RestIsAlgebra}
\cite{McGowen}


%\newpage

% ;-- references
% «references»  (to ".references")

\printbibliography


\GenericWarning{Success:}{Success!!!}  % Used by `M-x cv'

\end{document}

% «make-with-bib»  (to ".make-with-bib")
% (misa "make-arxiv")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/LATEX/

which biber
biber --version
make -f 2019.mk STEM=2025bad-foundations veryclean
lualatex             2025bad-foundations.tex
biber                2025bad-foundations
lualatex             2025bad-foundations.tex

# (find-pdf-page   "~/LATEX/2025bad-foundations.pdf")



% (find-pdfpages2-links "~/LATEX/" "2025bad-foundations")


% Local Variables:
% coding: utf-8-unix
% outline-regexp: "% ;--"
% ee-tla: "baf"
% End: