-
Notifications
You must be signed in to change notification settings - Fork 1k
polymath:0.1.0 #4308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
polymath:0.1.0 #4308
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
|
||
| ## 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| #import "lib.typ": * | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import should use the package specification, e.g. |
||
|
|
||
| #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. | ||
| ] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.