-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathexample.typ
More file actions
354 lines (278 loc) · 10.3 KB
/
Copy pathexample.typ
File metadata and controls
354 lines (278 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
#import "/lib.typ": *
// #import cosmos.simple: *
#import cosmos.fancy: *
// #import cosmos.rainbow: *
// #import cosmos.clouds: *
#show: show-theorion
#set page(height: auto)
#set heading(numbering: "1.1")
#set text(lang: "en")
#set par(first-line-indent: 1em, justify: true)
/// 1. Change the counters and numbering:
// #set-inherited-levels(1)
// #set-zero-fill(true)
// #set-leading-zero(true)
// #set-theorion-numbering("1.1")
/// 2. Other options:
// #set-indent-mode(none) // auto (default), none, length or dictionary
// #set-result("noanswer")
// #set-qed-symbol[#math.qed]
/// 3. Custom theorem environment for yourself
// #let (theorem-counter, theorem-box, theorem, show-theorem) = make-frame(
// "theorem",
// "Theorem", // supplement, string or dictionary like `(en: "Theorem")`, or `theorion-i18n-map.at("theorem")` for built-in i18n support
// counter: theorem-counter, // inherit the counter, `none` by default
// inherited-levels: 2, // useful when you need a new counter
// inherited-from: heading, // heading or another counter
// render: (prefix: none, title: "", full-title: auto, body) => [#strong[#full-title.]#sym.space#emph(body)],
// )
// #show: show-theorem
/// 4. Just use it.
// #theorem[Euclid's Theorem][
// There are infinitely many prime numbers.
// ] <thm:euclid>
// #theorem-box[Theorem without numbering][
// This theorem is not numbered.
// ]
/// 5. Example of appendix
// #counter(heading).update(0)
// #set heading(numbering: "A.1")
// #set-theorion-numbering("A.1")
/// 6. Table of contents
// #outline(title: none, target: figure.where(kind: "theorem"))
/// 7. Specify a number or supplement
// #theorem(title: "Euclid's Theorem", number: "233", supplement: [Theorion])[
// There are infinitely many prime numbers.
// ]
/// 8. Counter continuation: use an array number to continue numbering from a specific value
// #theorem(number: (2, 3))[
// This theorem is explicitly numbered 2.3.
// The counter continues from here, so the next auto-numbered theorem is 2.4.
// ]
/// 9. Flexible References via specific supplements. A reference without the title using @label[-]; or one with title and number using @label[!!]
// A reference without the title: @thm:euclid[-]; or one with title and number: @thm:euclid[!!]
/// 10. Custom full-title: override the auto-generated "Prefix Number (Title)" format
// #theorem(full-title: [Fundamental Theorem])[
// There is a fundamental result.
// ]
= Theorion Environments
== Quick Start
```typst
#import "@preview/theorion:0.6.0": *
#import cosmos.fancy: *
// #import cosmos.rainbow: *
// #import cosmos.clouds: *
#show: show-theorion
#theorem[Euclid's Theorem][
There are infinitely many prime numbers.
] <thm:euclid>
#theorem-box(outlined: false)[Theorem without numbering][
This theorem is not numbered.
]
```
== Customization
```typst
// 1. Change the counters and numbering:
#set-inherited-levels(1)
#set-zero-fill(true)
#set-leading-zero(true)
#set-theorion-numbering("1.1")
// 2. Other options:
#set-result("noanswer")
#set-qed-symbol[#math.qed]
// 3. Custom theorem environment for yourself
#let (theorem-counter, theorem-box, theorem, show-theorem) = make-frame(
"theorem",
"Theorem", // supplement, string or dictionary like `(en: "Theorem")`, or `theorion-i18n-map.at("theorem")` for built-in i18n support
counter: theorem-counter, // inherit the old counter, `none` by default
inherited-levels: 2, // useful when you need a new counter
inherited-from: heading, // heading or just another counter
render: (prefix: none, title: "", full-title: auto, body) => [#strong[#full-title.]#sym.space#emph(body)],
)
#show: show-theorem
// 4. Just use it.
#theorem[Euclid's Theorem][
There are infinitely many prime numbers.
] <thm:euclid>
#theorem-box(outlined: false)[Theorem without numbering][
This theorem is not numbered.
]
// 5. Example of appendix
#counter(heading).update(0)
#set heading(numbering: "A.1")
#set-theorion-numbering("A.1")
// 6. Table of contents
#outline(title: none, target: figure.where(kind: "theorem"))
// 7. Specify a number or supplement
#theorem(title: "Euclid's Theorem", number: "233", supplement: [Theorion])[
There are infinitely many prime numbers.
]
// 8. Counter continuation: use an array number to continue numbering from a specific value
#theorem(number: (2, 3))[
This theorem is explicitly numbered 2.3.
The counter continues from here, so the next auto-numbered theorem is 2.4.
]
// 9. Flexible References via specific supplements. A reference without the title using @label[-]; or one with title and number using @label[!!]
A reference without the title: @thm:euclid[-]; or one with title and number: @thm:euclid[!!]
// 10. Custom full-title: override the auto-generated "Prefix Number (Title)" format
#theorem(full-title: [Fundamental Theorem])[
There is a fundamental result.
]
```
== Table of Theorems
#outline(title: none, target: figure.where(kind: "theorem"))
== Basic Theorem Environments
Let's start with the most fundamental definition.
#definition[
A natural number is called a #highlight[_prime number_] if it is greater than 1
and cannot be written as the product of two smaller natural numbers.
] <def:prime>
#example[
The numbers $2$, $3$, and $17$ are prime. As proven in @cor:infinite-prime,
this list is far from complete! See @thm:euclid for the full proof.
]
#assumption[
For all $n in NN$, assume $n$ is even if $n = 2k$ for some $k in NN$.
]
#property[
The sum of two even numbers is always even.
]
#conjecture[Twin Prime Conjecture][
There are infinitely many primes $p$ such that $p+2$ is also prime.
]
#theorem[Euclid's Theorem][
There are infinitely many prime numbers.
] <thm:euclid>
#proof[Proof of @thm:euclid][
By contradiction: Suppose $p_1, p_2, dots, p_n$ is a finite enumeration of all primes.
Let $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
it cannot be prime. Thus, some prime $p_j$ divides $P + 1$.
Since $p_j$ also divides $P$, it must divide their difference $(P + 1) - P = 1$,
a contradiction.
]
#corollary[
There is no largest prime number.
] <cor:infinite-prime>
#lemma[
There are infinitely many composite numbers.
]
== Functions and Continuity
#theorem[Continuity Theorem][
If a function $f$ is differentiable at every point, then $f$ is continuous.
] <thm:continuous>
#tip-block[
@thm:continuous tells us that differentiability implies continuity,
but not vice versa. For example, $f(x) = |x|$ is continuous but not differentiable at $x = 0$.
For a deeper understanding of continuous functions, see @thm:max-value in the appendix.
]
== Geometric Theorems
#theorem[Pythagorean Theorem][
In a right triangle, the square of the hypotenuse equals the sum of squares of the other two sides:
$x^2 + y^2 = z^2$
] <thm:pythagoras>
#important-block[
@thm:pythagoras is one of the most fundamental and important theorems in plane geometry,
bridging geometry and algebra.
]
#corollary[
There exists no right triangle with sides measuring 3cm, 4cm, and 6cm.
This directly follows from @thm:pythagoras.
] <cor:pythagoras>
#lemma[
Given two line segments of lengths $a$ and $b$, there exists a real number $r$
such that $b = r a$.
] <lem:proportion>
== Algebraic Structures
#definition[Ring][
Let $R$ be a non-empty set with two binary operations $+$ and $dot$, satisfying:
1. $(R, +)$ is an abelian group
2. $(R, dot)$ is a semigroup
3. The distributive laws hold
Then $(R, +, dot)$ is called a ring.
] <def:ring>
#proposition[
Every field is a ring, but not every ring is a field. This concept builds upon @def:ring.
] <prop:ring-field>
#example[
Consider @def:ring. The ring of integers $ZZ$ is not a field, as no elements except $plus.minus 1$
have multiplicative inverses.
]
/// Appendix
#counter(heading).update(0)
#set heading(numbering: "A.1")
#set-theorion-numbering("A.1")
= Theorion Appendices
== Advanced Analysis
#theorem[Maximum Value Theorem][
A continuous function on a closed interval must attain both a maximum and a minimum value.
] <thm:max-value>
#warning-block[
Both conditions of this theorem are essential:
- The function must be continuous
- The domain must be a closed interval
]
== Advanced Algebra Supplements
#axiom[Group Axioms][
A group $(G, \cdot)$ must satisfy:
1. Closure
2. Associativity
3. Identity element exists
4. Inverse elements exist
] <axiom:group>
#postulate[Fundamental Theorem of Algebra][
Every non-zero polynomial with complex coefficients has a complex root.
] <post:fta>
#remark-block[
This theorem is also known as Gauss's theorem, as it was first rigorously proved by Gauss.
]
== Common Problems and Solutions
#problem[
Prove: For any integer $n > 1$, there exists a sequence of $n$ consecutive composite numbers.
]
#solution(qed: auto)[
Consider the sequence: $n! + 2, n! + 3, ..., n! + n$
For any $2 <= k <= n$, $n! + k$ is divisible by $k$ because:
$n! + k = k(n! / k + 1)$
Thus, this forms a sequence of $n-1$ consecutive composite numbers.
]
#exercise[
1. Prove: The twin prime conjecture remains unproven.
2. Try to explain why this problem is so difficult.
]
#conclusion[
Number theory contains many unsolved problems that appear deceptively simple
yet are profoundly complex.
]
== Important Notes
#note-block[
Remember that mathematical proofs should be both rigorous and clear.
Clarity without rigor is insufficient, and rigor without clarity is ineffective.
]
#caution-block[
When dealing with infinite series, always verify convergence before discussing other properties.
]
#quote-block[
Mathematics is the queen of sciences, and number theory is the queen of mathematics.
— Gauss
]
#emph-block[
Chapter Summary:
- We introduced basic number theory concepts
- Proved several important theorems
- Demonstrated different types of mathematical environments
]
== Restated Theorems
// 1. Restate all theorems
#theorion-restate(
filter: it => it.outlined and it.identifier == "theorem",
render: it => it.render,
)
// 2. Restate all theorems with custom render function
// #theorion-restate(
// filter: it => it.outlined and it.identifier == "theorem",
// render: it => (prefix: none, title: "", full-title: auto, body) => block[#strong[#full-title.]#sym.space#emph(body)],
// )
// 3. Restate a specific theorem
// #theorion-restate(filter: it => it.label == <thm:euclid>)
// or we can use
// #theorion-restate(filter: <thm:euclid>)