Skip to content
LAM
Read Home Blog
Make Projects HTML Tools Games
Touch grass Notes Resume Links
Home Blog HTML Projects
Tools Games Notes Resume Links
Back The Penguin's Field Guide to Sets, Functions & Proofs Math
Download Open
Show description 2,305 chars · Math

The Penguin's Field Guide to Sets, Functions & Proofs

The Penguin's Field Guide to Sets, Functions & Proofs

The Penguin's Field Guide

Sets · Functions · Sequences · Proofs

🐧 survival kit

Jump To

01 Set Basics
02 Set Operations
03 Power Sets
04 Cartesian Products
05 Functions
06 Floor & Ceiling
07 Sequences & Sums
08 Proof Techniques
09 Cheat Sheet

{ }

Set Basics

📐 What is a Set?

An unordered collection of distinct objects. Order doesn't matter, duplicates collapse.

\(\{1, 2\} = \{2, 1\}\)  ·  \(\{1, 1, 2\} = \{1, 2\}\)

🔢 Counting Elements — Watch the Nesting

Only count top-level elements. Nested sets are single objects.

\(\{0,\ \{1, \{2,3\}\}\}\) has 2 elements: the number \(0\) and the set \(\{1,\{2,3\}\}\)

Don't unpack nested sets. A box containing boxes still counts as one item on the shelf.

∅ vs {∅} — The #1 Trap

This distinction is everywhere on this test.

Symbol
What It Is
Elements

\(\emptyset\)
The empty set
0 elements

\(\{\emptyset\}\)
A set containing the empty set
1 element

Think of \(\emptyset\) as an empty bag. \(\{\emptyset\}\) is a bag with an empty bag inside it — it's not empty.

∈ vs ⊆ — Element vs Subset

Notation
Meaning
Example

\(a \in S\)
\(a\) is an element inside \(S\)
\(1 \in \{1,2\}\) ✓

\(A \subseteq S\)
Every element of \(A\) is in \(S\)
\(\{1\} \subseteq \{1,2\}\) ✓

Memorize
\(\emptyset \subseteq S\) for every set \(S\) (vacuously true — nothing to check).

Memorize
\(\emptyset \in S\) is true only if \(S\) explicitly contains \(\emptyset\) as an element.

Trap
\(\emptyset \in \emptyset\) is false — the empty set has no elements at all.

Subset vs Proper Subset

\(A \subseteq B\): every element of \(A\) is in \(B\)
\(A \subset B\): \(A \subseteq B\) and \(A \neq B\)

Memorize
Every set is a subset of itself: \(A \subseteq A\). No set is a proper subset of itself.

Number Sets Hierarchy

\(\mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}\)

\(\mathbb{Q}\) (rationals) is a proper subset of \(\mathbb{R}\) (reals) because irrationals exist. \(\mathbb{R}\) is NOT a subset of \(\mathbb{Q}\).

Interval Notation

Notation
Meaning
Endpoints

\([a, b]\)
\(a \leq x \leq b\)
Both included

\((a, b)\)
\(a < x < b\)
Both excluded

\([a, b)\)
\(a \leq x < b\)
Left in, right out

\((a, b]\)
\(a < x \leq b\)
Left out, right in

\([1,2]\) is a set. "\(1 \leq x \leq 2\)" is a statement.…

The Penguin's Field Guide to Sets, Functions & Proofs

38,568 bytes · HTML source
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Penguin's Field Guide to Sets, Functions & Proofs</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;600;800&family=JetBrains+Mono:wght@400;600&family=Fraunces:opsz,wght@9..144,400;9..144,700&display=swap" rel="stylesheet">
<style>
:root {
  --bg: #0c0e13;
  --surface: #14171f;
  --surface2: #1a1e28;
  --border: #262b38;
  --text: #e2e4ea;
  --text-dim: #8a8fa3;
  --accent: #6ee7b7;
  --accent2: #34d399;
  --accent-dim: rgba(110,231,183,0.1);
  --warm: #fbbf24;
  --pink: #f472b6;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --red: #fb7185;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Bricolage Grotesque', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
.noise {
  position: fixed; top:0; left:0; width:100%; height:100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999;
}

/* HERO */
.hero {
  min-height: 60vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 50% 60%, rgba(110,231,183,0.08) 0%, transparent 50%),
              radial-gradient(circle at 30% 30%, rgba(164,139,250,0.05) 0%, transparent 40%);
  animation: drift 20s ease-in-out infinite alternate;
}
@keyframes drift { 0%{transform:translate(0,0)} 100%{transform:translate(-30px,20px)} }
.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  background: linear-gradient(135deg, var(--accent), var(--blue), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .sub {
  font-size: 1.15rem; color: var(--text-dim); margin-top: 1rem;
  position: relative;
}
.hero .badge {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.4rem 1.2rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  position: relative;
}

/* NAV */
.toc {
  max-width: 900px; margin: 0 auto 3rem; padding: 0 1.5rem;
}
.toc h2 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text-dim); margin-bottom: 1rem;
}
.toc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 0.5rem;
}
.toc-grid a {
  display: block; padding: 0.65rem 1rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.9rem;
  transition: all 0.2s;
}
.toc-grid a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.toc-grid a span { color: var(--text-dim); font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; margin-right: 0.4rem; }

/* SECTIONS */
.content { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 4rem; }
section {
  margin-bottom: 3rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  animation: fadeUp 0.4s ease both;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
section .sec-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
}
section .sec-header .icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
section .sec-header h2 {
  font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700;
}
section .sec-body { padding: 1.5rem 2rem; }

