Skip to content

Commit

Permalink
lcc.cls: soporte para pruebas calculacionales
Browse files Browse the repository at this point in the history
  • Loading branch information
mtzguido committed Nov 5, 2022
1 parent 0177e53 commit ed91d64
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lcc.cls
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,21 @@ Por cualquier problema/mejora, ir a https://github.com/mtzguido/lcc.cls]
}
}

% Sintaxis para pruebas calculacionales.
\NewEnviron{calc}
{
\begingroup
\allowdisplaybreaks
\begin{align*}
\BODY
\end{align*}
\endgroup
}
\newcommand{\formO}[1]{& #1}
\newcommand{\justO}[2]{#1 \qquad & \left \langle \, \text{#2} \, \right \rangle}
\newcommand{\form}[1]{& #1 \\*}
\newcommand{\just}[2]{#1 \qquad & \left \langle \, \text{#2} \, \right \rangle \\*}

% Creado a partir de unr.jpg, convirtiendo a SVG con una herramienta online
% y luego manualmente a esta invocación tikz.
% TODO: automatizar, y conseguir un SVG *OFICIAL* desde la UNR.
Expand Down
23 changes: 23 additions & 0 deletions template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,27 @@ \section{Una Sección}
con cosas complejas dentro del cuerpo. En ese caso, usá el entorno.
\end{nota}
\begin{ejemplo}[(Una prueba calculacional à la Dijkstra)]
Demostramos por inducción que la famosa propiedad de que
$\left(\sum_{i=1}^n i^3\right) = \left(\sum_{i=1}^n i\right)^2$.
El caso base ($n = 1$) es trivial. Para el paso inductivo:
\begin{calc}
\form{\left(\sum_{i=1}^{n+1} i\right)^2}
\just{=}{extraer sumando}
\form{\left((n+1) + \sum_{i=1}^n i\right)^2}
\just{=}{binomio de Newton}
\form{(n+1)^2 + 2(n+1)\left(\sum_{i=1}^n i\right) + \left(\sum_{i=1}^n i\right)^2}
\just{=}{$\sum_{i=1}^n i = n(n+1)/2$}
\form{(n+1)^2 + (n+1)n(n+1) + \left(\sum_{i=1}^n i\right)^2}
\just{=}{H.I., expandir}
\form{n^2 + 2n + 1 + n^3 + 2n^2 + n + \left(\sum_{i=1}^n i^3\right)}
\just{=}{arimética}
\form{n^3 + 3n^2 + 3n + 1 + \left(\sum_{i=1}^n i^3\right)}
\just{=}{binomio de Newton}
\form{(n+1)^3 + \left(\sum_{i=1}^n i^3\right)}
\just{=}{agrupar}
\form{\left(\sum_{i=1}^{n+1} i^3\right)}
\end{calc}
\end{ejemplo}
\end{document}

0 comments on commit ed91d64

Please sign in to comment.