2-boolean-algebra.ltx 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. \ch{Булевы простейшие операторы и простейшая логика}\label{booleans}
  2. % \ch{Booleans, simple logic, and simple operators}\label{booleans}
  3. Прежде чем мы погрузимся в интересное содержимое раздела, вы должны понять некоторые вещи.
  4. Вещи очень простые. Это будет, наверное, самый короткий и простой параграф в книге.
  5. % ENG
  6. % Before we get into interesting content, you have to understand some stuff. This
  7. % stuff is pretty easy. This will likely be the shortest and easiest chapter in
  8. % the book.
  9. Вы можете думать, что математика про числа и выведение формул. Ну, на самом деле,
  10. это не так. Как сказано в \cref{intro-idris}, математика в основном про использование ее
  11. языка для выражения ваших мыслей. Большинство людей не думают о числах весь день;
  12. но не смотря на это, мы работаем в математике с вещами, которые не являются числами.
  13. % ENG
  14. % You might think math is about dealing with numbers and pumping out
  15. % formulas. Well, that's not what math is about. As said in \cref{intro-idris},
  16. % it's about using math as a language to express your thoughts. Most people don't
  17. % think about numbers all day; thus, we deal with things in math that aren't
  18. % numbers.
  19. В следующем разделе мы рассмотрим некоторые базовые правила для рассуждения о вещах.
  20. Вам нужно знать эти правила, чтобы делать реально крутые вещи. Хотя, как вы увидите (надеюсь)
  21. далее, эти правила могут быть приятными и сами по себе.
  22. % ENG
  23. % In this next section, we're going to outline some basic rules for reasoning
  24. % about things. You need to know these rules to do really cool stuff. Although, as
  25. % you will (hopefully) see, these rules can be fun to toy around with on their
  26. % own.
  27. \input{2/1-basic-logic.ltx}
  28. \input{2/2-more-logic.ltx}
  29. \input{2/3-idris.ltx}
  30. % TODO:
  31. % * Explain more stuff about \lor and \land
  32. % * Explain the first few peano axioms (about equality)
  33. % * Explain the transition of logic.
  34. % * Exercises
  35. % \item $A \notiff B$ means ``Saying $A$ is not the same as saying $B$.'' Remember
  36. % that $A \iff B$ means $\parens{A \implies B} \land \parens{A \impliedby
  37. % B}$.
  38. % Well, $A \notiff B$ means that one of the aforementioned conditions is
  39. % \falsenm. Remember, when dealing with $\land$, if one of the conditions is
  40. % \falsenm, the greater condition is \falsenm.
  41. % Note that in this case, $X$ and $Y$ are whole expressions, like $A = B$. They
  42. % are technically Boolean values, but, as we'll see, that intuition tends to fail
  43. % pretty quickly.
  44. % \sss{Equality}
  45. % Before we go much further, I have to make some remarks about equality of
  46. % things. That is, the use of the $=$ sign, and of the $\ne$ sign. Those signs
  47. % should be read as `equals' and `not equals', respectively. These statements are
  48. % true for things that aren't Booleans, such as numbers. However, in this chapter,
  49. % we are only going to be talking about Booleans.
  50. % \begin{itemize}
  51. % \item For every $A$, it is always true that $A = A$.
  52. % \item For every $A$ and $B$, if $A = B$, then it's true that $B = A$. Using the
  53. % notation above,
  54. % \[ A = B \implies B = A\]
  55. % \item For every $A$ and $B$, and $C$, if $A = B$ and $B = C$, then it's true
  56. % that $A = C$. Using the notation above,
  57. % \[\mset{A = B, B = C} \implies A = C\]
  58. % Because of this, I can write things like $A = B = C$ without
  59. % ambiguity.\footnote{A common critique of this practice has to do with
  60. % associativity. That is, many people read $A = B = C$ as
  61. % $\parens{A = B} = C$. This translates to $A = B \implies C$, which isn't
  62. % what we want. The solution is to not try to group the operators like that,
  63. % or use parentheses when you do want to group them.}
  64. % \end{itemize}
  65. % \begin{itemize}
  66. % \item See if you can decipher this: $\forall A \comma \lnot\parens{A \ne A}$.
  67. % You should read that as ``for all $A$, $A \ne A$ is \falsenm.''
  68. % \item $\forall A,B \comma \parens{A = B} \iff \not \parens{A \ne B}$
  69. % \end{itemize}