/* CARDS */
.card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(110,231,183,0.3); }
.card h3 {
  font-size: 1rem; font-weight: 600; color: var(--accent); margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.card p, .card li { font-size: 0.95rem; color: var(--text); line-height: 1.8; }
.card ul { padding-left: 1.2rem; margin-top: 0.4rem; }
.card ul li { margin-bottom: 0.3rem; }
.card ul li::marker { color: var(--accent); }

/* FORMULA BOX */
.formula-box {
  background: linear-gradient(135deg, rgba(110,231,183,0.06), rgba(96,165,250,0.06));
  border: 1px solid rgba(110,231,183,0.2);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin: 0.75rem 0;
  font-size: 1.1rem;
  text-align: center;
}

/* RULE */
.rule {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rule:last-child { border-bottom: none; }
.rule .tag {
  flex-shrink: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.tag-mem { background: rgba(251,191,36,0.15); color: var(--warm); }
.tag-trap { background: rgba(244,114,182,0.15); color: var(--pink); }
.tag-def { background: rgba(96,165,250,0.15); color: var(--blue); }
.tag-form { background: rgba(110,231,183,0.15); color: var(--accent); }

/* WARN */
.warn {
  background: rgba(251,59,59,0.06);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1.2rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--red);
}

/* TIP */
.tip {
  background: rgba(110,231,183,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1.2rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

/* EXAMPLE TABLE */
.ex-table { width:100%; border-collapse:collapse; margin:0.75rem 0; font-size:0.9rem; }
.ex-table th { text-align:left; padding:0.5rem 0.75rem; border-bottom:2px solid var(--border); color:var(--text-dim); font-weight:600; font-size:0.8rem; text-transform:uppercase; letter-spacing:0.05em; }
.ex-table td { padding:0.5rem 0.75rem; border-bottom:1px solid var(--border); }
.ex-table tr:last-child td { border-bottom:none; }
.ex-table .yes { color: var(--accent); }
.ex-table .no { color: var(--red); }

/* FOOTER */
.footer {
  text-align:center; padding:3rem 1rem; color:var(--text-dim); font-size:0.85rem;
  border-top:1px solid var(--border);
  max-width:900px; margin:0 auto;
}

/* COLOR OVERRIDES FOR SECTION ICONS */
.icon-sets { background: rgba(110,231,183,0.12); color: var(--accent); }
.icon-ops { background: rgba(96,165,250,0.12); color: var(--blue); }
.icon-power { background: rgba(167,139,250,0.12); color: var(--purple); }
.icon-cart { background: rgba(251,191,36,0.12); color: var(--warm); }
.icon-func { background: rgba(244,114,182,0.12); color: var(--pink); }
.icon-floor { background: rgba(251,191,36,0.12); color: var(--warm); }
.icon-seq { background: rgba(96,165,250,0.12); color: var(--blue); }
.icon-proof { background: rgba(251,59,59,0.12); color: var(--red); }

.mjx-chtml { font-size: 105% !important; }

@media(max-width:640px) {
  section .sec-header, section .sec-body { padding: 1rem 1.25rem; }
  .card { padding: 1rem; }
}
</style>
</head>
<body>
<div class="noise"></div>

<!-- HERO -->
<header class="hero">
  <h1>The Penguin's Field Guide</h1>
  <p class="sub">Sets · Functions · Sequences · Proofs</p>
  <div class="badge">🐧 survival kit</div>
</header>

<!-- TOC -->
<nav class="toc">
  <h2>Jump To</h2>
  <div class="toc-grid">
    <a href="#sets"><span>01</span> Set Basics</a>
    <a href="#ops"><span>02</span> Set Operations</a>
    <a href="#power"><span>03</span> Power Sets</a>
    <a href="#cart"><span>04</span> Cartesian Products</a>
    <a href="#func"><span>05</span> Functions</a>
    <a href="#floor"><span>06</span> Floor &amp; Ceiling</a>
    <a href="#seq"><span>07</span> Sequences &amp; Sums</a>
    <a href="#proof"><span>08</span> Proof Techniques</a>
    <a href="#cheat"><span>09</span> Cheat Sheet</a>
  </div>
</nav>

<main class="content">

<!-- ============== 1. SET BASICS ============== -->
<section id="sets">
  <div class="sec-header">
    <div class="icon icon-sets">{ }</div>
    <h2>Set Basics</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>📐 What is a Set?</h3>
      <p>An <strong>unordered</strong> collection of distinct objects. Order doesn't matter, duplicates collapse.</p>
      <div class="formula-box">
        \(\{1, 2\} = \{2, 1\}\) &nbsp;·&nbsp; \(\{1, 1, 2\} = \{1, 2\}\)
      </div>
    </div>

    <div class="card">
      <h3>🔢 Counting Elements — Watch the Nesting</h3>
      <p>Only count <em>top-level</em> elements. Nested sets are single objects.</p>
      <div class="formula-box">
        \(\{0,\ \{1, \{2,3\}\}\}\) has <strong>2 elements</strong>: the number \(0\) and the set \(\{1,\{2,3\}\}\)
      </div>
      <div class="warn">Don't unpack nested sets. A box containing boxes still counts as one item on the shelf.</div>
    </div>

    <div class="card">
      <h3>∅ vs {∅} — The #1 Trap</h3>
      <p>This distinction is <strong>everywhere</strong> on this test.</p>
      <table class="ex-table">
        <tr><th>Symbol</th><th>What It Is</th><th>Elements</th></tr>
        <tr><td>\(\emptyset\)</td><td>The empty set</td><td>0 elements</td></tr>
        <tr><td>\(\{\emptyset\}\)</td><td>A set containing the empty set</td><td>1 element</td></tr>
      </table>
      <div class="tip">Think of \(\emptyset\) as an empty bag. \(\{\emptyset\}\) is a bag with an empty bag inside it — it's <em>not</em> empty.</div>
    </div>

    <div class="card">
      <h3>∈ vs ⊆ — Element vs Subset</h3>
      <table class="ex-table">
        <tr><th>Notation</th><th>Meaning</th><th>Example</th></tr>
        <tr><td>\(a \in S\)</td><td>\(a\) is an element inside \(S\)</td><td>\(1 \in \{1,2\}\) ✓</td></tr>
        <tr><td>\(A \subseteq S\)</td><td>Every element of \(A\) is in \(S\)</td><td>\(\{1\} \subseteq \{1,2\}\) ✓</td></tr>
      </table>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>\(\emptyset \subseteq S\) for <strong>every</strong> set \(S\) (vacuously true — nothing to check).</span>
      </div>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>\(\emptyset \in S\) is true <strong>only if</strong> \(S\) explicitly contains \(\emptyset\) as an element.</span>
      </div>
      <div class="rule">
        <span class="tag tag-trap">Trap</span>
        <span>\(\emptyset \in \emptyset\) is <strong>false</strong> — the empty set has no elements at all.</span>
      </div>
    </div>

    <div class="card">
      <h3>Subset vs Proper Subset</h3>
      <div class="formula-box">
        \(A \subseteq B\): every element of \(A\) is in \(B\)<br>
        \(A \subset B\): \(A \subseteq B\) <strong>and</strong> \(A \neq B\)
      </div>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>Every set is a subset of itself: \(A \subseteq A\). No set is a <em>proper</em> subset of itself.</span>
      </div>
    </div>

    <div class="card">
      <h3>Number Sets Hierarchy</h3>
      <div class="formula-box">
        \(\mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}\)
      </div>
      <p>\(\mathbb{Q}\) (rationals) is a proper subset of \(\mathbb{R}\) (reals) because irrationals exist. \(\mathbb{R}\) is NOT a subset of \(\mathbb{Q}\).</p>
    </div>

    <div class="card">
      <h3>Interval Notation</h3>
      <table class="ex-table">
        <tr><th>Notation</th><th>Meaning</th><th>Endpoints</th></tr>
        <tr><td>\([a, b]\)</td><td>\(a \leq x \leq b\)</td><td>Both included</td></tr>
        <tr><td>\((a, b)\)</td><td>\(a < x < b\)</td><td>Both excluded</td></tr>
        <tr><td>\([a, b)\)</td><td>\(a \leq x < b\)</td><td>Left in, right out</td></tr>
        <tr><td>\((a, b]\)</td><td>\(a < x \leq b\)</td><td>Left out, right in</td></tr>
      </table>
      <div class="warn">\([1,2]\) is a <strong>set</strong>. "\(1 \leq x \leq 2\)" is a <strong>statement</strong>. They are NOT equal — different types of objects.</div>
    </div>

    <div class="card">
      <h3>\(\mathbb{Z}^2\) — Integer Grid</h3>
      <p>\(\mathbb{Z}^2 = \mathbb{Z} \times \mathbb{Z}\) = all points \((x,y)\) where both coordinates are integers. Visualize it as the infinite lattice grid on the plane.</p>
    </div>

  </div>
</section>

<!-- ============== 2. SET OPERATIONS ============== -->
<section id="ops">
  <div class="sec-header">
    <div class="icon icon-ops">∪</div>
    <h2>Set Operations</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>Core Operations</h3>
      <table class="ex-table">
        <tr><th>Operation</th><th>Notation</th><th>Meaning</th></tr>
        <tr><td>Union</td><td>\(A \cup B\)</td><td>Everything in \(A\) or \(B\) (or both)</td></tr>
        <tr><td>Intersection</td><td>\(A \cap B\)</td><td>Only what's in both \(A\) and \(B\)</td></tr>
        <tr><td>Difference</td><td>\(A - B\)</td><td>Elements in \(A\) but not in \(B\)</td></tr>
        <tr><td>Complement</td><td>\(\overline{A}\)</td><td>Everything in \(U\) not in \(A\)</td></tr>
      </table>
    </div>

    <div class="card">
      <h3>Key Identities</h3>
      <div class="rule">
        <span class="tag tag-form">Formula</span>
        <span><strong>Absorption Law:</strong> \(A \cap (A \cup B) = A\)</span>
      </div>
      <div class="rule">
        <span class="tag tag-form">Formula</span>
        <span><strong>Identity:</strong> \(A \cup \emptyset = A\) and \(A \cap \emptyset = \emptyset\)</span>
      </div>
      <div class="rule">
        <span class="tag tag-form">Formula</span>
        <span><strong>Complement of \(U\):</strong> \(\overline{U} = \emptyset\)</span>
      </div>
      <div class="rule">
        <span class="tag tag-form">Formula</span>
        <span><strong>Union with itself:</strong> \(A \cup A = A\) and \(A \cap A = A\)</span>
      </div>
    </div>

    <div class="card">
      <h3>Simplification Tricks</h3>
      <div class="formula-box">
        \(\{∅\} \cup \emptyset = \{∅\}\)
      </div>
      <p>Union with the empty set changes nothing. The empty set adds zero elements.</p>
      <div class="formula-box">
        \((A - B) \cup (A \cap B) \cup (B - A) = A \cup B\)
      </div>
      <p>This decomposes \(A \cup B\) into three disjoint pieces: left-only, overlap, and right-only.</p>
      <div class="formula-box">
        \(B - (A - B) = B\)
      </div>
      <p>\(A - B\) contains things NOT in \(B\), so subtracting them from \(B\) removes nothing.</p>
    </div>

    <div class="card">
      <h3>Disjoint Sets & Complement Pairs</h3>
      <div class="rule">
        <span class="tag tag-def">Def</span>
        <span><strong>Disjoint:</strong> \(A \cap B = \emptyset\) (no shared elements)</span>
      </div>
      <div class="rule">
        <span class="tag tag-def">Def</span>
        <span><strong>Complement pair:</strong> \(A \cap B = \emptyset\) AND \(A \cup B = U\)</span>
      </div>
      <table class="ex-table">
        <tr><th>Pair</th><th>Universal Set</th><th>Complement?</th></tr>
        <tr><td>Positive reals & Negative reals</td><td>\(\mathbb{R}\)</td><td class="no">✗ (miss 0)</td></tr>
        <tr><td>Even integers & Odd integers</td><td>\(\mathbb{Z}\)</td><td class="yes">✓</td></tr>
        <tr><td>Rationals & Irrationals</td><td>\(\mathbb{R}\)</td><td class="yes">✓</td></tr>
      </table>
    </div>

    <div class="card">
      <h3>Union of Intervals</h3>
      <p>When merging intervals, draw them on a number line and find the combined coverage.</p>
      <div class="formula-box">
        \([-1,3] \cup (-2,0) \cup [1,4) = (-2, 4)\)
      </div>
      <div class="tip">Sketch it out. The leftmost starting point and rightmost ending point give you the answer, adjusting for open/closed.</div>
    </div>

    <div class="card">
      <h3>Intersection of Intervals</h3>
      <div class="formula-box">
        \((2,4) \cap (3,5) = (3,4)\) — <strong>infinitely many</strong> elements
      </div>
      <p>Overlapping real-number intervals always have infinitely many points in common.</p>
    </div>

    <div class="card">
      <h3>Complement of an Interval</h3>
      <p>Example: Universal set \(= [0,2]\), find \(\overline{(0,1)}\).</p>
      <div class="formula-box">
        \(\overline{(0,1)} = \{0\} \cup [1,2]\)
      </div>
      <p>\(0\) is in \([0,2]\) but not in \((0,1)\) — it's an isolated point. Everything from \(1\) to \(2\) is also excluded from \((0,1)\).</p>
    </div>

    <div class="card">
      <h3>Cardinality of Union</h3>
      <div class="formula-box">
        \(|A \cup B| = |A| + |B| - |A \cap B|\)
      </div>
      <div class="warn">If \(|A|=5\) and \(|B|=7\), the union does NOT necessarily have 12 elements. Overlap gets subtracted.</div>
    </div>

  </div>
</section>

<!-- ============== 3. POWER SETS ============== -->
<section id="power">
  <div class="sec-header">
    <div class="icon icon-power">𝒫</div>
    <h2>Power Sets</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>Definition</h3>
      <p>\(\mathcal{P}(S)\) = the set of ALL subsets of \(S\).</p>
      <div class="formula-box">
        \(|\mathcal{P}(S)| = 2^{|S|}\)
      </div>
      <p>Every element is either in or out of a subset → 2 choices per element → \(2^n\) subsets total.</p>
    </div>

    <div class="card">
      <h3>Critical Examples</h3>
      <table class="ex-table">
        <tr><th>Set</th><th>Power Set</th><th>Size</th></tr>
        <tr><td>\(\emptyset\)</td><td>\(\{\emptyset\}\)</td><td>\(2^0 = 1\)</td></tr>
        <tr><td>\(\{1\}\)</td><td>\(\{\emptyset,\ \{1\}\}\)</td><td>\(2^1 = 2\)</td></tr>
        <tr><td>\(\{1,2\}\)</td><td>\(\{\emptyset,\ \{1\},\ \{2\},\ \{1,2\}\}\)</td><td>\(2^2 = 4\)</td></tr>
      </table>
      <div class="warn">\(\mathcal{P}(\emptyset) = \{\emptyset\} \neq \emptyset\). The power set of the empty set is NOT empty!</div>
    </div>

    <div class="card">
      <h3>Power Set of a Power Set</h3>
      <p>Example: \(\mathcal{P}(\mathcal{P}(\{1\}))\)</p>
      <p>Step 1: \(\mathcal{P}(\{1\}) = \{\emptyset,\ \{1\}\}\) — a 2-element set.</p>
      <p>Step 2: Take all subsets of \(\{\emptyset,\ \{1\}\}\):</p>
      <div class="formula-box">
        \(\mathcal{P}(\mathcal{P}(\{1\})) = \{\emptyset,\ \{\emptyset\},\ \{\{1\}\},\ \{\emptyset, \{1\}\}\}\)
      </div>
      <p>4 elements, as expected from \(2^2 = 4\).</p>
    </div>

    <div class="card">
      <h3>\(\emptyset\) and \(\mathcal{P}(\emptyset)\)</h3>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>\(\emptyset \in \mathcal{P}(\emptyset)\) — <strong>TRUE</strong>. \(\mathcal{P}(\emptyset) = \{\emptyset\}\), and \(\emptyset\) is the element inside.</span>
      </div>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>\(\emptyset \subseteq \mathcal{P}(\emptyset)\) — <strong>TRUE</strong>. \(\emptyset\) is a subset of every set.</span>
      </div>
    </div>

  </div>
</section>

<!-- ============== 4. CARTESIAN PRODUCTS ============== -->
<section id="cart">
  <div class="sec-header">
    <div class="icon icon-cart">×</div>
    <h2>Cartesian Products</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>Definition</h3>
      <div class="formula-box">
        \(A \times B = \{(a, b) \mid a \in A,\ b \in B\}\)
      </div>
      <p>All <strong>ordered pairs</strong> with first element from \(A\), second from \(B\). Uses parentheses \((a,b)\), NOT curly braces.</p>
    </div>

    <div class="card">
      <h3>Key Properties</h3>
      <div class="rule">
        <span class="tag tag-form">Formula</span>
        <span>\(|A \times B| = |A| \cdot |B|\)</span>
      </div>
      <div class="rule">
        <span class="tag tag-trap">Trap</span>
        <span>\(A \times B \neq B \times A\) in general. Order matters in ordered pairs: \((1,2) \neq (2,1)\).</span>
      </div>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>\(A \times \emptyset = \emptyset\). Can't form pairs if one set is empty.</span>
      </div>
    </div>

    <div class="card">
      <h3>Example</h3>
      <div class="formula-box">
        \(\{1,2\} \times \{1,3\} = \{(1,1),\ (1,3),\ (2,1),\ (2,3)\}\)
      </div>
      <p>4 pairs because \(2 \times 2 = 4\). Think of it as a grid: rows are \(A\), columns are \(B\).</p>
    </div>

  </div>
</section>

<!-- ============== 5. FUNCTIONS ============== -->
<section id="func">
  <div class="sec-header">
    <div class="icon icon-func">ƒ</div>
    <h2>Functions</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>Injective (One-to-One)</h3>
      <div class="formula-box">
        \(f(a) = f(b) \implies a = b\)
      </div>
      <p>Different inputs → different outputs. No two inputs land on the same output.</p>
      <div class="warn">To PROVE injectivity: start with "Suppose \(f(a) = f(b)\)" and derive \(a = b\). Do NOT prove the converse (\(a=b \implies f(a)=f(b)\)) — that's always true and proves nothing.</div>
    </div>

    <div class="card">
      <h3>Surjective (Onto)</h3>
      <div class="formula-box">
        \(\forall y \in B,\ \exists x \in A : f(x) = y\)
      </div>
      <p>Every element of the <strong>codomain</strong> is hit. Range = Codomain.</p>
      <div class="tip">To make any function surjective, redefine its codomain to equal its range.</div>
    </div>

    <div class="card">
      <h3>Bijective = Injective + Surjective</h3>
      <p>Perfect one-to-one correspondence. Every input maps to a unique output, and every output is covered.</p>
    </div>

    <div class="card">
      <h3>\(f(x) = x^2\) — The Most Tested Function</h3>
      <table class="ex-table">
        <tr><th>Domain → Codomain</th><th>Injective?</th><th>Surjective?</th></tr>
        <tr><td>\(\mathbb{R} \to \mathbb{R}\)</td><td class="no">✗ f(-1)=f(1)</td><td class="no">✗ negatives missed</td></tr>
        <tr><td>\([0,\infty) \to \mathbb{R}\);  \(x^2+1\)</td><td class="yes">✓ strictly increasing</td><td class="no">✗ range=[1,∞)</td></tr>
        <tr><td>\([-2,2] \to [0,4]\)</td><td class="no">✗ f(-2)=f(2)</td><td class="yes">✓ range=[0,4]</td></tr>
        <tr><td>\([-2,0) \to [0,4]\)</td><td class="yes">✓ strictly decreasing</td><td class="no">✗ 0 not in range</td></tr>
        <tr><td>\([0,1] \to \mathbb{R}\)</td><td class="yes">✓ (Sun's proof)</td><td class="no">✗ negatives missed</td></tr>
        <tr><td>\([-1,0] \to [0,1]\)</td><td class="yes">✓</td><td class="yes">✓ bijective!</td></tr>
      </table>
      <div class="tip">Always check injectivity and surjectivity relative to the GIVEN domain and codomain, not the formula in general.</div>
    </div>

    <div class="card">
      <h3>Image and Preimage</h3>
      <div class="formula-box">
        \(f(S) = \{f(x) : x \in S\}\) — "where does \(f\) send the set \(S\)?"
      </div>
      <div class="formula-box">
        \(f^{-1}(T) = \{x : f(x) \in T\}\) — "what inputs land in \(T\)?"
      </div>
      <p>Example with \(f(x) = x^2\), \(f: \mathbb{R} \to \mathbb{R}\):</p>
      <table class="ex-table">
        <tr><th>Set</th><th>Result</th><th>Why</th></tr>
        <tr><td>\(f((-1,1))\)</td><td>\([0,1)\)</td><td>0 achieved at \(x=0\), approaching 1 but never hitting it</td></tr>
        <tr><td>\(f^{-1}((0,1])\)</td><td>\([-1,0) \cup (0,1]\)</td><td>Need \(0 < x^2 \leq 1\), exclude \(x=0\), include \(x=\pm1\)</td></tr>
        <tr><td>\(|x|^{-1}([-2,1))\)</td><td>\((-1,1)\)</td><td>\(|x| \geq 0\) always, so effective constraint is \(|x| < 1\)</td></tr>
      </table>
    </div>

    <div class="card">
      <h3>Monotonicity</h3>
      <table class="ex-table">
        <tr><th>Property</th><th>Definition</th></tr>
        <tr><td>Increasing</td><td>\(a \leq b \implies f(a) \leq f(b)\)</td></tr>
        <tr><td>Strictly increasing</td><td>\(a < b \implies f(a) < f(b)\)</td></tr>
        <tr><td>Decreasing</td><td>\(a \leq b \implies f(a) \geq f(b)\)</td></tr>
        <tr><td>Strictly decreasing</td><td>\(a < b \implies f(a) > f(b)\)</td></tr>
      </table>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>Strictly increasing/decreasing → always injective (no two inputs can share an output).</span>
      </div>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>A <strong>constant</strong> function is increasing AND decreasing (non-strict), but NOT strictly either.</span>
      </div>
    </div>

    <div class="card">
      <h3>Single-Element Domain: \(f: \{0\} \to \{0\}\)</h3>
      <p>This function is: increasing ✓, strictly increasing ✓, decreasing ✓, strictly decreasing ✓, constant ✓, injective ✓, surjective ✓.</p>
      <div class="tip"><strong>Vacuous truth:</strong> "for all \(a < b\) in the domain..." — with one element, there are NO such pairs, so EVERY condition is vacuously satisfied.</div>
    </div>

    <div class="card">
      <h3>Fixing Injectivity / Surjectivity</h3>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>To fix non-injective: <strong>restrict the domain</strong> (remove colliding inputs).</span>
      </div>
      <div class="rule">
        <span class="tag tag-mem">Memorize</span>
        <span>To fix non-surjective: <strong>redefine codomain = range</strong>.</span>
      </div>
      <div class="warn">Changing the codomain does NOT affect injectivity. Changing the domain does NOT automatically give surjectivity.</div>
    </div>

  </div>
</section>

<!-- ============== 6. FLOOR & CEILING ============== -->
<section id="floor">
  <div class="sec-header">
    <div class="icon icon-floor">⌊⌉</div>
    <h2>Floor &amp; Ceiling Functions</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>Definitions</h3>
      <div class="formula-box">
        \(\lfloor x \rfloor\) = greatest integer \(\leq x\) (round down)<br>
        \(\lceil x \rceil\) = smallest integer \(\geq x\) (round up)
      </div>
    </div>

    <div class="card">
      <h3>⭐ Inequality Rules — Memorize These</h3>
      <table class="ex-table">
        <tr><th>Floor</th><th>Equivalent</th></tr>
        <tr><td>\(\lfloor t \rfloor \geq n\)</td><td>\(t \geq n\)</td></tr>
        <tr><td>\(\lfloor t \rfloor \leq n\)</td><td>\(t < n + 1\)</td></tr>
        <tr><td>\(\lfloor t \rfloor > n\)</td><td>\(t \geq n + 1\)</td></tr>
        <tr><td>\(\lfloor t \rfloor < n\)</td><td>\(t < n\)</td></tr>
      </table>
      <table class="ex-table" style="margin-top:1rem">
        <tr><th>Ceiling</th><th>Equivalent</th></tr>
        <tr><td>\(\lceil t \rceil \geq n\)</td><td>\(t > n - 1\)</td></tr>
        <tr><td>\(\lceil t \rceil \leq n\)</td><td>\(t \leq n\)</td></tr>
        <tr><td>\(\lceil t \rceil > n\)</td><td>\(t > n\)</td></tr>
        <tr><td>\(\lceil t \rceil < n\)</td><td>\(t \leq n - 1\)</td></tr>
      </table>
    </div>

    <div class="card">
      <h3>Worked Example: \(1 \leq \lfloor 2x+1 \rfloor \leq 6\)</h3>
      <p>Left: \(\lfloor 2x+1 \rfloor \geq 1 \implies 2x+1 \geq 1 \implies x \geq 0\)</p>
      <p>Right: \(\lfloor 2x+1 \rfloor \leq 6 \implies 2x+1 < 7 \implies x < 3\)</p>
      <div class="formula-box">Answer: \([0, 3)\)</div>
    </div>

    <div class="card">
      <h3>Worked Example: \(1 < \lceil 2x+1 \rceil < 6\)</h3>
      <p>Left: \(\lceil 2x+1 \rceil > 1 \implies 2x+1 > 1 \implies x > 0\)</p>
      <p>Right: \(\lceil 2x+1 \rceil < 6 \implies 2x+1 \leq 5 \implies x \leq 2\)</p>
      <div class="formula-box">Answer: \((0, 2]\) or \((0, 5/2]\) depending on exact problem form</div>
    </div>

    <div class="card">
      <h3>Image of Ceiling Function</h3>
      <p>Ceiling maps intervals to discrete integer sets:</p>
      <div class="formula-box">
        \(\lceil (1/2,\ 3/2) \rceil = \{1, 2\}\)
      </div>
      <p>Values in \((1/2, 1]\) map to 1, values in \((1, 3/2)\) map to 2.</p>
    </div>

    <div class="card">
      <h3>Common Trap</h3>
      <div class="warn">\(\lfloor ab \rfloor \neq \lfloor a \rfloor \lfloor b \rfloor\). Counterexample: \(a = b = 1.5\). \(\lfloor 2.25 \rfloor = 2\) but \(\lfloor 1.5 \rfloor \cdot \lfloor 1.5 \rfloor = 1\).</div>
    </div>

  </div>
</section>

<!-- ============== 7. SEQUENCES & SUMS ============== -->
<section id="seq">
  <div class="sec-header">
    <div class="icon icon-seq">Σ</div>
    <h2>Sequences &amp; Summations</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>Arithmetic vs Geometric</h3>
      <table class="ex-table">
        <tr><th>Type</th><th>Pattern</th><th>Test</th></tr>
        <tr><td>Arithmetic</td><td>Constant <strong>difference</strong></td><td>\(a_{n+1} - a_n = d\)</td></tr>
        <tr><td>Geometric</td><td>Constant <strong>ratio</strong></td><td>\(a_{n+1} / a_n = r\)</td></tr>
      </table>
      <div class="formula-box">
        \(a_n = 2 + 5n\) → arithmetic, \(d = 5\)<br>
        \(a_n = 3 \cdot 11^n\) → geometric, \(r = 11\)
      </div>
      <div class="tip">In \(a_n = 2 + 5n\), the "2" is the starting offset, not the common difference. The coefficient of \(n\) is \(d\). In \(3 \cdot 11^n\), the "3" is a scaling factor, not the ratio.</div>
    </div>

    <div class="card">
      <h3>Summation Formulas</h3>
      <div class="rule">
        <span class="tag tag-form">Formula</span>
        <span><strong>Sum of first \(n\) integers:</strong> \(\displaystyle\sum_{k=1}^{n} k = \frac{n(n+1)}{2}\)</span>
      </div>
      <div class="rule">
        <span class="tag tag-form">Formula</span>
        <span><strong>Sum of first \(n\) squares:</strong> \(\displaystyle\sum_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6}\)</span>
      </div>
      <div class="rule">
        <span class="tag tag-form">Formula</span>
        <span><strong>Geometric sum:</strong> \(\displaystyle\sum_{k=0}^{n} r^k = \frac{r^{n+1} - 1}{r - 1}\) for \(r \neq 1\)</span>
      </div>
    </div>

    <div class="card">
      <h3>Partial Sums via Subtraction</h3>
      <p>Sum from \(a\) to \(b\) = (sum from 1 to \(b\)) − (sum from 1 to \(a-1\)).</p>
      <div class="formula-box">
        \(\displaystyle\sum_{k=1000}^{5000} k = \frac{5000 \cdot 5001}{2} - \frac{999 \cdot 1000}{2}\)
      </div>
      <div class="warn">Subtract up to \(a-1 = 999\), NOT \(a = 1000\). You want 1000 included.</div>
    </div>

    <div class="card">
      <h3>Evaluating Geometric Sums (example: \(3^4 + \cdots + 3^9\))</h3>
      <p><strong>Valid methods:</strong></p>
      <ul>
        <li>Subtract two full geometric sums: \((3^0 + \cdots + 3^9) - (3^0 + \cdots + 3^3)\)</li>
        <li>Factor out: \(3^4(3^0 + 3^1 + \cdots + 3^5)\) then use geometric formula</li>
        <li>Brute force: \(81 + 243 + 729 + 2187 + 6561 + 19683 = 29484\)</li>
      </ul>
      <div class="warn"><strong>INVALID:</strong> Adding exponents. \(3^4 + 3^5 \neq 3^9\). Exponent rules apply to multiplication, NOT addition.</div>
    </div>

    <div class="card">
      <h3>Index Shifting</h3>
      <p>To shift \(\sum_{k=a}^{b}\) so it starts at \(k=0\): substitute \(k \to k + a\) everywhere, new bounds go from 0 to \(b-a\).</p>
    </div>

  </div>
</section>

<!-- ============== 8. PROOFS ============== -->
<section id="proof">
  <div class="sec-header">
    <div class="icon icon-proof">∎</div>
    <h2>Proof Techniques</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>Universal Statements: \(\forall x,\ P(x)\)</h3>
      <p>Start with: <strong>"Let \(x\) be an arbitrary [element of domain]."</strong></p>
      <p>Then prove \(P(x)\) holds for this arbitrary \(x\).</p>
      <div class="warn">NEVER prove by example. Showing \(P(1)\) does NOT prove \(\forall x, P(x)\). One example only works for existential statements.</div>
    </div>

    <div class="card">
      <h3>Existential Statements: \(\exists x,\ P(x)\)</h3>
      <p>Strategy: <strong>exhibit a specific witness</strong> and verify it works.</p>
      <p>Example: Prove \(\exists x \forall y (x + y = y)\).</p>
      <p>"Let \(x = 0\). Then for any \(y\), \(x + y = 0 + y = y\). ∎"</p>
      <div class="warn">Do NOT start with "Suppose \(P(x)\) for some \(x\)" — that assumes what you're proving!</div>
    </div>

    <div class="card">
      <h3>Mixed Quantifiers: \(\forall x \exists y,\ P(x,y)\)</h3>
      <p>Structure:</p>
      <ol style="padding-left:1.2rem; margin-top:0.5rem">
        <li>"Let \(x\) be an arbitrary [element]." (handle the ∀)</li>
        <li>"Let \(y = \text{[expression depending on } x\text{]}.\)" (provide the ∃ witness)</li>
        <li>Verify that \(P(x, y)\) holds.</li>
      </ol>
      <p style="margin-top:0.75rem"><strong>Example:</strong> Prove \(\forall x \exists y\ (y < 2x+1 \text{ and } y \text{ is odd})\).</p>
      <p>1. "Let \(x\) be an arbitrary integer."</p>
      <p>2. "Let \(y = 2x - 1\)."</p>
      <p>3. "Then \(y = 2x - 1 < 2x + 1\), and \(y = 2(x-1)+1\) is odd since it's one more than an even number. ∎"</p>
    </div>

    <div class="card">
      <h3>Common Proof Mistakes</h3>
      <div class="rule">
        <span class="tag tag-trap">Trap</span>
        <span><strong>"Therefore"</strong> before defining a variable. You CHOOSE \(k\), it doesn't follow logically. Say "Let" or "Choose" instead.</span>
      </div>
      <div class="rule">
        <span class="tag tag-trap">Trap</span>
        <span><strong>Re-quantifying</strong> a fixed variable. Once you say "let \(n\) be an integer," \(n\) is fixed. Don't write "for all integers \(n\)" again.</span>
      </div>
      <div class="rule">
        <span class="tag tag-trap">Trap</span>
        <span><strong>Proving the converse</strong> of injectivity. "\(a = b \implies f(a) = f(b)\)" is trivially true. You need \(f(a) = f(b) \implies a = b\).</span>
      </div>
      <div class="rule">
        <span class="tag tag-trap">Trap</span>
        <span><strong>Assuming what you're proving.</strong> "Suppose \(3n+5=8\) for some \(n\)" assumes a solution exists. Instead, exhibit \(n=1\) and verify.</span>
      </div>
      <div class="rule">
        <span class="tag tag-trap">Trap</span>
        <span><strong>Weak conclusion.</strong> "This proves an integer \(k\) exists" is incomplete. State the full theorem in the conclusion.</span>
      </div>
    </div>

    <div class="card">
      <h3>The "Even Integer in an Interval" Proof</h3>
      <p>Statement: For all positive integers \(n\), there exists an even integer \(k\) such that \(n - 1/n < k < n + 2 + 1/n\).</p>
      <div class="tip">
        <strong>Key insight:</strong> The interval has length \(2 + 2/n > 2\). Any interval of length greater than 2 must contain an even integer. Choose \(k = n+1\) if \(n\) is odd (making \(k\) even), or \(k = n\) or \(k = n+2\) if \(n\) is even.
      </div>
    </div>

  </div>
</section>

<!-- ============== 9. CHEAT SHEET ============== -->
<section id="cheat">
  <div class="sec-header">
    <div class="icon" style="background:rgba(251,191,36,0.12);color:var(--warm);">⚡</div>
    <h2>Quick-Fire Cheat Sheet</h2>
  </div>
  <div class="sec-body">

    <div class="card">
      <h3>True / False Speed Round</h3>
      <table class="ex-table">
        <tr><th>Statement</th><th>Answer</th></tr>
        <tr><td>\(\emptyset \in \emptyset\)</td><td class="no">False</td></tr>
        <tr><td>\(\emptyset \subseteq \emptyset\)</td><td class="yes">True</td></tr>
        <tr><td>\(\emptyset \in \mathcal{P}(\emptyset)\)</td><td class="yes">True</td></tr>
        <tr><td>\(\emptyset \subseteq \mathcal{P}(\emptyset)\)</td><td class="yes">True</td></tr>
        <tr><td>\(\{\emptyset\} = \emptyset\)</td><td class="no">False</td></tr>
        <tr><td>\(\{1,2\} = \{2,1\}\)</td><td class="yes">True</td></tr>
        <tr><td>\(A \times B = B \times A\)</td><td class="no">False (in general)</td></tr>
        <tr><td>\(A \subseteq A\)</td><td class="yes">True (always)</td></tr>
        <tr><td>\(A \subset A\)</td><td class="no">False (always)</td></tr>
        <tr><td>\(\overline{U} = \emptyset\)</td><td class="yes">True</td></tr>
        <tr><td>\(\lfloor ab \rfloor = \lfloor a \rfloor \lfloor b \rfloor\)</td><td class="no">False</td></tr>
        <tr><td>\(\sum k^2 = n(n+1)(2n+1)/6\)</td><td class="yes">True</td></tr>
      </table>
    </div>

    <div class="card">
      <h3>Formulas at a Glance</h3>
      <div class="formula-box">
        \(|\mathcal{P}(A)| = 2^{|A|}\) &nbsp;&nbsp;·&nbsp;&nbsp; \(|A \times B| = |A| \cdot |B|\) &nbsp;&nbsp;·&nbsp;&nbsp; \(|A \cup B| = |A| + |B| - |A \cap B|\)
      </div>
      <div class="formula-box">
        \(\displaystyle\sum_{k=1}^n k = \frac{n(n+1)}{2}\) &nbsp;&nbsp;·&nbsp;&nbsp; \(\displaystyle\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}\) &nbsp;&nbsp;·&nbsp;&nbsp; \(\displaystyle\sum_{k=0}^n r^k = \frac{r^{n+1}-1}{r-1}\)
      </div>
    </div>

    <div class="card">
      <h3>Proof Starters</h3>
      <table class="ex-table">
        <tr><th>Quantifier</th><th>Start With</th></tr>
        <tr><td>\(\forall x\)</td><td>"Let \(x\) be an arbitrary..."</td></tr>
        <tr><td>\(\exists x\)</td><td>"Let \(x = \text{[specific value]}\)."</td></tr>
        <tr><td>\(\forall x \exists y\)</td><td>"Let \(x\) be arbitrary. Let \(y = \text{[expr with } x\text{]}.\)"</td></tr>
        <tr><td>\(\exists x \forall y\)</td><td>"Let \(x = \text{[value]}\). Then for any \(y\)..."</td></tr>
      </table>
    </div>

  </div>
</section>

</main>

<footer class="footer">
  MAT 243 · Discrete Mathematics · Built for Lalo 🐧
</footer>

</body>
</html>