Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/preview/polymath/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 dhayer200

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
75 changes: 75 additions & 0 deletions packages/preview/polymath/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# polymath

A Typst package for the Renaissance man. Write like Montaigne, typeset math like Axler — structured boxes for theorems, proofs, definitions, conjectures, essays, and notes.

## Usage

```typst
#import "@preview/polymath:0.1.0": *

#show: template

#header(
name: "Kernel and Range",
author: "Your Name",
course: "Math 110 — Linear Algebra",
hw: "3",
date: "March 4, 2026",
professor: "Prof. Smith",
)

#qs(title: [Prove that the additive identity is unique.])[
#prf[
Suppose $0$ and $0'$ are both identities. Then $0 = 0 + 0' = 0'$.
]
]
```

See [`example.typ`](example.typ) for a full working document.
Comment thread
saecki marked this conversation as resolved.

## Functions

### Setup

| Function | Description |
|----------|-------------|
| `template` | Apply page, text, and math styling. Use with `#show: template`. |
| `header(name?, note?, author?, course?, hw?, date?, professor?, ...)` | Page header with note title (`name` or `note`), author, and course metadata. |

### Problem layer

| Function | Description |
|----------|-------------|
| `qs(title?)[ ]` | Numbered question: **1.**, **2.**, … |
| `ex(num?, loc?)[ ]` | Exercise with optional number and location. `#ex(num: 3, loc: [section 2.1])` → *Exercise 3, section 2.1* |
| `eg(title?)[ ]` | Example box. |
| `pt(title?)[ ]` | Lettered part: **a.**, **b.**, …; nests to **i.**, **ii.**, … |
| `ans[ ]` | Answer / solution block. |

### Knowledge layer

| Function | Description |
|----------|-------------|
| `defn(title?)[ ]` | Definition — yellow. |
| `notn(title?)[ ]` | Notation — yellow. |
| `axiom(title?)[ ]` | Axiom — yellow. |
| `postulate(title?)[ ]` | Postulate — yellow. |
| `thm(title?)[ ]` | Theorem — blue. |
| `lemma(title?)[ ]` | Lemma — blue. |
| `prop(title?)[ ]` | Proposition — blue. |
| `cor(title?)[ ]` | Corollary — blue. |
| `conj(title?)[ ]` | Conjecture — amber (unproven). |
| `prf[ ]` | Proof block with flush-right QED mark — green. |
| `note[ ]` | Remark with blue left rule. |

### Essay / Montaigne layer

| Function | Description |
|----------|-------------|
| `aside[ ]` | Tangential digression with grey left rule. |
| `epigraph(attribution?)[ ]` | Centered opening quote, italic, with optional attribution. |
| `blockquote(attribution?)[ ]` | Left-ruled block quote with optional attribution. |

## License

MIT
101 changes: 101 additions & 0 deletions packages/preview/polymath/0.1.0/example.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#import "lib.typ": *

Check warning on line 1 in packages/preview/polymath/0.1.0/example.typ

View check run for this annotation

Typst package check / @preview/polymath:0.1.0

packages/preview/polymath/0.1.0/example.typ#L1

This import should use the package specification, not a relative path.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import should use the package specification, e.g. @preview. This allows directly compiling the code when copying on Typst Universe.


#show: template

#header(
name: "Rank, Nullity, and Injectivity",
author: "Deep Hayer",
course: "Math 110 — Linear Algebra",
date: "March 25, 2026",
professor: "Prof. Sheldon Axler",
)

#epigraph(attribution: [Polymath example])[
A good set of notes should make room for proofs, calculations, and the side
remarks that explain why the proof was worth writing down.
]

#defn(title: [null space and range])[
Let $T : V -> W$ be linear. The _null space_ of $T$ is
$"null" T = {v in V : T(v) = 0}$ and the _range_ of $T$ is
$"range" T = {T(v) : v in V}$.
]

#notn(title: [coordinate maps])[
When $V = RR^n$ and $W = RR^m$, a linear map is often easiest to study by
writing explicit equations for its coordinates.
]

#lemma(title: [injectivity through the null space])[
A linear map $T : V -> W$ is injective if and only if $"null" T = {0}$.
]

#prf[
If $T$ is injective and $v in "null" T$, then $T(v) = 0 = T(0)$, so $v = 0$.
Conversely, if $"null" T = {0}$ and $T(u) = T(v)$, then
$T(u - v) = 0$, hence $u - v = 0$ and $u = v$.
]

#thm(title: [rank-nullity])[
If $V$ is finite-dimensional and $T : V -> W$ is linear, then
$dim V = dim "null" T + dim "range" T$.
]

#cor(title: [dimension blocks injectivity])[
If $dim V > dim W$, then no linear map $T : V -> W$ can be injective.
]

#prf[
If $T$ were injective, then $"null" T = {0}$ by the lemma, so
$dim "null" T = 0$. Rank-nullity would give
$dim V = dim "range" T <= dim W$, a contradiction.
]

#note[
This theorem is valuable because it turns a structural question such as
injective or surjective into a short dimension count.
]

#eg(title: [projection onto the first two coordinates])[
Let $P : RR^3 -> RR^2$ be given by $P(x, y, z) = (x, y)$. Then
$"null" P = {(0, 0, z) : z in RR}$, so $dim "null" P = 1$, and
$"range" P = RR^2$, so $dim "range" P = 2$.
]

#qs(title: [Let $T : RR^3 -> RR^2$ be defined by $T(x, y, z) = (x + y, y + z)$.])[
#pt(title: [Find the null space of $T$.])[
#ans[
We solve
$ x + y = 0 quad and quad y + z = 0. $
Hence $x = -y$ and $z = -y$, so every vector in the null space has the
form $(-t, t, -t)$ for some $t in RR$. Therefore
$ "null" T = {(-t, t, -t) : t in RR}. $
]
]

#pt(title: [Is $T$ injective? Is it surjective?])[
#ans[
The null space is not trivial, so $T$ is not injective.
To show surjectivity, let $(a, b) in RR^2$ and choose $(x, y, z) = (a, 0, b)$.
Then $T(a, 0, b) = (a, b)$, so every vector in $RR^2$ lies in the range.
Thus $T$ is surjective.
]
]
]

#ex(num: 7, loc: [section 3.2])[
#ans[
Suppose $S : RR^2 -> RR^2$ is injective. Then $"null" S = {0}$, so
rank-nullity gives $2 = 0 + dim "range" S$. Hence $dim "range" S = 2$,
which forces $"range" S = RR^2$. Therefore $S$ is surjective.
]
]

#aside[
Coordinate computations are not a retreat from abstraction. They are often
the quickest way to see which dimensions are being forced.
]

#blockquote(attribution: [A margin note to future you])[
When the algebra starts to branch, count dimensions before expanding formulas.
]
Loading
Loading