repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/mem-courses/discrete-mathmatics
https://raw.githubusercontent.com/mem-courses/discrete-mathmatics/main/homework/week9.typ
typst
MIT License
#import "../template.typ": * #import "../functions.typ": * #show: project.with( course: "Discrete Mathmatics", course_fullname: "Discrete Mathematics and Application", course_code: "211B0010", title: "Homework #9: Generating Function & Relation", authors: ( ( name: "<NAME>", email: "<EMAIL>", id: "A10", ), ), semester: "Spring-Summer 2024", date: "April 16, 2024", ) #let mt = math.bold(math.upright("M")) #let circ = $◦$ = 8.4 Generating Functions #hw("6(d,f)")[ Find a closed form for the generating function for the sequence ${a_n}$, where #v(0.25em) #parts( columns: 2, d: [$display(a_n=1/((n+1)!))$ for $n=0,1,2,dots$], f: [$display(a_n=binom(10,n+1))$ for $n=0,1,2,dots$], ) ][#parts( d: [ Let $display(A(x) = sum_(n>=0) a_n x^n)$, then $ & A(x) = sum_(n>=0) (x^n) / ((n+1)!)\ ==>quad& x A(x)= sum_(n>=0) (x^(n+1)) / ((n+1)!)= sum_(n>=1) (x^n) / (n!) = e^x - 1\ ==>quad& A(x) = (e^x-1) / x $ ], f: [ Let $A(x) = sum_(n>=0) a_n x^n$, then $ & A(x) = sum_(n>=0) binom(10,n+1) x^n\ ==>quad& x A(x) = sum_(n>=1) binom(10,n) x^n = (1+x)^10 - 1\ ==> quad& A(x) = ((1+x)^10 - 1) / x $ ], )] #hw("10(c,d,e)")[ Find the coefficient of $x^9$ in the power series of each of these functions. #parts( c: $(x^3+x^5+x^6)(x^3+x^4)(x+x^2+x^3+x^4+dots.c)$, d: $(x+x^4+x^7+x^10+dots.c)(x^2+x^4+x^6+x^8+dots.c)$, e: $(1+x+x^2)^3$, ) ][#parts( c: [ $3+3=6<9, 3+4=7<9, 5+3=8<9$. Thus, the coefficient of $x^9$ is 3. ], d: [ $9=1+8=3+6=5+4=7+2$. Thus, the coefficient of $x^9$ is 4. ], e: [ Since $2 times 3 =6<9$, the coefficient of $x^9$ is 0. ], )] #hw("16")[ Use generating functions to find the number of ways to choose a dozen bagels from three varietiesegg, salty, and plainif at least two bagels of each kind but no more than three salty bagels are chosen. ][ Let the generating function for the number of ways to choose $n$ bagels. Then $ F(x) = (x^2+x^3)(x^2+x^3+x^4+dots.c)^2 = (x^2+x^3) dot (1 / (1-x))^2 = (x^6 (1+x)) / ((1-x)^2) $ The answer is the coefficient of $x^12$ in $F(x)$, which is the coefficient of $x^6$ in $display((1+x)/((1-x)^2))$. Thus, the answer is $2 times 6 + 1= 13$. ] #hw("24(a)")[ What is the generating function for ${a_k}$, where $a_k$ is the number of solutions of $x_1 + x_2 + x_3 + x_4 = k$ when $x_1, x_2, x_3,$ and $x_4$ are integers with $x_1 >= 3$, $1 <= x_2 <= 5$, $0 <= x_3 <= 4$, and $x_4>=1$? ][ The generating function is $ A(x) = (x^3) / (1-x) dot (x-x^6) / (1-x) dot (1-x^5) / (1-x) dot x / (1-x) = (x^5(1-x^5)^2) / ((1-x)^4) $ ] #hw("32")[ If $G(x)$ is the generating function for the sequence ${a_k}$, what is the generating function for each of these sequences? #parts( a: [$2 a_0, 2 a_1, 2 a_2, 2 a_3, dots$], b: [$0,a_0,a_1,a_2,a_3,dots$ (assuming that terms follow the pattern of all but the first term)], c: [$0,0,0,0,a_2,a_3,dots$ (assuming that terms follow the pattern of all but the first four terms)], d: [$a_2,a_3,a_4,dots$], e: [$a_1,2 a_2, 3 a_3, 4 a_4, dots$], f: [$a_0^2,2 a_0 a_1, a_1^2 + 2 a_0 a_2, 2 a_0 a_3 + 2 a_1 a_2,dots$], ) ][#parts( a: [$F_1(x) = 2 G(x)$.], b: [$F_2(x) = x G(x)$.], c: [$F_3(x) = x^4 (G(x)-a_0-a_1 x)$.], d: [$F_4(x) = (G(x)-a_0)"/"x$.], e: [$F_5(x) = G'(x)$.], f: [$F_6(x) = G^2(x)$.], )] #hw("36")[ Use generating functions to solve the recurrence relation $a_k=3 a_(k-1) + 4^(k-1)$ with the initial condition $a_0=1$. ][ Assume the generating function of ${a_i}$ is $A(x)$. Since the recurrence relation holds for all $k=1,2,dots$, we have $ &sum_(k>=1) a_k x^k = sum_(k>=1) (3 a_(k-1) + 4^(k-1)) x^k\ ==>quad& A(x) - 1 = 3 x A(x) + x / (1-4x)\ ==>quad& A(x) = 1 / (1-4x)\ $ Therefore $a_k = 4^k$. ] #hw("45")[ Use generating functions to prove Vandermonde’s identity: $C(m+n,r)=sum_(k=0)^r C(m,r-k) C(n,k)$, whenever $m,n$, and $r$ are nonnegative integers with $r$ not exceeding either $m$ or $n$. _Hint_: Look at the coefficient of $x^r$ in both sides of $(1+x)^(m+n)=(1+x)^m (1+x)^n$. ][ We use $[x^k] F(x)$ to represent the coefficient of $x^k$ in the generating function $F(x)$. Then $ binom(m+n,r) &= [x^r] (1+x)^(m+n) = [x^r] ((1+x)^m (1+x)^n) = sum_(k=0)^r ([x^(r-k)] (1+x)^m) ([x^(k)] (1+x)^n)\ &= sum_(k=0)^r binom(m,r-k)binom(n,k) $ ] = 8.5 Inclusion-Exclusion #hw("7")[ There are 2504 computer science students at a school. Of these, 1876 have taken a course in Java, 999 have taken a course in Linux, and 345 have taken a course in C. Further, 876 have taken courses in both Java and Linux, 231 have taken courses in both Linux and C, and 290 have taken courses in both Java and C. If 189 of these students have taken courses in Linux, Java, and C, how many of these 2504 students have not taken a course in any of these three programming languages? ][ The number of students that has taken at least one course is $ 1876+999+345-876-231-290+189=2012 $ So the number of students that has not taken any courses is $ 2504 - 2012 = 492 $ ] #hw("10")[ Find the number of positive integers not exceeding 100 that are not divisible by 5 or by 7. ][ For all positive integers not exceeding 100, there are 20 multiples of 5, 14 multiples of 7, and 2 multiples of 35. So the answer is $ 100 - (20 + 14 - 2) = 68 $ ] #hw("20")[ How many terms are there in the formula for the number of elements in the union of 10 sets given by the principle of inclusion-exclusion? ][ The answer is $2^10-1=1023$. ] = 8.6 Applications of Inclusion-Exclusion #hw("6")[ An integer is called squarefree if it is not divisible by the square of a positive integer greater than 1. Find the number of squarefree positive integers less than 100. ][ Now we only discuss for the positive integers less than 100. Then the squared factor can be $4,9,16,25,36,49,64,81$. The answer is $ & 99 - floor(99/4) - floor(99/9) - floor(99/16) - floor(99/25) - floor(99/36) - floor(99/49) - floor(99/64) - floor(99/81) + floor(99/(4 times 9)) + floor(99/(4 times 16))\ =& 99 - 24 - 11 - 6 - 3 - 2 - 2 - 1 - 1 + 2 + 1 = 52 $ #correction[ The answer should be: $ 99 - floor(99/4) - floor(99/9) - floor(99/25) - floor(99/49) + floor(99/(4 times 9)) = 61 $ ] ] #hw("11")[ In how many ways can seven different jobs be assigned to four different employees so that each employee is assigned at least one job and the most difficult job is assigned to the best employee? ][ We just ignore the restriction "the most difficult job is assigned to the best employee" firstly. Then we can discuss of the distribution of jobs among employees: (1) ${4,1,1,1}$, $n_1=binom(7,4,1,1,1) binom(4,1,3) = 840$. (2) ${3,2,1,1}$, $n_2=binom(7,3,2,1,1) binom(4,1,1,2) = 5040$. (3) ${2,2,2,1}$, $n_3=binom(7,2,2,2,1) binom(4,3,1) = 2520$. Consider that the most difficult job has an equal probability of being assigned to each employee, which is $1"/"4$. So the number of ways that the best employee take the most difficult job is $ 1 / 4 (n_1 + n_2 + n_3) = 2100 $ ] #hw("16")[ A group of $n$ students is assigned seats for each of two classes in the same classroom. How many ways can these seats be assigned if no student is assigned the same seat for both classes? ][ There are $n!$ ways to do the first assignment, and $D_n$ ways to do the second. Here $D_n$ represent the number of ways in $n$-derangement. So the answer is $ n! D_n = (n!)^2 (1 / (2!) - 1 / (3!) + 1 / (4!) - dots.c + (-1)^n 1 / (n!)) $ ] = 9.1 Relations and Their Properties #hw("7(a,c,h)")[ Determine whether the relation $R$ on the set of all integers is reflexive, symmetric, antisymmetric, and/or transitive, where $(x, y) in R$ if and only if #parts( columns: 3, a: [$x!=y$.], c: [$x=y+1$ or $x=y-1$.], h: [$x>=y^2$.], ) ][#parts( a: [ The relation is symmetric and transitive. #correction[ It's symmetric but not transitive obviously. (e.g. $1 != 2 and 2 != 1 arrow.double.not 1 != 1$.) ] ], c: [The relation is symmetric.], h: [The relation is antisymmetric and transitive.], )] #hw("26")[ Let $R$ be the relation $R = {(a, b) | a < b}$ on the set of integers. Find #parts( columns: 2, a: [$R^(-1)$.], b: [$overline(R)$.], ) ][#parts( a: [$R^(-1) = {(b,a) | a < b} = {(a,b) | a > b}$.], b: [$overline(R) = {(a,b) | not(a<b)} = {(a,b) | a >= b}$.], )] #hw("32")[ Let $R$ be the relation ${(1, 2), (1, 3), (2, 3), (2, 4), (3, 1)}$, and let $S$ be the relation ${(2, 1), (3, 1), (3, 2), (4, 2)}$. Find $S circ R$. ][ Discuss with the common elements between two relations: 1: $(3,1)$ from $R$, and none from $S$. 2: $(1,2)$ from $R$, and $(2,1)$ from $S$. 3: $(1,3), (2, 3)$ from $R$, and $(3,1), (3, 2)$ from $S$. 4: (2,4) from $R$, and $(4, 2)$ from $S$. Overall, we can conclude that $S circ R = {(1,1),(1,2),(2,1),(2,2)}$. ] #hw("49")[ How many relations are there on a set with $n$ elements that are #parts( columns: 2, a: [symmetric?], b: [antisymmetric?], c: [asymmetric?], d: [irreflexive?], e: [reflexive and symmetric?], f: [neither reflexive nor irreflexive?], ) ][ #parts( columns: 2, a: [$n_a = 2^(C(n,2) + n) = 2^(n(n+1)"/"2)$.], b: [$n_b = 3^(C(n,2)) times 2^n$.], c: [$n_c = 3^(C(n,2))$.], d: [$n_d = 2^(n^2 - n) = 2^(n(n-1))$.], e: [$n_e = 2^(C(n,2)) = 2^(n(n-1)"/"2)$.], f: [$n_f = 2^(n(n-1)) times (2^(n)-2)$.], ) ] #hw("53")[ Show that the relation $R$ on a set $A$ is symmetric if and only if $R = R^(−1)$, where $R^(−1)$ is the inverse relation. ][ Prove that if $R$ is symmetric, then $R = R^(-1)$: Since $R$ is symmetric, for any pair $(a,b) in R$, we have $(b,a) in R$ too. So $R subset.eq R^(-1)$ by definition. On the other hand, for any pair $(b,a) in R$, we have $(a,b) in R$. So $R^(-1) subset.eq R$. Thus, $R = R^(-1)$. Prove that if $R=R^(-1)$, then $R$ is symmetric: Since $R=R^(-1)$. For any pair $(a,b) in R$, we have $(a,b) in R^(-1)$, which means $(b,a) in R$. So $R$ is symmetric. ] = 9.3 Representing Relations #hw("13")[ Let $R$ be the relation represented by the matrix $ mt_R = mat( 0,1,1; 1,1,0; 1,0,1; ) $ Find the matrix representing #parts( columns: 3, a: [$R^(-1)$.], b: [$overline(R)$.], c: [$R^2$.], ) ][$ mt_(R^(-1)) &= mat(0,1,1;1,1,0;1,0,1) (=mt_R) quad quad quad mt_(overline(R)) &= mat(1,0,0;0,0,1;0,1,0) quad quad quad mt_(R^2) &= mat(1,1,1;1,1,1;1,1,1) $] #hw("14")[ Let $R_1$ and $R_2$ be relations on a set $A$ represented by the matrices $ mt_(R_1) = mat(0,1,0;1,1,1;1,0,0) "and" mt_(R_2) = mat(0,1,0;0,1,1;1,1,1) $ Find the matrices that represent #parts( columns: 3, a: [$R_1 union R_2$.], b: [$R_1 sect R_2$.], c: [$R_2 circ R_1$.], d: [$R_1 circ R_1$.], e: [$R_1 plus.circle R_2$.], ) ][$ mt_(R_1 union R_2) = mat(0,1,0;1,1,1;1,1,1) quad quad quad mt_(R_1 sect R_2) = mat(0,1,0;0,1,1;1,0,0) quad quad quad mt_(R_2 circ R_1) = mat(0,1,1;1,1,1;0,1,0)\ mt_(R_1 circ R_1) = mat(1,1,1;1,1,1;0,1,0) quad quad quad mt_(R_1 plus.circle R_2) = mat(0,0,0;1,0,0;0,1,1) $] #hw("31")[ Determine whether the relations represented by the directed graphs shown in Exercises 23–25 are reflexive, irreflexive, symmetric, antisymmetric, and/or transitive. #align(center, image("images/2024-04-29-14-27-29.png", width: 60%)) ][#parts( a: [ The relation is ${(a,b),(a,c),(b,c),(c,b)}$. So it's irreflexive and transitive. ], b: [ The relation is ${(a,c),(c,d),(d,b),(b,a)}$. So it's irreflexive and antisymmetric. ], )]
https://github.com/alex-touza/fractal-explorer
https://raw.githubusercontent.com/alex-touza/fractal-explorer/main/paper/src/annexes/proofs.typ
typst
#import "../../meta.typ": * #import "../environments.typ": * #import "../shortcuts.typ": * == Justificacions i demostracions matemàtiques Per reduir la llargada del cos principal del treball, es presenten aquí demostracions d'algunes proposicions i teoremes, així com explicacions addicionals de les definicions matemàtiques presentades. #if not PRINT [Recordeu que les referències com #emph[@hausdorff-prop1] són clicables.] #explanation[de @def-topologia][ Intuïtivament, una topologia sobre un conjunt és una forma d'expressar la proximitat (els veïnats) dels elements en un conjunt, sense cap noció de distància. Per exemple, considerem el conjunt $A = {1, 3, 10, 15, 17}$. Una topologia possible sobre aquest conjunt podria ser $tau_1 = {emptyset, A}$, ja que compleix les condicions: l'única intersecció possible, $emptyset sect A = emptyset$, i l'única unió possible, $emptyset union A = A$, estan dins del conjunt. Tanmateix, una topologia així no és gaire útil, perquè les relacions de proximitat no estan definides de forma acurada. Un exemple més útil podria ser $tau_2 = {emptyset, {10}, {15}, {10, 15}, A}$, en la qual expressem que els elements 10 i 15 són pròxims (o relacionats d'alguna altra forma). ] #explanation[d'ambigüitats amb la dimensió intrínseca][ Hem definit la dimensió intrínseca com el nombre de paràmetres requerits per obtenir els punts que formen l'objecte. Per tant, una funció com $f(x)=2$, que representa una recta, tindria dimensió 1, perquè el conjunt de punts es pot definir amb l'expressió ${(x,2) : x in RR}$. Tanmateix, en contextos fora de la geometria o la topologia, com en el tractament de dades, la dimensió intrínseca és 0 si la funció és constant. Aleshores, la funció $f$ anterior tindria dimensió 0. Com aquest treball es centra en l'àrea de la topologia, aquesta definició no s'ha fet servir. ] #explanation[de @def-dim-lebesgue][ La dimensió de Lebesgue es basa, com es dedueix de l'explicació intuïtiva ja exposada, en el nombre de solapaments ] #explanation[de @def-mesura-hausdorff][ Primer, considerem tots els recobriments-$delta$ (@def-recobriment-delta) possibles del conjunt $A$ que es vol mesurar: $ {{E_i : abs(E_i) <= delta } : A subset.eq union.big_i E_i }, delta in (0, +infinity) $ Aleshores, per a cada recobriment, es calcula la suma dels diàmetres elevats a un nombre real positiu o nul $s$. $ {sum_i abs(E_i)^s : abs(E_i) <= delta, A subset.eq union.big_i E_i}, delta in (0, +infinity), s in [0, +infinity) $ Per últim, hem de tenir en compte que el conjunt $A$ podria ser un subconjunt propi de les unions de les col·leccions, és a dir, cada unió podria contenir elements que $A$ no conté. Per minimitzar aquest error, agafem l'ínfim de la col·lecció: $ hausdorffdelta = inf {sum_i abs(E_i)^s : abs(E_i) <= delta, A subset.eq union.big_i E_i }, s in [0, +infinity), delta in RR $ Interessa que els conjunts que formen el recobriment siguin el més petits possibles, és a dir, que $delta$ sigui el més petit possible. Si $delta$ es redueix, el nombre de col·leccions ---és a dir, recobriments possibles--- també redueix i aleshores l'ínfim augmenta (o no disminueix). Per tant, agafem el límit de $delta -> 0$: $ hausdorff = lim_(delta -> 0) hausdorffdelta = lim_(delta -> 0) inf {sum_i abs(E_i)^s : abs(E_i) <= delta, A subset.eq union.big_i E_i }, s in [0, +infinity), delta in RR $ Finalment, aquesta expressió és la definició de la mesura de Hausdorff $s$-dimensional. ] #demo[de @hausdorff-prop1][ Fixem-nos en el sumatori dels diàmetres d'un sol recobriment. Si $s < t$, aleshores, sabent que $abs(E_i) <= delta$: $ sum_i abs(E_i)^t = sum_i abs(E_i)^(t-s) abs(E_i)^s <= delta^(t-s) sum_i abs(E_i)^s $ Si fem l'ínfim de la primera i l'última expressió per a tots els recobriments, tenim que: $ cal(H)^t_delta (A) <= delta^(t-s)cal(H)^s_delta $ Per obtenir la mesura de Hausdorff sense el paràmetre $delta$, fem el límit als dos costats: $ cal(H)^t (A) <= lim_(delta -> 0) (delta^(t-s)cal(H)^s_delta) = 0 dot cal(H)^s $ Com hem fixat que $cal(H)^s (A) > 0$, perquè es compleixi la desigualtat és necessari que #linebreak() $cal(H)^t = +infinity$. ] <dem-hausdorff-prop1> #demo[de @hausdorff-prop2][ Fem ús de la mateixa expressió que a la demostració anterior: $ cal(H)^t (A) <= lim_(delta -> 0) (delta^(t-s)cal(H)^s_delta) = 0 dot cal(H)^s $ Com hem fixat que $cal(H)^s (A) < +infinity$, tota l'expressió és nul·la: $cal(H)^t (A) = 0 qedhere$. ]
https://github.com/Ngan-Ngoc-Dang-Nguyen/thesis
https://raw.githubusercontent.com/Ngan-Ngoc-Dang-Nguyen/thesis/main/tools/multi-section-ref.typ
typst
// #show bibliography: none // #bibliography("../contents/machine-learning.bib") #let section-refs = state("section-refs", ()) // Add bibliography references to the current section's state #show ref: it => { it if it.element != none { // Citing a document element like a figure, not a bib key // So don't update refs return } section-refs.update(old => { old.push(it.target) old }) } // Clear the previously stored references every time a level 1 heading // is created #show heading.where(level: 1): it => { section-refs.update(()) it } #let section-bib() = locate(loc => { for target in section-refs.at(loc) { block(cite(target, form: "full")) } })
https://github.com/cetz-package/cetz-venn
https://raw.githubusercontent.com/cetz-package/cetz-venn/master/gallery/venn2.typ
typst
Apache License 2.0
#set page(width: auto, height: auto, margin: .5cm) #import "@preview/cetz:0.2.2" #import "@preview/cetz-venn:0.1.1": venn2 #cetz.canvas({ import cetz.draw: * venn2(name: "venn", a-fill: red, ab-fill: green) content("venn.a", [A]) content("venn.b", [B]) })
https://github.com/fenjalien/metro
https://raw.githubusercontent.com/fenjalien/metro/main/tests/complex/complex-angle-unit/test.typ
typst
Apache License 2.0
#import "/src/lib.typ": * #set page(width: auto, height: auto, margin: 1cm) #complex(1, 1deg) #complex(1, 1rad, complex-angle-unit: "radians")
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/bugs/args-underscore.typ
typst
Apache License 2.0
// Test that lone underscore works. // Ref: false --- #test((1, 2, 3).map(_ => {}).len(), 3)
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/shaping_00.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test separation by script. ABCअपार्टमेंट // This is how it should look like. अपार्टमेंट // This (without the spaces) is how it would look // if we didn't separate by script. अ पा र् ट में ट
https://github.com/kazuyanagimoto/typstcv
https://raw.githubusercontent.com/kazuyanagimoto/typstcv/main/README.md
markdown
Other
# [typstcv](https://kazuyanagimoto.com/typstcv/) <!-- badges: start --> <a href="https://kazuyanagimoto.r-universe.dev"><img src="https://kazuyanagimoto.r-universe.dev/badges/typstcv" class="img-fluid" alt="R-universe status badge"></a> [![R-CMD-check](https://github.com/kazuyanagimoto/typstcv/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kazuyanagimoto/typstcv/actions/workflows/R-CMD-check.yaml) <a href = "https://github.com/kazuyanagimoto/typstcv/blob/main/LICENSE.md" target = "_blank"><img src="https://img.shields.io/badge/license-MIT-blue"></a> [![Docs](https://img.shields.io/badge/docs-homepage-blue.svg)](https://kazuyanagimoto.com/typstcv/index.html) <!-- badges: end --> ![](vignettes/img/typstcv_awesomecv.svg) This package provides helper functinons for [kazuyanagimoto/quarto-awesomecv-typst](https://github.com/kazuyanagimoto/quarto-awesomecv-typst). This work are inspired by these three works: - <NAME>’s [Awesome-CV](https://github.com/posquit0/Awesome-CV) - A beautiful LaTeX template of CV - <NAME>’s [modern-cv](https://typst.app/universe/package/modern-cv/) - A [Typst](https://typst.app) implementation of Awesome-CV - <NAME> and <NAME>’s [vitae](https://pkg.mitchelloharawild.com/vitae/) - R package for modern CV, including Awesome-CV ## Installation You can install the development version of typstcv from R-universe with: ``` r install.packages("typstcv", repos = "https://kazuyanagimoto.r-universe.dev") ``` ## Usage You can find a simple [example](https://kazuyanagimoto.com/typstcv/vignettes/awesomecv/awesomecv.pdf) and [qmd](https://github.com/kazuyanagimoto/typstcv/blob/main/vignettes/awesomecv/awesomecv.qmd) code. ### Use Template You can use the template with `quarto` command. ``` bash quarto use template kazuyanagimoto/quarto-awesomecv-typst ``` ### YAML ![](vignettes/img/awesomecv_header.svg) Set author information in YAML. ``` yaml author: firstname: Albert lastname: Einstein address: "Rämistrasse 101, CH-8092 Zürich, Switzerland, Zürich" position: "Research Physicist・Professor" contacts: - icon: fa envelope text: <EMAIL> url: "mailto:<EMAIL>" - icon: PATH_TO_ICON/icon.svg text: example.com url: https://example.com ``` - [fontawesome](https://fontawesome.com/search?m=free&o=r) icons are supported via [duskmoon314/typst-fontawesome](https://github.com/duskmoon314/typst-fontawesome) with `fa` prefix. - SVG icons can be used by specifying the path to the icon file ### Fonts & Color You can set fonts and the accent color in YAML. ``` yaml style: color-accent: "516db0" font-header: "Roboto" font-text: "Source Sans Pro" format: awesomecv-typst: font-paths: ["PATH_TO_FONT"] ``` ### Profile Photo You can set a profile photo in YAML. If you set it, the header will be left-aligned. ``` yaml profile-photo: "PATH_TO_PHOTO/photo.jpg" ``` ### Resume Entries `resume_entry()` is a helper function to create resume entryies from a data frame. ``` r educ #> title location date description #> 1 Ph.D. in Physics Zürich, Switzerland 1905 University of Zürich #> 2 Master of Science Zürich, Switzerland 1896 - 1900 ETH ``` ``` r educ |> resume_entry( title = "title", location = "location", date = "date", description = "description" ) ``` ![](vignettes/img/awesomecv_educ.svg) You can add bullet points by `details` argument. ``` r resume_entry(award, details = c("detail1", "detail2")) # resume_entry(award, details = grep("^detail", names(award))) ``` ![](vignettes/img/awesomecv_award.svg) ### Date Formatter `date_formatter()` is a helper function to format dates in the resume. ``` r work #> title location start end #> 1 Technical Assistant Bern, Switzerland 1902-01-01 1908-01-01 #> 2 Junior Professor Bern, Switzerland 1908-01-01 1909-01-01 #> 3 Associate Professor Zürich, Switzerland 1909-01-01 1911-01-01 #> description #> 1 Federal Patent Office #> 2 University of Bern #> 3 University of Zürich ``` ``` r work |> format_date( start = "start", end = "end", date_format = "%Y", sep = "->", sort_by = "start" ) |> resume_entry() ``` ![](vignettes/img/awesomecv_work.svg)
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/par-bidi_08.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // // // Test setting a vertical direction. // // Ref: false // // // Error: 16-19 text direction must be horizontal // #set text(dir: ttb)
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/call-04.typ
typst
Other
#let x = "x" // Error: 2-3 expected function, found string #x()
https://github.com/rabotaem-incorporated/calculus-notes-2course
https://raw.githubusercontent.com/rabotaem-incorporated/calculus-notes-2course/master/sections/04-parametric-and-curves/01-parametric-integral.typ
typst
#import "../../utils/core.typ": * == Интегралы с параметром #def[ Пусть $(X, Aa, mu)$ --- пространство с мерой. $T$ --- подмножество метрического пространства. $E_t in Aa$ и для любого $t in T$ функция $f: X times T --> overline(RR)$ с фиксированным $t$ измерима. Пусть $F (t) := integral_(E_t) f(x, t) dif mu(x). $ ] #notice[ На зависимость от $E_t$ можно не обращать внимания: $ F(t) = integral_X f(x, t) bb(1)_(E_t) (x) dif mu(x) $ ] #(make_theorem("Вопросы, интересущие нас", color: purple))[ + $t_0$ --- предельная точка $T$ и $f(x, t) -->_(t -> t_0) g(x)$. Верно ли, что $F$ имеет предел в $t_0$? Если да, то какой? + $f(x, t)$ непрерывна в точке $t_0$ для любого $x in X$. Верно ли, что $F$ непрерывна в $t_0$? + $T subset RR$. $f(x, t)$ дифференцируема по $t$ для любого $x in X$. Будет ли дифференциируема $F$? Если да, как считать производную? + Если $nu$ --- мера на $T$, что можно сказать про $integral_T F dif nu$? ] #notice[ На вопрос 4 мы уже научились неплохо отвечать. $ integral_T F dif nu = integral_T integral_X f(x, t) dif mu(x) dif nu(t). $ По теореме Тонелли#rf("tonelli")/Фубини#rf("fubini"), можем переставлять интералы. ] #th(name: "ответ на вопрос 1", label: "parametric-limit")[ Пусть $t_0$ --- предельная точка. Суммируемая $f$ такова, что $f(x, t) -->_(t -> t_0) g(x)$ во всех $x in X$. Существует $Phi: X --> overline(RR)$ суммируемая, и окрестность $U_(t_0)$ такая, что $abs(f(x, t)) <= Phi(x)$ для любого $x$ и $t in U_(t_0)$#rf("def-lebesgue-condition"). Тогда $ lim_(t -> t_0) integral_X f(x, t) dif mu(x) = integral_X g dif mu. $ ] #proof[ Проверяем существование предела по Гейне. Рассмотрим $t_n -> t_0$. Обозначим $f_n (x) := f(x, t_n)$. Тогда при больших $n$ верно $t_n in U_(t_0)$, и можно применить теорему Лебега о предельном переходе#rf("lebesgue-limit"): $abs(f_n (x)) <= Phi(x)$ для каждого $x$ начиная с некоторого $m$. По теореме имеем, $lim integral_X f_n dif mu = integral_X g dif mu$. ] Обобщим свойство, которым мы пользовались в теореме. #def(label: "def-lebesgue-condition")[ Пусть $f: X times T --> overline(RR)$. Пусть $t_0$ --- предельная точка T. Будем говорить, что $f$ удовлетворяет _локальному условию Лебега_ в точке $t_0$, если существует суммируемая $Phi: X --> overline(RR)$ и окрестность $U_(t_0)$, такие, что $abs(f(x, t)) <= Phi(x) space forall x in X space forall t in U_(t_0)$. ] #let converges = sym.arrows.rr #def(label: "def-parametric-uniform-converge")[ Говорят, что $f(x, t) arrows.rr_(t -> t_0) g(x)$, или _$f$ равномерно сходится к $g$ на $X$ в точке $t_0$_ если $ forall eps > 0 space exists delta > 0 space forall x in X space forall t != t_0 space rho(t, t_0) < delta ==> abs(f(x, t) - g(x)) < eps. $ ] #notice[ $ f(x, t) arrows.rr_(t -> t_0) g(x) "равномерно на" X <==> sup_(x in X) abs(f(x, t) - g(x)) -->_(t -> t_0) 0. $ ] #follow(label: "parametric-limit'")[ (из теоремы о предельном переходе#rf("parametric-limit")) Пусть $mu X < +oo$ и $f(x, t) converges_(t -> t_0) g(x)$#rf("def-parametric-uniform-converge") (где $f$ суммируема) равномерно на $X$. Тогда $g$ суммируема, и $ lim_(t -> t_0) integral_X f(x, t) dif mu(x) = integral_X g dif mu. $ ] #proof[ Возьмем $eps = 1$, по нему $delta > 0$ из определения и пусть $rho(s, t_0) < delta$ ($s != t_0$). Тогда $abs(f(x, s) - g(x)) < 1$ для любого $x in X$, значит $abs(g(x)) < 1 + abs(f(x, s))$ --- суммируемая мажоранта. ] #exercise[ Доказать это напрямую. ] #notice[ Условие $mu X < +oo$ существенно. Пусть $X = RR$, $mu = lambda_1$. Если $f_n (x) = 1/n bb(1)_[0, n] (x) converges_(n -> oo) 0$. Но тогда $integral_RR f_n dif lambda_1 = 1 cancel(-->) 0 = integral_RR 0 dif lambda_1$. ] #follow(label: "parametric-continious")[ Пусть $mu X < +oo$, $f(x, t)$ непрерывна по $t$ в точке $t_0$ для любого $x in X$, и удовлетворяет локальному условию Лебега#rf("def-lebesgue-condition") в точке $t_0$. Тогда $F(t) := integral_X f(x, t) dif mu(x)$ непрерывна в точке $t_0$. ] #proof[ Очевидно по теореме#rf("parametric-limit"). ] #pr()[ Пусть $(X, rho_X)$ и $(Y, rho_Y)$ --- метрические пространства. Можно определить $(X times Y, d)$, где $d((x, y), (x', y')) = rho_X (x, x') + rho_Y (y, y')$. Это тоже метрическое пространство. Можно брать сумму, максимум, корень из суммы квадратов --- не важно. Если операция адекватная, это все равно метрическое пространство. ] #lemma(label: "compact-prod")[ Пусть $K$ и $L$ компакты в $X$ и $Y$. Тогда $K times L$ --- компакт в $(X times Y, d)$. ] #proof[ Проверяем секвенциальную компактность#rf("def-seq-compact"). Берем $(x_n, y_n) in K times L$. $x_n in K$, значит найдется $x_(n_k)$ сходится к точке из $K$, и $y_(n_k) in L$, поэтому найдется $y_(n_(k_l))$, которая сходится к точке из $L$. Тогда $(x_(n_(k_l)), y_(n_(k_l)))$ сходится к точке из $K times L$. Доказали. ] #th(label: "parametric-continious-compact")[ Пусть $X$ и $T$ компакты, $mu X < +oo$ и $f in C(X times T)$. Тогда $F(t) := integral_X f(x, t) dif mu(x) in C(T)$. ] #proof[ $X times T$ компакт по лемме#rf("compact-prod"), непрерывная функция на компакте ограничена#rf("weierstrass"). Значит $abs(f(x, t)) <= M$ для любого $x in X$ и $t in T$. Нашли мажоранту. Подставляем в следствие, получаем что хотим. ] #follow(label: "parametric-continious-compact'")[ От компактности $T$ можно отказаться. Пусть $X$ --- компакт, $mu X < +oo$, $Omega subset RR^m$ --- открыто. Пусть $f$ непрерывна на $X times Omega$. Тогда интегралы $F(t) := integral_X f(x, t) dif mu(x)$ будут непрерывны на $Omega$. ] #proof[ Возьмем точку из $Omega$ и будем проверять там непрерывность. Рассмотрим шарик $overline(B)_r (t_0)$, который вместе с замыканием будет содежраться в $Omega$. Это компактное множество. Рассмотрим $f bar_(X times overline(B)_r (t_0))$. Эта функция непрерывна как сужение непрерывной. Можем подствавить сужение в теорему#rf("parametric-continious-compact"). Значит, $F bar_(overline(B)_r (t_0))$ непрерывна на шарике, значит $F$ непрерывна в $t_0$. ] В основном именно последняя теорема и следсвие будут полезны на практике. Свойство локального условия Лебега довольно тяжело проверять. #line(length: 100%) Теперь углубимся в дифференцируемость. #th(label: "parametric-derivative")[ Пусть $f: X times T --> RR$ суммируема для любого $t in T$, пусть $T subset RR$ --- промежуток. Пусть $f'_t (x, t)$ удовлетворяет локальному условию Лебега#rf("def-lebesgue-condition") в точке $t_0$. Тогда $F$ дифференцируема в точке $t_0$, и $F' (t_0) = integral_X f'_t (x, t_0) dif mu(x)$. ] #proof[ Пишем в лоб определение производной. Рассмотрим $ (F(t_0 + h) - F(t_0)) / h = 1/h (integral_X f(x, t_0 + h) dif mu(x) - integral_X f(x, t_0) dif mu(x)) = \ = integral_X underbrace((f(x, t_0 + h) - f(x, t_0))/h, := g(x, h)) dif mu(x). $ Надо понять, когда $integral_X g(x, h) dif mu(x) -->_(h -> 0) integral_X f'_t (x, t_0) dif mu(x)$. Мы знаем, что $g(x, h) -->_(h -> 0) f'_t(x, t_0)$, а когда можно переходить к интегралам? Когда выполняется локальное условие Лебега для $g$ при $h$ близких к $0$. Проверяем его. По теореме Лагранжа#rf("lagrange"), $ g(x, h) = (f(x, t_0 + h) - f(x, t_0)) / h = f'_t (x, t_0 + theta h), $ где $theta = theta(x, h) in (0, 1)$. Тогда $abs(g(x, h)) = abs(f'_t (x, t_0 + theta h)) <= Phi(x)$ при $h$ близких к нулю ($t_0 + theta h in U_(t_0)$ --- мы попадаем в окрестность из условия). Получили локальное условие Лебега для $g$. ] #follow(label: "parametric-derivative-compact")[ Пусть $mu X < +oo$, $T subset RR$ --- промежуток, $X$ --- компакт. Пусть $f in C(X times T)$ и $f'_t in C(X times T)$. Тогда $F in C^1 (T)$ и $F' (t) = integral_X f'_t (x, t) dif mu_(x)$. ] #proof[ Возьмем $t_0 in T$. Накроем ее каким-то компактным отрезком $[a, b]$. Так как $f'_t in C (X times [a, b])$, то $f$ ограничена#rf("weierstrass") (на компакте#rf("compact-prod")). А если $abs(f'_t) <= M$, мы нашли суммируемую мажоранту. Подставляем в теорему#rf("parametric-derivative"). Согласно ей, $F$ дифференцируема в точке $t_0$, и $ F' (t_0) = integral_X f'_t (x, t_0) dif mu(x). $ Так как $t_0$ любая, мы проверили дифференцируемость во всех точках и формулу для производной. По прерыдущей теореме, функция $integral_X f'_t (x, t) dif mu(x)$, заданная на таком промежутке, будет непрерывна по $t$. ] #let anyinterval(..smth) = $lr(angle.l #{smth.pos().join(",")} angle.r)$ #th(name: "формула Лейбница", label: "leibniz")[ Пусть $f: anyinterval(a, b) times anyinterval(c, d) --> RR$, пусть $f, f'_t in C(anyinterval(a, b) times anyinterval(c, d))$. Пусть $phi, psi: anyinterval(c, d) --> anyinterval(a, b)$ непрерывно дифференцируемые. Тогда если $ F(t) := integral_(phi(t))^(psi(t)) f(x, t) dif x in C^1(anyinterval(c, d)), $ то $ F'(t) = integral_(phi(t))^(psi(t)) f'_t (x, t) dif x + f(psi(t), t) psi'(t) - f(phi(t), t) phi'(t). $ ] #proof[ Пусть $g(alpha, beta, t) := integral_alpha^beta f(x, t) dif x$, где $alpha, beta in anyinterval(a, b)$, и $t in anyinterval(c, d)$. Тогда $g'_t (alpha, beta, t) = integral_alpha^beta f'_t (x, t) dif x$ из следствия#rf("parametric-derivative-compact"), $g'_beta (alpha, beta, t) = f(beta, t)$#rf("barrow"), и $g'_alpha (alpha, beta, t) = -f(alpha, t)$#rf("barrow"). Все три производные непрерывны. Значит $g$ --- дифференцируемая#rf("diff-through-partial-derivatives"), а $F(t) = g(phi(t), psi(t), t)$, то есть тоже дифференцируемая. Запишем производную композиции: $ F'(t) = g'_alpha (phi(t), psi(t), t) dot phi'(t) + g'_beta (phi(t), psi(t), t) psi'(t) + g'_t (phi(t), psi(t), t). $ Что и требовалось. Отмечу, что в следствии мы пользовались тем, что функция определена на компакте, а здесь у нас произвольный интервал. Но это не проблема: можно для каждого $t$ рассмотреть строго покрывающий отрезок. Тогда $phi$ и $psi$ имеют максимумы и минимумы, и можно ограничить гранцицы интегрирования компактом, и применить следствие. ] #example[ Посчитаем $F(t) = integral_0^(+oo) e^(-x^2) cos(x t) d x$. В лоб посчитать это не получится с нашими текущими знаниями, поэтому продифференцируем, и что-то поймем. Для начала в лоб, $ F'_t (t) = -integral_0^(+oo) e^(-x^2) x sin(x t) d x. $ Правда, чтобы так делать, нужно локальное условие Лебега. Оно есть: $x e^(-x^2)$ суммируема, и не меньше подынтегральной функции. Кстати, так как под интегралом непрерывная функция, то $F'_t$ непрерывна. Итак, хотим посчитать $ integral_0^(+oo) e^(-x^2) x sin(x t) d x. $ Как обычно, когда ничего не понятно, интегрируем по частям. Пусть $v = e^(-x^2)$ ($dif v = -2 x e^(-x^2) dif x$), а $u = sin(x t)$ ($dif u = t cos (x t) dif x$). Тогда $ underbrace(lr(1/2 e^(-x^2) sin (x t) |)_0^(+oo), 0) - integral_0^(+oo) 1/2 t e^(-x^2) cos (x t) d x = - t/2 F(t). $ Получили уравнение $F'(t) + t/2 dot F(t) = 0$. Получили дифференциальное уравнение. $ F'(t) + t/2 dot F(t) = 0 & <==> \ <==> (F(t) e^(t^2/4))' = e^(t^2/4) dot F'(t) + t/2 e^(t^2 / 4) dot F(t) = 0 & <==> \ <==> F(t) = C e^(-t^2/4)&. $ Остается найти константу. Подставим $t = 0$, получим $F(0) = integral_0^(+oo) e^(-x^2) d x = sqrt(pi)/2$. Значит $C = sqrt(pi)/2$. Итого, $ F(t) = sqrt(pi)/2 e^(-t^2/4). $ Вот так дифференцирование по параметру позволяет узнать что-то про интеграл. ]
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/scholarly-tauthesis/0.4.0/template/content/03.typ
typst
Apache License 2.0
/** 03.typ * * This is an example chapter in a multi-file typst project. * ***/ #import "../preamble.typ": * #import "@preview/scholarly-tauthesis:0.4.0" as tauthesis = References <references> Different referencing styles determine how you create in-text citations and the bibliography (list of references). Two common referencing styles are presented in this chapter: - Numeric referencing (Vancouver system), such as [1], [2], … - Name-year (Harvard) system, such as (Weber 2001), (Kaunisto 2003), ... A numeric reference is inserted in square brackets, whereas the last name of the author and the year of publication are given in parentheses. Both styles are acceptable, but the conventions for referencing vary between disciplines. You must pick one and use it consistently throughout your thesis. The list of possible styles can be found on the typst documentation page @typst-documentation-bibliography. The most commonly used tool for creating bibliographies in typst is the hayagriva YAML format, but typst also supports BibLaTeΧ. The latter is what this thesis template uses, as it is compatible with LaTeΧ. BibLaTeΧ is based on gathering the bibliographic information from the sources to a `bibliography.bib` file using a specialised syntax. Typst reads both this file and the document being written, and then forms the references and the bibliography based on this information. A citation style can be chosen by setting it in the `meta.typ` file, in the variable `mycitationstyle`. == In-text citations <in-text-citations> In-text citations are placed within the body of the text as close to the actual claim that the citation supports as possible. The citation is generally placed within the sentence before the next period: - Weber argues that... [1]. - Cattaneo et al. introduce in their study [2] a new... - The result isldots [1, p. 23]. One must also note... [1, pp. 33--36] - In accordance with the presented theory... (Weber 2001). - It must especially be noted... (Cattaneo et al. 2004). - Weber (2001, p. 230) has stated ... - Based on literature in the field [1, 3, 5] ... - Based on literature in the field [1][3][5] ... - The topic has been widely studied [6--18] ... - ... existing literature (Weber 2001; Kaunisto 2003; Cattaneo et al. 2004) has ... Each of the sources listed in the `bibliography.bib` file must be associated with a unique identifier at the beginning of the entry. These identifiers should be chosen as descriptively as possible, since all citations are created using them. In the numeric system each citation is typeset using the `@refname` command. For example, placing `@Bezanson2017Julia` in a paragraph results in the following citation: @Bezanson2017Julia. == The bibliography.bib file <bib-file> This is where the information related to the possible references is placed. It is presented in the form ```bib @article { braams1991babel, title={Babel, a multilingual style-option system for use with LaTeΧ’s standard document styles}, author={<NAME>}, journal={TUGboat}, volume={12}, number={2}, pages={291--301}, year={1991} } ``` The following information should be provided per source as bibliographic information, if known: - author(s), - title, - time of publication, - publisher, - pages (books and journals), and - website URL Typst takes care of presenting them in an internally consistent manner. When using this system, it is imperative to know the type of the source: a `journal`, `article`, a `book`, conference proceedings (`proceedings`), a `report` and a `patent` are only examples of the various possibilities. This information is also included in the `bibliography.bib` file, and the presentation is automatically taken care of based on the type of the source. It is preferable to order the list of references alphabetically by the first author's last name. This template conforms automatically to this convention. An excellent way for the easy formation of citation entries is to find a template using Google Scholar. It produces a good first try for the use of BibTeΧ and BibLaTeΧ.
https://github.com/icpmoles/politypst
https://raw.githubusercontent.com/icpmoles/politypst/main/aside/abstract_eng.typ
typst
#let abstract_eng = [ #heading(numbering: none)[Abstract] Here goes the Abstract in English of your thesis followed by a list of keywords. The Abstract is a concise summary of the content of the thesis (single page of text) and a guide to the most important contributions included in your thesis. The Abstract is the very last thing you write. It should be a self-contained text and should be clear to someone who hasn't (yet) read the whole manuscript. The Abstract should contain the answers to the main scientific questions that have been addressed in your thesis. It needs to summarize the adopted motivations and the adopted methodological approach as well as the findings of your work and their relevance and impact. The Abstract is the part appearing in the record of your thesis inside POLITesi, the Digital Archive of PhD and Master Theses (Laurea Magistrale) of Politecnico di Milano. The Abstract will be followed by a list of four to six keywords. Keywords are a tool to help indexers and search engines to find relevant documents. To be relevant and effective, keywords must be chosen carefully. They should represent the content of your work and be specific to your field or sub-field. Keywords may be a single word or two to four words. $ alpha = (partial beta ) / ( partial x) $ #context counter(heading).update(0) ]
https://github.com/alex-touza/fractal-explorer
https://raw.githubusercontent.com/alex-touza/fractal-explorer/main/paper/src/environments.typ
typst
#import "lib/ctheorems.typ": * #let def = thmplain("def", "Definició", base_level: 1, titlefmt: strong) #let proposition = thmplain("def", "Proposició", base_level: 1, titlefmt: strong) #let theorem = thmplain("def", "Teorema", base_level: 1, titlefmt: strong) //#let property = thmplain("property", "Propietat", base_level: 1, titlefmt: strong) #let explanation = thmplain("explanation", "Explicació", base_level: 1, namefmt: emph).with(numbering: none) #let todo = thmbox( "todo", "TODO", fill: rgb("#ff222233"), base_level: 1, ) #let demo = thmproof( "demo", "Demostració", )
https://github.com/jrihon/cv
https://raw.githubusercontent.com/jrihon/cv/main/src/biblio.typ
typst
#let mat2021eff = ( authors : "<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.", date : "2021, May", title : "Efficient and Accurate Potential Energy Surfaces of Puckering in Sugar-Modified Nucleosides", journal : "Journal of Chemical Theory and Computation", publisher : "American Chemical Society (ACS)", volume : "17", number : "6", page-range: "3814-3823", doi : "10.1021/acs.jctc.1c00270", ) #let Schofield2023HnaAptamer = ( authors : "<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.", date : "2023, Jul", title : "Characterization of an HNA aptamer suggests a non-canonical G-quadruplex motif", journal : "Nucleic Acids Research", publisher : "Oxford University Press (OUP)", volume : "51", number : "15", page-range: "7736-7748", doi : "10.1093/nar/gkad592", ) #let EMBOPoster = ( authors : "<NAME>.", date : "2022, Sep", title : "Synthetic biology in action: beyond standard metabolism", journal : "European Molecular Biology Organization (EMBO)", url : "https://www.embl.org/about/info/course-and-conference-office/wp-content/uploads/SYN22-01_poster_A3_20220520_SCREEN.pdf", ) #let Xu2023XyNA = ( authors : "<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.", date : "2023, Jul", title : "Synthesis, antiviral activity, and computational study of β-d-xylofuranosyl nucleoside phosphonates", journal : "European Journal of Medicinal Chemistry", publisher : "Elsevier BV", // volume : "255", // pages : "115379", doi : "10.1016/j.ejmech.2023.115379", ) #let Depuydt2021PnCS1 = ( authors : "<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.", date : "2021, Jun", title : "Cyclic Peptides as T-Type Calcium Channel Blockers: Characterization and Molecular Mapping of the Binding Site", journal : "ACS Pharmacology and Translational Science", publisher : "American Chemical Society ", volume : "4", number : "4", page-range : "1379-1389", doi : "10.1021/acsptsci.1c00079", ) #let Rihon2024Ducque = ( authors : "<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.,<NAME>.", date : "2024, Feb", title : "Structural insights into the morpholino nucleic acid/RNA duplex using the new XNA builder Ducque in a molecular modeling pipeline", publisher: "Oxford University Press (OUP)", journal : "Nucleic Acids Research", doi : "10.1093/nar/gkae135", ) #let Rihon2024puckers = ( authors : "<NAME>.,<NAME>.,<NAME>.,<NAME>.", date : "Manuscript in submission", title : "The pucke.rs toolkit to facilitate sampling the conformational space of biomolecular monomers", )
https://github.com/typst-community/harbinger
https://raw.githubusercontent.com/typst-community/harbinger/main/src/fast-shadow-box.typ
typst
MIT License
#let find-arg(source, ..args, default: none) = { for arg in args.pos() { if (source.keys().contains(arg)) { return source.at(arg) } } return default } #let parse-outset(outset) = { if (type(outset) == length) { (left: outset, right: outset, top: outset, bottom: outset) } else { ( left: find-arg(outset, "left", "x", "other", default: 0pt), right: find-arg(outset, "right", "x", "other", default: 0pt), top: find-arg(outset, "top", "y", "other", default: 0pt), bottom: find-arg(outset, "bottom", "y", "other", default: 0pt), ) } } /// Shadow Box that uses gradients to create the shadow effect. Much faster than the regular shadow-box, but has some issues (doesn't look as good, in some cases might have some unwanted artifacts, etc). /// /// *Example:* /// #example(`harbinger.fast-shadow-box( /// radius: 5pt, /// inset:1em, /// fill:white, /// dx: 2pt, /// dy: 2pt, /// blur:2, /// )[This is a nice shadow box] /// `) /// - body (content): This is the content of the shadow box. /// - shadow-fill (color): The color of the shadow. /// -> content /// - dx (number): The horizontal offset of the shadow. /// - dy (number): The vertical offset of the shadow. /// - radius (number): The radius of the shadow. /// - blur (number): The blur of the shadow. /// - ..args (dictionary): Additional arguments for the shadow box (width, height, fill, etc). #let fast-shadow-box( width: auto, height: auto, radius: 0pt, outset: 0pt, blur: 1pt, dx: 10pt, dy: 10pt, shadow-fill: rgb(0,0,0).lighten(0%), shadow-outset: 0pt, ..args, body ) = { let bwidth = if (type(width) == ratio) {100%} else {width} let bheight = if (type(height) == ratio) {100%} else {height} blur = if(type(blur) == length) {blur} else {blur*1pt} let outset = parse-outset(outset) let shadow-outset = parse-outset(shadow-outset) let shadow-outset = ( left: shadow-outset.left - dx+outset.left+blur, right: shadow-outset.right + dx+outset.right+blur, top: shadow-outset.top - dy+outset.top+blur, bottom: shadow-outset.bottom + dy+outset.bottom+blur, ) let named = args.named() for key in ("width", "height") { if key in named and type(named.at(key)) == ratio { named.insert(key, size.at(key) * named.at(key)) } } let boxed-content = box(body, radius: radius, width: width, height:height, ..named) block( radius: radius, width: width, height: height, outset: shadow-outset, fill: if (blur == 0pt) {shadow-fill} else {none}, inset: 0pt, layout(size => style(st => { let bwidth = if (type(width) == ratio) {size.width} else {width} let bheight = if (type(height) == ratio) {size.height} else {height} let body = (block(width: bwidth, height: bheight, radius: radius, outset: outset, ..args, body)) let bsize = measure(body, st) let radius = calc.max(radius, 2*blur) if (blur != 0pt) { let dx = dx let dy = dy radius = radius+blur let bwidth = bsize.width - 2*radius + shadow-outset.left + shadow-outset.right let bheight = bsize.height - 2*radius + shadow-outset.top + shadow-outset.bottom let grad = (shadow-fill, rgb(255,255,255, 0)) let corn-grad = gradient.radial.with(..grad, radius: 100%, space:oklch) place(top+left, dx: -shadow-outset.left, dy: -shadow-outset.top, rect(width: radius, height: radius, fill: corn-grad(center:(100%, 100%)))) place(top+right, dx: shadow-outset.right, dy: -shadow-outset.top, rect(width: radius, height: radius, fill: corn-grad(center:(0%,100%)))) place(bottom+right, dx: shadow-outset.right, dy: shadow-outset.bottom, rect(width: radius, height: radius, fill: corn-grad(center:(0%,0%)))) place(bottom+left, dx: -shadow-outset.left, dy: shadow-outset.bottom, rect(width: radius, height: radius, fill: corn-grad(center:(100%,0%)))) place(top+center, dx: dx, dy: -shadow-outset.top, rect(height: radius , width: bwidth, fill: gradient.linear(dir: btt, ..grad, space:oklch))) place(horizon+right, dx: shadow-outset.right, dy: dy, rect(width: radius , height: bheight, fill: gradient.linear(dir: ltr, ..grad, space:oklch))) place(bottom+center, dx: dx, dy: shadow-outset.bottom, rect(height: radius , width: bwidth, fill: gradient.linear(dir: ttb, ..grad, space:oklch))) place(horizon+left, dx: -shadow-outset.left, dy: dy, rect(width: radius , height: bheight, fill: gradient.linear(dir: rtl, ..grad, space:oklch))) place(horizon+center, dx: dx, dy: dy, rect(width: bwidth, height: bheight, fill: shadow-fill)) place(horizon+center, dx: dx, dy: dy, rect(width: bwidth, height: bheight, fill: shadow-fill)) } (boxed-content) })) ) }
https://github.com/gvariable/billryan-typst
https://raw.githubusercontent.com/gvariable/billryan-typst/master/README.md
markdown
# Billryan Typst Here is a very simple and minimalist resume template, inspired by - [Resume by Billryan](https://github.com/billryan/resume) - [Alta Typst by <NAME>](https://github.com/GeorgeHoneywood/alta-typst) ## Showcase Here is a screenshot of the resume. <img src="assets/demo.png" width=70% height=70% />. see [`demo.pdf`](demo.pdf) for the pdf version. ## Features - Beginner-friendly with the power of [markup-based typesetting system](https://typst.app/docs/reference/syntax/). - Plug and play in a few minutes. - Easy to extend or customize. - What you see is what you get thanks to the [Typst](https://typst.app). ## Usage ### Online 1. Edit in online template in [Typst app](https://typst.app/project/pX25kHTO1yt1WmO2E4z6uZ). ### Locally 1. Clone this repo locally. ```bash git clone https://github.com/gvariable/billryan-typst.git ``` 2. Download the [Typst](https://github.com/typst/typst) compiler. 3. Use your favorite text editor to edit the `demo.typ` file such as Visual Studio Code with Typst LSP extension installed. 4. Compile it with Typst. ```bash typst compile demo.typ ``` ## Todos - [x] Fix the bug of the progress bar. - [x] Better documentation. - [x] Add support for Chinese. - [x] Refactor code. - [ ] Chinese font. - [ ] Chinese version of readme. - [ ] Add CI to prepare for the release.
https://github.com/SWATEngineering/Docs
https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/3_PB/VerbaliEsterni/VerbaleEsterno_240313/content.typ
typst
MIT License
#import "meta.typ": inizio_incontro, fine_incontro, luogo_incontro, company #import "functions.typ": glossary, team #let participants = csv("participants.csv") #let participants_company = csv("participants_company.csv") = Partecipanti / Inizio incontro: #inizio_incontro / Fine incontro: #fine_incontro / Luogo incontro: #luogo_incontro == Partecipanti di #team #table( columns: (3fr, 1fr), [*Nome*], [*Durata presenza*], ..participants.flatten() ) == Partecipanti di #emph[#company] #for member in participants_company.flatten() [ - #member ] = Sintesi Elaborazione Incontro Durante l'incontro il gruppo ha chiarito con la Proponente alcuni dubbi che vengono esposti in seguito e ha condiviso con essa lo stato di avanzamento del progetto. == Stato di avanzamento del prodotto L'incontro si è aperto con la presentazione dello stato attuale della componente di visualizzazione del prodotto software (Grafana) e con una breve discussione riguardo ai progressi effettuati dall'ultimo SAL, ovvero la ridefinizione dell'architettura sottostante e l'aggiunta di molteplici simulatori. Successivamente, si è discussa la pianificazione temporale dell'attività di codifica per i prossimi sprint. La proponente si è detta soddisfatta del lavoro che il team sta svolgendo e ha approvato la pianificazione presentata. == Candidatura revisione PB Il team ha messo al corrente la Proponente della decisione intrapresa di recente di non affrontare la revisione CA e dunque di volersi limitare alla revisione PB, pianificata orientativamente verso la prima settimana di Aprile. == Test di integrazione Il team ha domandato alla Proponente quali potrebbero essere le modalità preferibili per testare l'integrazione dei componenti del prodotto software. In particolare, un membro del gruppo ha domandato se utilizzare il software Selenium per testare l'effettivo funzionamento della pipeline fino a Grafana fosse adeguato. In risposta, la Proponente ne ha sconsigliato l'utilizzo onde evitare un ulteriore dispendio di risorse e una maggiore complessità. Viene consigliato di testare l'integrazione delle componenti solo per la prima parte di pipeline, fino all'archiviazione dei dati su ClickHouse tramite codice Python. == Performance e qualità In quanto le statistiche offerte direttamente da Docker potrebbero essere influenzate dalle specifiche tecniche della macchina utilizzata, il team ha domandato alla Proponente quali sarebbero le migliori tecnologie per poter testare le performance del prodotto. Viene consigliato di verificare se la tecnologia "Portainer" possa essere utile allo scopo. Inoltre, viene consigliato di contattare il rappresentante aziendale <NAME> tramite email per ricevere ulteriori consigli in merito. == MVP La Proponente ha sollevato un interrogativo riguardo alle modalità di attestazione del prodotto come Minimum Viable Product (MVP), e se la procedura sia rimasta la medesima rispetto all'anno accademico 2022/2023. Il team non ne è al momento a conoscenza, provvederà ad informarsene durante il diario di bordo programmato per venerdì 15 Marzo e riporterà tale informazione alla Proponente quanto prima. == Pianificazione SAL Infine, si è deciso di fissare il prossimo SAL in data mercoledì 20 Marzo alle ore 16.30. Questo in quanto il team ha rimarcato la volontà di mantenere un contatto più stretto con la Proponente, accingendosi ad entrare nel periodo conclusivo del progetto. In tale periodo è infatti molto importante perseguire una risoluzione tempestiva di eventuali problemi che potrebbero emergere e, di conseguenza, portare a ritardi rispetto alla pianificazione.
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/references/cross_module2.typ
typst
Apache License 2.0
#import "base.typ": x #x ----- // path: base.typ #let /* ident after */ x = 1;
https://github.com/dyc3/senior-design
https://raw.githubusercontent.com/dyc3/senior-design/main/README.md
markdown
# Senior Design Project Spec How to build the doc: 1. Install typst 2. In this directory, run ``` make ``` or, if you don't have `make` ``` typst compile main.typ main.pdf ```
https://github.com/Sckathach/adversarial-gnn-based-ids
https://raw.githubusercontent.com/Sckathach/adversarial-gnn-based-ids/main/mini-survey/main.typ
typst
#import "neurips.typ": * // #import "sckathach.typ": * // #show regex("[Gg]raph(es|s)?"): x => celeste(x.text, freq: 0.9) #let ub(X) = $upright(bold(#X))$ #set list(marker: [-]) #let affls = ( tsp: ( department: "Student, Réseaux et Services de Télécom", institution: "Télécom SudParis", location: "Évry", country: "France"), sup_tsp: ( department: "Supervisor, Réseaux et Services de Télécom", institution: "Télécom SudParis", location: "Évry", country: "France"), ) #let authors = ( (name: "<NAME>", affl: "tsp", equal: true), (name: "<NAME>", affl: "tsp", equal: true), (name: "<NAME>", affl: "sup_tsp", equal: true), ) #show: neurips.with( title: [Graph Neural Network based Intrusion Detection and its Robustness against Adversarial Attacks], authors: (authors, affls), keywords: ("Machine Learning", "NeurIPS"), abstract: [ The increasing number of cyberthreats necessitates advanced Intrusion Detection Systems (IDS) for effective network security, as security analysts can not handle all the threats by themselves. Traditional IDS, classified into Network IDS (NIDS) and Host-based IDS (HIDS), have limitations that can be potentially addressed through Machine Learning (ML) advancements. Many studies have tried classical ML techniques, but they have limitations capturing long and complex attacks. In addition, these techniques are very vulnerable to adversarial attack. However, a new type of ML has proven to be particularly efficient in the task of intrusion detection: Graph Neural Networks (GNNs). GNNs offer robust data analysis capabilities by leveraging the structural properties of the network, which traditional method struggle with. This work explores the application of GNNs in IDS, and their robustness against adversarial attacks. Key GNN architectures, including Graph Convolutional Networks (GCN), Graph Sample and Aggregate (GraphSAGE), and Graph Attention Networks (GAT), are discussed in the context of their ability to capture the semantic of attacks. Furthermore, we examine the vulnerabilities of GNNs to adversarial perturbations and various attack strategies, emphasizing the importance of developing resilient defense mechanisms. We conclude with a discussion on the practical implementation of GNN-based IDS, highlighting the balance between detection accuracy and computational feasibility. ], bibliography: bibliography("main.bib"), ) // Advanced styling sheesh, put after all #show #show figure: X => [ #set align(center) #v(1em) #X #v(1em) ] = Introduction To fight against cyberthreat and protect network systems, there are many Intrusion Detection System -- IDS -- to monitor single or multiple hosts. The most general classifications are Network IDS (NIDS) and Host-based IDS (HIDS). The first one performs analysis on traffic to and from all devices of the network, it safeguards every device from unauthorized access. An example is to put a NIDS along the firewall to watch if anyone tries to break it. For HIDS, this one will monitor packets coming to and from a device, and it will alert the administrator if something is suspicious. However, with recent technologies and the progresses in Machine Learning (ML), it might be possible to improve intrusion detection with neural networks. Due to hidden layers and non-linear modelling, neural network-based IDS allows analysing huge volumes of data. But if machine learning is a benefit to many companies, it is also a weapon for cyberattacks. Therefore, the challenge is to find an efficient class of ML that is robustness against adversarial attacks, and that can powerfully process data. A great option is Graph Neural Network (GNN), where information can be represented as graphs. Due to this complex and huge subject, this study will be limited to GNN as Host-IDS and Network-IDS, and how far it is robust against attacks. = Graph Neural Networks The definition of the graph used in this work is as: $ G = (V, E) $ Where $V$ denotes the set of nodes and $E$ the set of edges. The graph can be heterogeneous, which means the nodes can have various types, or homogenous, there is only one type of node. The graph is described by its adjacency matrix $A$ ($abs(V) times abs(V)$). Its nodes features set is represented by a matrix $X space (abs(V) times d_v)$, with $d_v$ the dimension of the nodes' feature space. It is equally possible to define $X_"egdes" space (abs(E) times d_e)$, to attach an embedding to each edge for edge classification or prediction @graph_book. == Graph Encoding and Random Walks Deep learning on graph networks represent a challenging task as graphs can have an arbitrary size and a complex topological structure, in contrary to an image for instance, that have a spatial locality, on a grid. Moreover, graphs often have multimodal features and lack ordering. An encoding should not be dependent on a reference point as this has no sense in graph theory. Thus, the importance to find another way to map similar nodes in the graph closely in the embedding space as shown in @fig:encoding. #figure( image("resources/graph_encoding.png", width: 55%), caption: [The embedding should reflect the structure of the graph, i.e. $"similarity"(u, v) approx ub(Z)_u^top ub(Z)_v$ @gauthier_cgnn_2024.] ) <fig:encoding> To achieve this, a naive algorithm to begin with is the *Random Walk Optimization*. It consists in running a short fixed-length random walk starting from each node $u$, collecting the multiset of nodes visited $v$, and optimizing the embeddings such that $Pr(v_"visited" | u_"starting point") prop ub(Z)_u^top ub(Z)_v$. This technique is still frequently used on multiple tasks like intrusion detection or adversarial attacks on graphs neural networks. It has been improved with algorithms like Deep Walk or Node2Vec. #figure( image("resources/node2vec.png", width:50%), caption: [The Node2Vec algorithm uses biased random walks to control how fast the walk explores and leaves the neighbourhood of the starting node @node2vec.] ) <fig:node2vec> == Graph Convolutional Network (GCN) To apply machine learning to node embedding, common techniques have been taken from traditional neural networks. The first one is the idea of convolutions. As convolutions collect information from the neighbours of each pixel to update the features of this same pixel, they are well suited for the task of embedding nodes. In a way, Graph Convolutional Networks are the generalization of convolutional neural network to non-euclidean spaces. At each iteration of a GCN layer, the following operation is performed on the features of each node: $ ub(h)^((l+1))_u = sigma (sum_(u in cal(N)_v union {u}) 1/c_(u v) ub(W)^((l)) ub(h)^((l))_v) $ <eq:gcn-node-update> Where $cal(N)_v$ are the neighbours of the node $u$, $1/c_(u v)$ is a normalization coefficient, $ub(W)^((l))$ corresponds to the weight parameter to transform information from node $v$, and $sigma$ represent the non-linear activation, usually a ReLU. The embedding of each node is then updated at each GCNConv layer with $ub(h) space (ub(h)^((0)) = X)$. #figure( image("resources/gcn.png", width: 70%), caption: [The structure of a single layer of a GCN (GNNVis @gnnvis).] ) <fig:gcn> As computing new features node per node is unfeasible in practice, GNN and other common graph-based algorithms use operations on matrices. The previous equation @eq:gcn-node-update becomes: #let dtilde = $tilde(D)^(-1/2)$ $ ub(H)^((l+1)) = sigma(dtilde tilde(A) dtilde ub(H)^((l)) ub(W)^((l))) $ Where $tilde(A) = A + I_N$, and $tilde(D)_(i j) = sum_j tilde(A)_(i j)$. One can also define $hat(A) = dtilde tilde(A) dtilde$. A GCN with a single layer is then defined by: $ Z = "softmax"(hat(A) sigma(hat(A) ub(X) ub(W)^((1))) ub(W)^((2))) $ <eq:gcn-one-layer> == Graph Sample and Aggregate (GraphSAGE) The generalization to GCN is the GraphSAGE structure. The general equation is given below @eq:graph-sage. $ ub(h)^((l))_u = "UPDATE"(ub(h)^((l-1))_u, "AGGREGATE"({ub(h)^((l-1))_v, forall v in cal(N)(u)})) $ <eq:graph-sage> Where the AGGREGATE function is a generic function that could be a mean, a pooling or even a Long-Short Term Memory unit (LSTM). The GraphSAGE architecture is wildly implemented as it has a significant advantage: its speed. In fact, the aggregation function is unapplied on all the neighbours, but only on a fraction of them. This fraction is chosen randomly, and this downsamples allows GraphSAGE structure to be stored in dense adjacency lists, which drastically improves efficiency. For this reason, many IDS use GraphSAGE to perform detection in real time on large datasets. Another factor that enhance the practicability of GraphSAGE is its inductive nature. Graph learning can be either inductive or transductive. The first one is the same as supervised machine learning. However, in transductive learning both training and testing dataset is exposed to the model in the learning phase itself, only the features of the test nodes are unrevealed. As the GCN is transductive, each step of the learning algorithm needs the whole graph, which can be impracticable in a real scenario. The transductive issue will be discussed in the following sections. == Graph Attention Network (GAT) GCN and GraphSAGE use aggregation functions that do not take into account the nature of the edge, the functions are often orderless, like mean or max. However, it may be useful to address each neighbour differently. Thus, the graph attention networks an attention weight $alpha_(u v)$ to the previous equation, which gives: $ ub(h)^((l))_u = "UPDATE"(ub(h)^((l-1))_u, sum_(v in cal(N)(u)) alpha_(u v) ub(W)^((l)) ub(h)_v^((l-1))) $ In GCN and GraphSAGE, this weight is equal to $1/abs(cal(N)_u)$, whereas in GAT, it is computed with a MLP layer and a softmax function. GAT and their counterparts, the Heterogeneous Graph Attention Network (HAN) are used for their attention mechanism as they can capture the semantic of meta-paths in the graph. This could correspond to botnet activities for instance, as we will discuss in more detail in incoming sections. The other GNN described in this work are based on the same techniques than the ones presented, usually changing the UPDATE or the AGGREGATION functions. A slightly different last one would be the less common Graph Isomorphism Network (GIN) @xu_powerful_2019, which is based on different assumptions, i.e. the injectivity of the involved functions, to serve a different goal: discriminative power. We still choose to mention it, as it is used in some of the presented works to bypass a number of the other GNN structures' limitations. = GNN-based Intrusion Detection Systems (IDS) There are a few advantages to use GNN for Introduction Detection. Firstly, the *structural property of data*, where data are semi-structured information. GNNs excel in discerning and learning from these structural relationships, and it is crucial for optimal detection performance. Secondly, the *higher-order interaction*. There are structural similarities between data: GNN can subsequently find nodes that exhibit similar patterns of information propagation than an infected node. Finally, the *behavioural supervisory signal*. GNN-based models can be improved by incorporating additional context. #figure( image("resources/schema.png", width: 70%), caption: "Difference between conventional IDS and GNN-based IDS" ) To begin our research, we first read the survey of Bilot et al. (2023) @bilot_graph_2023. This survey states that many GNN-based defences use random walk methods, but these techniques are usually challenging to apply in practice due to the inductive setting. Moreover, these methods are highly dependent on the hyperparameters and tend to prioritize proximity information above structural information. It also mentions spectral methods tend to be less used as they are inherently transductive. Thus, we will focus on more advanced GNN structures, like GCN, Heterogenous Attention Network or Hyper Graphs Neural Networks. The survey lists studies using random walk classification @bowman_detecting_2020 @ramesh_2022, GCN architecture @zhou_automating_2020 @zhang_practical_2022 @zhao_heterogenous_2020 @yongyi_denial_2022, GIN architecture @lo_xgbot_2023 @yuzhen_graphddos_2022, GraphSAGE architecture @lo_egraphsage_2022 @chang_graphbased_2021 @jin_eminbatch_2022 @caville_anomale_2022, and even RNN architectures @isaiah_euler_2023. Other studies tried capturing the semantic of attacks with meta paths @fucheng_mltracer_2020 @yong_lmtracer_2021 @xiaoqing_hetglm_2022. The general architecture for a GNN-based IDS is composed of three classical steps: the preprocessing, the embedding and the detection and training step. This procedure is shown in @fig:ids-3steps. #figure( image("resources/ids-3steps.png"), caption: [General architecture for intrusion detection with GNN-based methods @bilot_graph_2023.] ) <fig:ids-3steps> There are multiples ways to represent network data as graphs. One can construct *Packet Graph*, to deal directly with IP packets; *Flow Graph*, to capture the semantic of a whole TCP or UDP communication; or *Authentication Graph* that represent, as its name suggests, IP addresses as nodes and authentications as edges. Packet graph network is rarely used in literature. As the majority of the traffic is encrypted under TLS @google_report_2023, the payload analysis in unreliable, combined with the fact that creating edges for each packet creates scalability issue. In that manner, we will focus on the other two graph structures. There are two main classes: *Static graph*, for analysing historical and fixed data structures, and *Dynamic graph*, for real time and immediate response. == Graph embedding: a technique to capture the semantics of attacks Studies showed different ways of encoding network information into graphs. The most basic case is to encode systems as nodes and information flows as edges. This approach, made for instance by @zhou_automating_2020, can then be used to apply GCN to detect malicious nodes. However, such a raw encoding lacks information, like long-term dependences traditional GCN are unable to catch due to the over smoothing problem @graph_book. In point of fact, as the diameter of a graph tends to be low compared to the number of nodes (usually six in social networks), and as a $m$-layers GCN aggregates information from the $m$-hop neighbours, information is diluted to the point of uselessness when the number of layers is too significant @zhou_automating_2020 @zhang_practical_2022. This is a reason why using only GNN layers may be unappropriate. To assess this issue, Lo developed XG-BoT @lo_xgbot_2023, a framework to capture the long dependences before using GNN layers. As shown in @fig:xg-bot, each node's features go through a GIN network before being used in the node embedding part. #figure( image("resources/xg_bot.png"), caption: [XG-BoT architecture: using GIN before conventional GNN layers to overcome the oversmoothing issue.] ) <fig:xg-bot> As we shall see in the following examples, GNN-based IDS do not only use on type of GNN to perform detection, it remains purely a part of the system. The rest is frequently achieved by other ML architectures, or special pre/post-processing. For instance, some studies tried meta-paths as a preprocessing technique @zhao_heterogenous_2020 @fucheng_mltracer_2020 @yong_lmtracer_2021 @xiaoqing_hetglm_2022. The goal is to handcraft common paths involving multiple nodes and edges, that the GNN model will then be able to recognize and generalize. #figure( image("resources/meta_path.jpg"), caption: [An heterogenous graph with meta-path preprocessing @zhao_heterogenous_2020.] ) <fig:meta-path> Meta-paths are frequently used as they offer explainability and a low rate of false negatives @fucheng_mltracer_2020. They can be used in other scenario, like intrusion detection on a single machine. The graph is then a provenance graph from processes inside the machine. An example can be found with the study @lv_heterogeneous_2021. This study chooses to use GAT and graph sampling to drastically reduce the size of sub-graphs. Flows are not always represented as edges, some studies used nodes for systems and nodes for edges @pujol-perich_unveiling_2021, we show their results in @sec:against-trad. As we mentionned earlier, the GraphSAGE architecture is popular for detection intrusion tasks, as it can scale on large graphs. For example, the Anomal-E @caville_anomale_2022 frameworks is based on this GraphSAGE architecture and implements a self-supervised way to detect intrusions. It is interesting as it relies on both graph methods and traditional anomaly detection methods. It also does not need any label, as the encoding part is done with the Deep graph infomax method @velickovic_deep_2018, which is an unsupervised one, this makes the approach very practical to real-world scenarios. Hence in this case, the graph structure is only used to aggregate information. A study @fu_detecting_2023 (@ex:hypervision) describes the use of real-time detection with an unsupervised graph. This approach describes a graph construction on flow size classification. In this case, preprocessing allows reducing density and then identify malicious vertices with a loss function. The interesting points are the three metrics which allow evaluating the information retained by exiting traffic: the amount of information, with Shannon entropy; the scale of data; the density of information. #figure( image("resources/hypervision.png", width: 90%), caption: [The structure of HyperVision: subgraph are constructed using flow interactions (@ex:hypervision).] ) #figure( image("resources/hypervision_examples.png", width: 50%), caption: [Example of subgraphs for common attacks (@ex:hypervision).] ) For real-time detection, dynamics graphs needs Flow that are modelled as a sequence of a per-packet feature represented by an aperiodic irreducible discrete-time Markov chain. == Graph detection against traditional detection <sec:against-trad> Pujol-Perich et al. @pujol-perich_unveiling_2021 analysed the advantage of using GNN-based IDS over traditional IDS. They use nodes to encode systems and flows, but their approach is similar to the previous ones. They compared basic IDS techniques, like Random Forests or ID3 decision tree to their method. The table @table:trad-vs-gnn resumes the results. #figure( table( stroke: none, columns: 6, table.vline(stroke: 0.05em, x: 1), [*Class label*], [*MLP*], [*AdaBoost*], [*RF*], [*ID3*], [*GNN*], table.hline(stroke: 0.05em), [Benign], [0.67], [0.68], [*0.99*], [*0.99*], [*0.99*], [SSH-Patator], [0.0], [0.0], [*0.99*], [*0.99*], [0.98], [FTP-Patator], [0.0], [0.0], [*0.99*], [*0.99*], [*0.99*], [DoS GoldenEye], [0.12], [0.0], [0.97], [0.96], [*0.99*], [DoSHulk], [0.63], [0.63], [*0.99*], [*0.99*], [*0.99*], [DoS Slowhttptest], [0.01], [0.0], [*0.98*], [*0.98*], [0.97], [DDoS], [0.51], [0.0], [*0.99*], [*0.99*], [*0.99*], [Web-Brute Force], [0.0], [0.0], [*0.82*], [0.76], [0.73], [Web-XSS], [0.0], [0.0], [0.69], [0.65], [*0.83*], [Bot], [0.0], [0.0], [*0.98*], [*0.98*], [*0.98*], [Port Scan], [0.78], [0.0], [*0.99*], [*0.99*], [*0.99*], ), caption: [Accuracy of different ML-based NIDS over the CICIDS2017 dataset.], kind: table, ) <table:trad-vs-gnn> But the authors mention that the real value of GNN are their robustness to perturbations. As shown in the @fig:gnn-ids-robust. #figure( image("resources/gnn-ids-robust.png", width: 50%), caption: [Evaluation of the accuracy of ML-based NIDS under variations of the packet size (top) and the inter-arrival time (bottom) @pujol-perich_unveiling_2021.] ) <fig:gnn-ids-robust> However, even if GNN may handle normal perturbations, we may see in the next section that they are vulnerable to adversarial perturbations. = Robustness of Graph Neural Networks Deep learning models on graphs excel in tasks like node classification, link prediction, and graph clustering. However, they reveal vulnerabilities to adversarial examples, making them uncertain and unreliable. Given their use in IDS, ensuring the robustness of GNNs is crucial. A typical attack scenario would represent an attacker that compromised a node, i.e. a system, who tries to perform additional benign actions that are useless for the attack. However that compromise the GNN based IDS, thus making the attack stealthy. Put differently, if an IDS detects the attack and classifies the targeted node as compromised, the attacker wants to perform new actions to change the prediction of the IDS for the targeted node. This attack is depicted in the @fig:adding-fake-edges. #figure( image("resources/adding_fake_edges.png", width: 55%), caption: [A misclassification of the target caused by small perturbations of the graph structure and node features. @chen_survey_2022] ) <fig:adding-fake-edges> This attack scenario can be formalized: given $cal(T) subset V$ the target set of nodes, the attacker aims to find a perturbation in the graph, $hat(G) = G + Delta G$, such that the new graph $hat(G)$ satisfies: $ &op(max, limits: #true)_(hat(G) in Psi(G)) sum_(t_i in cal(T)) cal(L)(f_(theta^*)(hat(G), X, t_i), y_i) \ &"s.t." theta^* = op("argmin", limits: #true)_theta sum_(v_i in V) cal(L)(f_(theta^*)(hat(G), X, v_i), y_i) $ <eq:general-attack> To make the attack as imperceptible as possible, the attacker also uses a comparison function $cal(Q)$, such that: $ &cal(Q)(hat(G), G) < epsilon \ &"s.t." hat(G) in Psi(G) $ Where $Psi$ defines the perturbation space of attacks, $f$ the deep learning model with its set of parameters $theta$, and the loss function $cal(L)$ @chen_survey_2022. == Attacker's Knowledge The attack can be a *White-box Attack*, a *Gray-box Attack* or a *Black-box attack*. As white-box attacks are impracticable in the real world, many papers focus on the grey-box attack, which implies knowledge only on the targeted nodes. This fits a scenario where the attacker has access to the target node and tries to become stealthy by changing the target node's prediction. A new type of attack has emerged and has become widely used because of its practicability: the *No-box Attack*. The principle is to create a surrogate model based on the limited understanding of the target model. The attack is then performed on the surrogate model as a white-box attack. Its success will depend on the transferability of the surrogate model. The attacker can have a *Perfect Knowledge*, *Moderate Knowledge* or a *Minimal Knowledge*. Even if the first case is impracticable, it is the most common case used in previous studies (2022). == Types of attacks Contrary to other machine learning fields where attacks such as model extraction or membership inference attack exist, attacks on graph neural networks remain focused on two categories: *Poisoning Attacks* and *Evasion Attacks*. The popularity of the first one can be explained by the wild use of transductive learning which requires test samples, but not their label, during the training stage. While poisoning attacks can be defined according to the general equation @eq:general-attack. Evasion attacks occur after the target model is well trained on a clean graph. == Attack Strategy The attack can be either a *Topology Attack* that targets the adjacency matrix by adding or removing edges. Or a *Feature Attack*, which alter the features of the targeted nodes. In both cases, a budget $Delta$ can be defined: $ underbrace(sum_(u, i) abs(ub(X)_(u i)^((0)) - ub(X)_(u i)^'), "Feature budget") + underbrace(sum_(u < v) abs(A_(u v)^((0)) - A_(u v)^'), "Topology budget") <= Delta $ == Taxonomies of Attacks There are plenty of techniques used to perturbate the GNN's predictions. Some of them are specific to graph learning, such as random walk attacks; other ones come from different machine learning fields, like the gradient-based attacks. The survey of Chen et al. @chen_survey_2022 gave a list of such techniques (2022). There are gradient-based algorithms, such as the iterative gradient attack with an auto-encoder framework by @chen_link_2018 or @sun_poisoning_2028, reinforcement learning based attack methods with @ma_attacking_2019 or @sun_survey_2022, random walk or GCN as surrogate model to attack general GNN @bojchevski_adversarial_2019 @dai_adversarial_2018 @chen_fast_2018 @zugner_adversarial_2018 @wang_attacking_2019, meta-gradients attacks @zugner_adversarial_2024 (2024), generative adversarial network attacks @wang_attack_2020, algorithms based on deepwalk, eigen decomposition and genetic algorithm @bojchevski_adversarial_2019 @yu_unsupervised_2019, auto-encoder based algorithms @bose_generalizable_2020, and heuristic algorithm @waniek_attack_2018. === Use of surrogate models As mentioned, some studies used simpler model to perform their attack. In the case of a GCN, a surrogate model can be produced by removing the non-linearities @zugner_adversarial_2018, i.e. the activation functions. The surrogate model then become: $ Z' = "softmax"(hat(A) hat(A) ub(X) ub(W)^((1)) ub(W)^((2))) = "softmax"(hat(A)^2 ub(X) ub(W)) $ This method is described in the appendix @ex:linear-gcn-surrogate. Another study uses the LinLBP method @wang_attacking_2019 as a surrogate model. The equation then becomes: $ p = q + A dot.circle W p $ With $p$ and $q$ the evolving embedding. The adversarial edges are then transferred to be used on GCN. The method is explained in @ex:linlbp. === Finding techniques to ease the computation To determine if adding or removing an edge can perturbate a system, it is necessary to compute the new adjacency matrix, which can be computationally intensive. This is why studies tried to find approximations or new ways of computing the adjacency matrix. For example, in Zügner's paper @zugner_adversarial_2018, they found the new adjacency matrix could be written as: $ [hat(A)'^2]_(u v) = [hat(A)^2]_(u v) + Delta_(u, v, m, n) $ With $Delta_(u, v, m, n)$ computed in $O(1)$. Bojchevski et al. @bojchevski_adversarial_2019 found a way to manipulate easily the spectrum of the graph. This is done by computing the potential change in the eigen values when adding or removing an edge: $ Delta lambda_y = Delta w_(i j)(2u_(y i)u_(y j) - lambda_y (u_(y i)^2 + u_(y j)^2)) $ As mentioned in @ex:spectrum, spectrum based detection can be bypassed using this technique. === Current Limitations The two main limitations are the *Unnoticeability* and the *Scalability*. Even if studies have often defined an attack budget $Delta$, it is lacking in semantics. As mentionned in @zugner_adversarial_2018, the graph's statistics, such as the degree low, should remain intact, thus the attack should preserve the power distribution law. The second limitation is not limited on graphs, but it can be even more problematic in the field of Graph Neural Networks, as many attacks require the whole graph to perform. High-degree nodes are much harder to attack than low-degree nodes. Thus, the $Delta$ chosen in studies like @zugner_adversarial_2018 @bojchevski_adversarial_2019 is linear in the degree of the node, i.e. $Delta = d_v_0 + a$, ($a = 2$ in @zugner_adversarial_2018 and $a = 3$ in @bojchevski_adversarial_2019). Most of the studies use the Cora dataset or social networks, thus it is yet difficult to know if attacks can be efficient on more complicated datasets, especially on IDS. == Taxonomies of Defenses Currently, the amount of research for defense is far less that that of attack on the graph domain. Moreover, as Chen's survey @chen_survey_2022 mentions it, most existing works (2022) for defense only focus on node classification tasks. It cites a list of used techniques. There are techniques based on preprocessing, like to drop special edges that could be risky @wu_adversarial_2019. Techniques that change the structure of the traditional GNN to improve their robustness, such as the Gaussian-based graph convolutional layers @zhu_robust_2019, or the Adaptive Graph Convolutional Network @ioannidis_edge_2019. Other techniques change the training process, for instance by implying adversarial training @xu_topology_2019 @sun_virtual_2020 @feng_graph_2019 @chen_adversarial_2019 @deng_batch_2019 @he_adversarial_2018. This is a technique already well known in other fields of machine learning, or by changing the loss function to a more robust one @zugner_certifiable_2019 @bojchevski_certifiable_2019 @jin_power_2021 @chen_adversarial_2019. Some tried applying a protection on top of the existing model to try to detect adversaries @zhang_comparing_2019 @ioannidis_graphsac_2019 @hou_alphacyber_2019. Finally, some changed the optimization and the aggregation process to prevent transferability attacks @tang_transferring_2020. = Conclusion In this paper, we present Graph Neural Network and the interest to use it as GNN-based IDS. Instead of conventional IDS, this one use graphs to represent data like address and hosts. The interest is that GNN excel in discerning relationships between nodes, but it can also perform higher-order interaction and can be improved by adding additional content. Specially, this leads to have static graph for analyse data structures and dynamic graph for real-time detection. Moreover, graph-based detection is highly practical with the right framework, as it has been proven to be faster and more energy efficient than other ML based techniques @protogerou_graph_2021. Concerning adversarial attacks, there are not enough studies. However, it appears to be possible to generate adversarial perturbation that could make the attacker invisible, even if GNN seem more robust than other traditional ML models. #pagebreak() = Appendix == Taxonomies summary A summarized of GNN based IDS. It includes Graph Construction and Attacks against them. About construction, GNN can be used for Host Intrusion Detection, Network Intrusion Detection or even Controller Area Network Intrusion Detection. #figure(image("resources/color.png", width: 120%)) == Example of a linear GCN as surrogate model to find adversarial perturbations <ex:linear-gcn-surrogate> Zügner et al. @zugner_adversarial_2018 proposed in 2018 an attacked based on a surrogate model. The principle is straight forward, linearize as much as possible the model's equation to be able to solve the minimisation problem given constraints. Given a GCN model defined as before @eq:gcn-one-layer, the surrogate model is created by removing the non-linearities, i.e. the $sigma$ function: $ Z' = "softmax"(hat(A) hat(A) ub(X) ub(W)^((1)) ub(W)^((2))) = "softmax"(hat(A)^2 ub(X) ub(W)) $ The softmax can also be removed when computing the log-probabilities, thus leaving only one non-linearity: the square. Hence, it is still challenging to attack the model by adding or removing edges. To solve that problem, the authors found a way to fast compute the new adjacency matrix squared $hat(A)^2$. With $A'$ the new adjacency matrix obtained by adding or removing the edge $e = (m, n)$, $hat(A)'^2$ can be computed with: $ [hat(A)'^2]_(u v) = [hat(A)^2]_(u v) + Delta_(u, v, m, n) $ With $Delta_(u, v, m, n)$ computed in $O(1)$. Nonetheless, a feature attack is easier. To find the best node and feature $(u^*, i^*)$ one only needs to compute the gradient: $ Gamma_(u i) = [hat(A)^2]_(v_0 u) ([ub(W)]_(i c) - [ub(W)]_(i c_"old")) $ With $v_0$ the target node, $c_"old"$ the old class and $c$ the new class. This is the perfect example to demonstrate how to transform the initial problem into a gradient-based one. However, this approach is limited to simple architectures of GNN, due to transferability issues. It also requires a full knowledge of the features $ub(X)$ which may be impossible in practice. == Example of a Linearized Loopy Belief Propagation model as surrogate model <ex:linlbp> The paper of Wang et al. @wang_attacking_2019 uses a similar technique to @zugner_adversarial_2018: find a simple surrogate model to use gradient-based techniques. However, they went a bit further as they made the adjacency matrix become continuous, a technique that can be used in other scenario. The targeted model is the Linearized Loopy Belief Propagation (LinLBP). Suppose we are given an undirected graph, a training dataset $L$ which consists of a set of labeled positive nodes $L_P$ and a set of labeled negative nodes $L_N$. LinLBP assigns the prior reputation score $q_u$ for a node $u$ as follows: $ q_u = cases( theta &" if" u in L_P, -theta &" if" u in L_N, 0 &" otherwise" ) $ where $0 < theta <= 1$ is a parameter of LinLBP. LinLBP assigns the same weight $w$ in the interval (0, 0.5] for all edges. A larger weight means that two linked nodes are more likely to have the same label. We denote by $W$ the weight matrix ($abs(V) times abs(V)$), every entry of which is the weight $w$. Then, the posterior reputation scores in LinLBP are a solution of the following system: $ p = q + A dot.circle W p $ where $q$ and $p$ are the column vector of prior reputation scores and posterior reputation scores of all nodes. To solve this equation, the scores are iteratively computed as follows: $ p^((t)) = q + A dot.circle W p^((t-1)) $ where $p^((t))$ is the column vector of posterior reputation scores in the $t$th iteration. When the posterior reputation scores converge, a node $u$ is predicted to be negative if its posterior reputation score is negative, i.e., $p_u < 0$. We note LinLBP has two parameters, the prior reputation score parameter $theta$ and the edge weight $w$. The attack then consists of finding $B$ such as: $ op(min, limits:#true)_B& sum_(u in S, v in V') B_(u v) C_(u v) + n C_"node" \ \ \ "s.t." &"FNR" = 1, "for the fake nodes" \ &"FNR" = 1, "for the target nodes" \ &B_(u v) in {0, 1}, u in S, v in V' \ &sum_v B_(u v) <= K, u in S $ With: - $B$, a binary matrix that indicates a change by the attacker. If $B_(u v) = 1$, it means the edge $(u, v)$ has been either removed if it existed before, or added if it did not. - $C_(u v)$, the cost of insterting an edge between nodes u and v. - $C_"node"$, the cost of creating each fake node. - $n$, the number of fake nodes. - $K$, the max number of edges each fake node can have. - $"FNR" = 1$, achieve as high false negative rate as possible. This attack is then viewed as an optimisation attac. Using Lagrangian multipliers it is possible to achieve this attack in seconds on large datasets where the Nettack attack took hours to compute. It is possible because $B$ is not treated as binary but as a continuous matrix during the computation, and then converted back into a binary matrix. This allows the attacker to use common gradient based algorithms like a projected gradient descent. This attacks works well on collective classifications methods, like LinLBP, with a success of over $0.92$ FNR. However, it can be transferred to Graph Neural Network based classification methods like CNN where it achieves $0.54$ FNR. == Example of a spectrum-based attack on unsupervised learning <ex:spectrum> The paper from Bojchevski et al. @bojchevski_adversarial_2019 shows how to find adversarial edges to modify the spectrum of the graph. The spectrum of the adjacency matrix is often used in graph analysis as it reflects many properties of the graph. It is also used in intrusion detection @majed_spectral_2024. The idea of this paper is to exploit gradient based methods on the spectrum of the adjacency matrix leveraging eigenvalue perturbation theory. To compute the attack efficiently, it is necessary to have an efficient way to computing the new eigen values for each edge flip. Let $u_y$ be the $y$th generalized eigenvector of $A$ with the generalized eigenvalue $lambda_y$. Then the generalized eigenvalue $lambda_y^'$ of $A'$ is approximatively $lambda_y^' = lambda_y + Delta lambda_y$, with $Delta lambda_y$ defined as: $ Delta lambda_y = Delta w_(i j)(2u_(y i)u_(y j) - lambda_y (u_(y i)^2 + u_(y j)^2)) $ This equation allows changes in $O(1)$, thus enabling the attack. However, this approach is mainly used to poison deep walk methods. The results show that a big number of edges have to be flipped in order to have an influence on the predictions. The results are shown in @fig:dw-poisoning. #figure( image("resources/dw_poisoning.png"), caption: [Targeted attack on the link prediction task for Cora and Citeseer datasets.] ) <fig:dw-poisoning> Nonetheless, an interesting discovery has been made by the authors: the adversarial edges found with this method do not appear to have special traits like high centrality. Thus, they concluded classical methods can not be used to find those edges. == Example of more advanced graph structures for intrusion detection: Hyper Graph Neural Networks <ex:hgnn> The main idea behind the use of hypergraphs is that the original graph structure primarily captures pairwise node correlations, with limited capability to model complex, higher-order interactions among multiple nodes. As mentioned in @yang_hrnn_2024, hypergraph structures can effectively model and express complex relationships among multiple nodes, this capability is in theory, beneficial in extracting intricate traffic patterns and relational networks. Another problem is that, usually, the spatial and temporal informations are separated, thus the distinct attention mechanisms can suppress critical information, needed by the other part. The hypergraph is constructed as follows: each flow is a vertex; a hyperedge is created between two similar nodes (based on an euclidean distance in an unknown space), then convolutions are used to encode high-order relationships between flows. This procedure is shown in @fig:hrnn-construction and @fig:hrnn-module. #figure( image("resources/hrnn_construction.png"), caption: [The schematic of hypergraph construction.] ) <fig:hrnn-construction> #figure( image("resources/hrnn_module.png"), caption: [A HRNN Module.] ) <fig:hrnn-module> The authors conclude HRNN generates both robust and semantically expressive embeddings, significantly improving the detection capability of anomaly traffic. This leads to state-of-the-art results on famous datasets like NSL-KDD, ISCXVPN2016 or even CIC-IDS2017. Even if this approach seems interesting, no code is provided and the paper lacks crucial information on why the construction of hypergraph is able to grasp the semantic of attacks. == Example of different meta-paths <ex:meta-path> #figure( image("resources/meta_path_def.jpg"), caption: [Meta-paths in @zhao_heterogenous_2020.] ) == Example of HyperVision, a real time unsupervised ML <ex:hypervision> Since 2019, 80 percents of websites has used HTTPS protocol. #link("https://github.com/fuchuanpu/HyperVision")[HyperVision] is a new method to achieve unsupervised detection -- more realistic case -- and it is able to detect encrypted malicious traffic without accessing to the payload. The interesting point is it needs to build a graph for realtime detection. Usually, flows on Internet are short meanwhile most packets are long. The tool HyperVision records interaction patterns to reduce density of the graph. This one is build with addresses as vertices and flows as edges. To aggregate short flows, the flows must: - have the same source and/or destination; - have same protocol; - be repetitive enough. For connectivity analysis, connected components are found by using depth-first search. This leads to extract abnormal components. To detect malicious traffic, critical vertices are identified with solving the vertex cover problem: in a component, each flows with a source and/or destination of a malicious flow are grouped in a subset. Those edges connected to a critical vertex are clustered, and K-Means algorithm is used to calculate the loss function that indicates the degree of maliciousness. There are three equations: $text("loss"_"center")$ that indicates the difference from other edges connected to the critical vertex; $text("loss"_"count")$ that is the number of flows denoted by the edge; and finally $text("loss")$ function that when it became greater than a threshold indicates maliciousness of the edge. $ "loss"_"center" ("edge") = op(min, limits: #true)_(C_i in {C_1,...,C_k}) norm(C_i - f("edge"))_2 \ "loss"_"count" ("edge") = log_2("Size"(C("edge"))+1) \ "loss"_"cluster" ("edge") = "TimeRange" (C ("edge")) \ "loss" ("edge") = alpha "loss"_"center"("edge") - beta "loss"_"cluster" ("edge") + gamma "loss"_"count" ("edge") $ Where K is the number of cluster centers, $C_i$ is the $i^"th"$ center and $f("edge")$ is the feature vector. #pagebreak()
https://github.com/dogezen/badgery
https://raw.githubusercontent.com/dogezen/badgery/main/badgery.typ
typst
MIT License
#let base-fill-color = rgb("#F2F2F2") #let base-stroke-color = rgb("#828282") #let base-text-color = rgb("#333333") #let badge-colors = ( gray: ( bg: rgb("#f9fafb"), border: rgb("#ebedee"), text: rgb("#4b5563") ), red: ( bg: rgb("#fef2f2"), border: rgb("#fcdedd"), text: rgb("#b91c1b") ), yellow: ( bg: rgb("#fefce8"), border: rgb("#f5e5c1"), text: rgb("#854d0f") ), green: ( bg: rgb("#effdf4"), border: rgb("#cbebd3"), text: rgb("#17803d"), ), blue: ( bg: rgb("#eff6ff"), border: rgb("#dae5fb"), text: rgb("#1c4ed8") ), purple: ( bg: rgb("#faf5ff"), border: rgb("#efdffa"), text: rgb("#7e22ce") ) ) #let ui-action(content) = box( radius: 2pt, inset: 4pt, fill: base-fill-color, stroke: base-stroke-color, width: auto, height: auto, content ) #let badge(content, fill: base-fill-color, stroke: base-stroke-color, text-color: base-text-color) = box( radius: 2pt, inset: 4pt, fill: fill, stroke: stroke, width: auto, height: auto, if type(content) == str { text(fill: text-color, content) } else { content } ) #let badge-gray(content) = badge(content, fill: badge-colors.gray.bg, stroke: badge-colors.gray.border, text-color: badge-colors.gray.text) #let badge-red(content) = badge(content, fill: badge-colors.red.bg, stroke: badge-colors.red.border, text-color: badge-colors.red.text) #let badge-yellow(content) = badge(content, fill: badge-colors.yellow.bg, stroke: badge-colors.yellow.border, text-color: badge-colors.yellow.text) #let badge-green(content) = badge(content, fill: badge-colors.green.bg, stroke: badge-colors.green.border, text-color: badge-colors.green.text) #let badge-blue(content) = badge(content, fill: badge-colors.blue.bg, stroke: badge-colors.blue.border, text-color: badge-colors.blue.text) #let badge-purple(content) = badge(content, fill: badge-colors.purple.bg, stroke: badge-colors.purple.border, text-color: badge-colors.purple.text) #let menu-begin-stroke = ( top: base-stroke-color, left: base-stroke-color, bottom: base-stroke-color, right: none, ) #let menu-end-stroke = ( top: base-stroke-color, right: base-stroke-color, bottom: base-stroke-color, left: none, ) #let menu-middle-stroke = ( top: base-stroke-color, right: none, bottom: base-stroke-color, left: none, ) #let menu-path-output(height: 14.6pt, xStart: -2pt, xEnd: 5pt) = path( fill: base-fill-color, stroke: base-stroke-color, (xStart, 0pt), (0pt, 0pt), (xEnd, height / 2), (0pt, height), (xStart, height) ) #let menu-path-input(height: 14.6pt) = path( fill: base-fill-color, stroke: base-stroke-color, closed: false, (9pt, 0pt), (0pt, 0pt), (4pt, height / 2), (0pt, height), (9pt, height), ) #let menu-begin(content) = context { let height = (measure(content).height + 8pt).abs return stack( dir: ltr, box( radius: 2pt, inset: 4pt, fill: base-fill-color, width: auto, height: auto, stroke: menu-begin-stroke, content ), menu-path-output(height: height) ) } #let menu-end(content) = context { let height = (measure(content).height + 8pt).abs stack( dir: ltr, menu-path-input(height: height), move( dx: -4pt, dy: 0pt, box( radius: 2pt, inset: 4pt, fill: base-fill-color, stroke: menu-end-stroke, width: auto, height: auto, content ) ) ) } #let menu-middle(content) = context { let height = (measure(content).height + 8pt).abs stack( dir: ltr, menu-path-input(height: height), move( dx: -4pt, dy: 0pt, box( radius: 2pt, inset: 4pt, fill: base-fill-color, stroke: menu-middle-stroke, width: auto, height: auto, content ) ), menu-path-output(height: height, xStart: -6pt, xEnd: 5pt) ) } #let menu(..items) = { let positionalItems = items.pos() let count = positionalItems.len() if(count == 1) { ui-action(positionalItems.at(0)) } else { let mapped-items = () for (idx, value) in positionalItems.enumerate() { if (idx + 1) == count { mapped-items.push(menu-end(value)) } else if idx < 1 { mapped-items.push(menu-begin(value)) } else { mapped-items.push(menu-middle(value)) } } stack( dir: ltr, .. mapped-items ) } }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/diagraph/0.1.0/lib.typ
typst
Apache License 2.0
#let plugin = plugin("diagraph.wasm") #let render(text, engine: "dot", width: auto, height: auto, fit: "contain") = { if text.len() != bytes(text).len() { return raw("error: text must be utf-8 encoded") } // add null terminator let encodedText = bytes(text) + bytes((0,)) let encodedEngine = bytes(engine) + bytes((0,)) let render = str( plugin.render(encodedText, encodedEngine) ) if render.slice(0, 6) == "error:" { return raw(render) } else { return image.decode( render, format: "svg", height: height, width: width, fit: fit, ) } } #let raw-render(engine: "dot", width: auto, height: auto, fit: "contain", raw) = { if (not raw.has("text")) { panic("This function requires a `text` field") } let text = raw.text return render(text, engine: engine, width: width, height: height, fit: fit) } #let raw-dotrender-rule( engine: "dot", width: auto, height: auto, fit: "contain", doc ) = { show raw.where(lang: "dotrender"): it => { let text = it.text return render(text, engine: engine, width: width, height: height, fit: fit) } doc }
https://github.com/MrMugame/silverbullet-typst
https://raw.githubusercontent.com/MrMugame/silverbullet-typst/main/README.md
markdown
# Silver Bullet Typst(Wypst) plug ## FYI This plug uses [wypst](https://github.com/0xpapercut/wypst) which is far from finished, so use with caution. Because wypst is mimicking KaTeX, this plug is just a fork of the [KaTeX Plug](https://github.com/silverbulletmd/silverbullet-katex) ## Installation Run the {[Plugs: Add]} command and paste in: `github:MrMugame/silverbullet-typst/typst.plug.js` That's all! ## Use Put a latex block in your markdown: ```typst c = #plus.minus sqrt(a^2 + b^2) ``` And move your cursor outside of the block to live preview it! **Note:** [Wypst](https://github.com/0xpapercut/wypst) itself is not bundled with this plug, it pulls the JavaScript, CSS and fonts from the JSDelivr CDN. This means _this plug will not work without an Internet connection_. The reason for this limitation is that it is not yet possible to distribute font files via plugs, and Wypst depends on specific web fonts and wasm modules. ## Build Assuming you have Deno and Silver Bullet installed, simply build using: ```shell deno task build ``` Or to watch for changes and rebuild automatically ```shell deno task watch ``` Then, load the locally built plug, add it to your `PLUGS` note with an absolute path, for instance: ``` - file:/Users/you/path/to/typst.plug.js ``` And run the `Plugs: Update` command in SilverBullet.
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/031%20-%20Hour%20of%20Devastation/006_Hour%20of%20Eternity.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Hour of Eternity", set_name: "Hour of Devastation", story_date: datetime(day: 12, month: 07, year: 2017), author: "<NAME>", doc ) #emph[The God-Pharaoh has returned, and the five Hours have arrived as foretold. The Hours of Revelation, Glory, and Promise unleashed disaster upon Naktamun, and now the Hour of Eternity brings an unimaginably personal terror to the city's denizens.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Now was faith justified. Nylah had never understood the zealous before, never understood their endless need to proclaim their faith. The gods walked among them, their divinity requiring no faith to believe, only eyes to see. Hands to touch. Ears to listen. Words spoken from the mouths of gods reverberated through the city, their divine weight more solid and true than anything that merely existed. She had never understood faith itself. She thought it weakness, an affectation of piety for those weak of character. What use was faith when the gods were so abundantly #emph[true] ? But now she believed. The God-Pharaoh's return had occupied little thought for her. There was still so much to learn, so much training to do. She wanted to be the best, as did they all. What point was there in thinking past her Trials, when the Trials were all she aspired to? No lover, no child, no friend had ever stayed long in her life. None could compete with her ambition. Yes, the gods deserved her worship, and her daily prayer was her training. Her ultimate goal was to be found worthy. For that desire, she would have no competition. But still her heart quickened when the gate to paradise had opened. To know that #emph[someday] was now, that eternity was #emph[here] . She craned her neck, eager to witness divine bliss . . . but there was no bliss revealed behind those gates, only horror. #figure(image("006_Hour of Eternity/01.jpg", width: 100%), caption: [God-Pharaoh's Faithful | Art by <NAME>], supplement: none, numbering: none) Never had she appreciated the beauty of her city until it was taken from her. The mighty Luxa, once as blue as the summer sky, ran blood red, filled with stinking fish corpses and bubbling filth. Clouds of buzzing locusts stripped gardens and trees bare, swarming small animals and leaving only bones in their wake. Even the gods were dying. Mighty Rhonas. Clever Kefnet. Ambitious Bontu. Beautiful Oketra. All gone, their divinity ripped away by their burgeoning mortality. What god can be a god if they die? Nylah's most wicked thought came to her then, unbidden. #emph[The gods have failed their trial. They deserve their death.] A moment's pause, and then the abyss stretched, beckoned. #emph[We all do.] That last thought did not horrify her. Instead, it kindled an ember deep within, a warmth that comforted, here at the end of now and the beginning of the forever promised them. Her city was destroyed, her gods dead, her people scattered. And never had she believed more completely than now. #emph[We must be tested. Without trial, there can be no honor. Without sacrifice, there can be no glory. Without death, there can be no life. ] The litany of the priests had never found purchase within her before, but now she clung to each word as though it were a raft in a river flood. This was her Trial. This horror was what she must overcome so she could be found worthy. The word thrummed in her heart. #emph[Worthy] . Several angels in the sky, all of whom had overseen the chaos and violence without interference, suddenly threw their heads back and spread their arms and wings, their eyes ablaze with a sickly green glow as they shouted in unison, "The Eternals come!" #figure(image("006_Hour of Eternity/02.jpg", width: 100%), caption: [Angel of the God-Pharaoh | Art by E.M. Gist], supplement: none, numbering: none) She was standing next to the entrance of the central mausoleum, the repository of the worthy dead. As the angels repeated their cry, the gates of the mausoleum opened. A dread figure, tall as a god, cloaked in darkness and shaped in the likeness of a scarab beetle, came striding through the open gates. And behind him, in the wake of his implacable dark divinity, came an army. #figure(image("006_Hour of Eternity/03.jpg", width: 100%), caption: [Hour of Eternity | Art by <NAME>], supplement: none, numbering: none) There were thousands of them, coated in a bright, hard metallic blue. Humans and minotaurs, nagas and aven. All were imposing, though each form was only sinew and bone encased in a polished lazotep glaze more beautiful than any jewelry. Nylah realized that despite their lack of muscle and flesh she could recognize several past champions and challengers of recent Trials. The minotaur Bakenptah, who had run his axe through a stone wall to defeat his final opponent. The mighty mage Taweret, whom many had called the most powerful wizard the Trials had seen for a decade. Everywhere she looked she saw champions she recognized and many more she didn't. All of them wielded weapons, sharp and gleaming, and the dead champions moved with a grace and fluidity that suggested none of them had lost any of the agility or strength that had propelled them to their earlier victories. These were the Eternals. The worthy dead. This was the destiny of those who would be champions. Nylah's heart beat with envy. This destiny was all she had ever wanted. All she still wanted. The scarab god strode past her, taking no notice of her presence, but the army of worthy behind the god noticed her. Their eyes glowed with golden flame and their faces were frozen in grim smiles as they raised their weapons. Nylah could see the soft dusk light shimmering along the edges of their blades. They swarmed her as she cried out in ecstasy, wanting nothing more than to become one with them forever. "Now I believe!#emph[" ] she shouted to her desired brethren. Each blade sunk into her flesh with a cold kiss, a greeting from the other side of glory, a sharpness that could not be imagined, only felt. Only lived. #emph[Now I believe,] she thought with each blow. Her kin swarmed over her, stabbing, stabbing. #emph[Now I believe.] Now was faith rewarded. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Asenue was going to lose. It wasn't that they were better than her, though her opponents were some of the best blademasters she had ever fought, dedicated champions who had lost none of their skill in death. She was a master herself, in the prime of her ability and training. It wasn't that there were two of them against her alone, though the odds were not in her favor. She had chosen her two-blade style precisely because of its usefulness in fighting multiple opponents, and she felt a thrill as she parried and whirled and countered, her wrists a direct extension of her mind, changing between relaxed and tense as she kept herself alive for another parry, another swing, another breath. #emph[One more breath.] No, she was going to lose this fight because she was human. And they were not. Her shoulders ached. Her lungs labored. Her legs tired. Her weapons master's voice came shouting back at her, "You imbeciles think your most important muscles are in your arms, or your shoulders, or your back. It is your legs! When your legs get tired, you die!" Her legs were very, very tired. She was going to lose. She was going to die. Eventually. But not now. Not #emph[right] now. #emph[One more breath.] Just minutes before hundreds of nightmarish creatures with blue armor and skull faces had burst through the streets of Naktamun, slaughtering all in their path. The angels had called them "Eternals." Asenue saw her peers, whether they were crop-mate or friend or barely known acquaintance, fall to the Eternals' blades. #emph[I love you, here at the end, whether I know you or not. I love you all.] It was that love that had propelled her into combat. People died in the initial onslaught, people died as they ran screaming, people died begging for their gods. The Eternals killed them all, no touch of mercy staying their blades. She had leapt into the fray, attracting the attention of two of the Eternals even as countless more streamed by her in their pursuit of slaughter. But these two she could stop. Except she would not even be able to accomplish that. She would not fall to their blades. At least not easily. But while they would not kill her quickly, they were too good for her to overcome. Around her, other fighters had joined the wider battle in the streets, but she heard the sounds of their labored breathing, their clashing steel, their gurgling last cries. No one was coming to save her. But her rescue did not matter. Every moment she stayed alive, that was another person not dying, another person who had another moment. A moment to survive, to get somewhere safe. #emph[There must be somewhere safe, yes? There has to be . . . ] she killed the thought.#emph[ One more breath.] A few minutes ago, #emph[an eternity ago] , panic had threatened to overwhelm her. She was strong, skilled and used to fighting for hours over the course of a day in her normal training . . . but never without stopping, never without a single moment to catch her breath, never against opponents who were faster, stronger, and did not sweat or tire or slip. The panic grew in her chest until she had discovered her new mantra. Then her breathing evened, and the ache in her shoulders grew distant, and the fire in her lungs burned slow, and her legs continued to move and move and move by the sheer strength of her will. #emph[One more breath.] Asenue saw one, two, three more people make it through a broken wall in front of her unscathed. She did not have time to wish them well or even to hope they would still be alive when the suns rose tomorrow. It hurt to breathe. It hurt to move. Her legs were so tired. #emph[One more breath. One more breath. One. More. Brea] — #figure(image("006_Hour of Eternity/04.jpg", width: 100%), caption: [Act of Heroism | Art by Magali Villeneuve], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "Makare! Makare!" Genub frantically screamed his lover's name into the darkening red sky. In the distance he saw the blue armored killers, their grotesque shapes a mockery of their former selves. He knew that to face them was to die, but if he did not find Makare, then he would welcome death. They had pledged themselves to each other months before, saying the three true words that it was forbidden to say. An affront to the God-Pharaoh, the priests called it, but the lovers did not care. Nothing, not the Trials nor their crop-mates nor the God-Pharaoh himself, had mattered in the face of their love. Later that night, in the quiet grove where they had secluded themselves, she had looked up at him, her wide brown eyes the only sight he ever wanted to see. "I will always be with you, Genub," she said. He didn't know how it could be possible, how they could continue to stay together, to avoid the Trials, but at that moment, he didn't care. "I will always be with you, Makare." As he said it, he became more convinced it would become the truth. It felt more true than anything else in Naktamun. And now she was gone. After Oketra had fallen, someone shouted that there was an old temple on the outskirts of the city that would be safe. They ran as part of a large group, Genub's heart beating fast with terror as he clutched Makare's hand tight. #emph[As long as we are together] , he thought, and he clung to that thought desperately. If he was with her, then everything would be alright. Then someone screamed, and the Eternals rushed their street from every side with raised swords, axes, and scythes. One leaped directly in front of Genub and Makare, a naga, smooth and sinuous, casting a spell of blue fire that disintegrated several people behind them. #figure(image("006_Hour of Eternity/05.jpg", width: 100%), caption: [Spellweaver Eternal | Art by <NAME>], supplement: none, numbering: none) Genub couldn't remember what happened after that, only that he ran and ran, his terror leaving no room for any other thought. When next he stopped to breathe, Makare was not there. He had failed her. He had abandoned her. "Makare!" he screamed, wildly swinging his head, desperate for a glimpse. #emph[There! ] Through a desolate, broken plaza he sprinted, her brown hair and bronze-striped dress unmistakable. Even as he ran to her side, he saw the gathering crowd of Eternals flanking her, but nothing would stop him this time, even if he had to fight them all. He skidded to a stop in front of her as she turned her head. Her eyes, the beautiful brown of her eyes, had been replaced with a cold, glowing blue. She stared at him, and there was no love in that gaze. Only then did he notice the large axe in her hand, bloody brown bits staining its blade, and only then did he notice the naga wizard behind her, whispering close into Makare's ear. She raised her axe, and Genub knew this could not be, knew he could reach her to break through whatever spell she was under. They could still be free. They could still be together. "Makare!" The only true thing in this world was their love for each other. "Makare!" He had to reach her, he had to break through. "Makare!" Her swing did not slow as it came. Hers was not the only blade that punctured his flesh, but it was the first. As it fell the last thing Genub saw was the smile on his true love's face. #figure(image("006_Hour of Eternity/06.jpg", width: 100%), caption: [Threads of Disloyalty | Art by Yongjae Choi], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Kawit should have given up when Oketra died. Her god had been present in her life from her earliest memories. Her kindness, her warmth, her presence a constant pull toward being a better person. To know Oketra, to worship Oketra, to bask in her light, was a constant as true as the suns in the sky . . . until Oketra's light was snuffed out, ended by the venomous point of a scorpion's tail. Kawit should have felt despair. Should have felt panic. But instead she only felt rage. A bright, consuming anger, all doubt and fear burnt away by its white-hot clarity. She had knelt at Oketra's side as the lifeblood seeped out of her god, whose eyes were already a dull gray. The plaza was devoid of other life. Most had fled the threat of the Eternals, but Kawit remained, uncaring of any desire but seeing her god one last time. A growing group of anointed had gathered around the god, oiling her skin and wrapping her in cloth to prepare her for whatever destiny awaited the fallen divine. In the midst of the dead, no one cared when Kawit picked up one of Oketra's arrows, its length making it more like a spear in her hands. While the arrow was no longer imbued directly with the god's divine light, Kawit still felt a humming energy within it, an echo of her god's presence. She was a devoted warrior of Oketra, proud and powerful, and she would see her god avenged today. A thunderous clacking sound grew behind her and she turned to see a minotaur Eternal charging toward her at full speed, its long-bladed axe raised high. Kawit had time only to brace with her new-found spear against the charge. #figure(image("006_Hour of Eternity/07.jpg", width: 100%), caption: [Without Weakness | Art by <NAME>], supplement: none, numbering: none) The minotaur crashed into the spear's point, and Kawit felt a surge of power. There was a flash of white light as the minotaur disintegrated, its blue lazotep armor crumbling to dust from the power of Oketra. She stood there panting as her anger continued to rise; it would not be satiated until every Eternal was reduced to dust. And then she saw him. It was the horns she saw first, the long curved shape so intimately familiar to her eyes. Those horns were everywhere in her city, and she knew there was only one being to whom they could belong. It was the God-Pharaoh himself. #figure(image("006_Hour of Eternity/08.jpg", width: 100%), caption: [Omniscience | Art by <NAME>], supplement: none, numbering: none) He was massive, larger than any god. A strange golden egg hovered between his serpentine horns. And he was a dragon. Her mind faltered for a moment, wondering briefly if this was an interloper, some force of evil that had taken over the God-Pharaoh. Was this impostor why her city was destroyed and the Luxa had turned to blood? Was this impostor why her god, her dear, beautiful god, was dead? The clarity of her rage provided an answer, and it hit her with such stunning force that she knew its truth immediately. #emph[This dragon is not an impostor. This dragon is our God-Pharaoh. This is the being we have served all our lives. ] Her stomach roiled, her head feverishly hot. She screamed her challenge into the darkening heavens, raising her spear to the God-Pharaoh#emph[, no, that title no longer] , to the #emph[dragon] . "I will kill you!" She sprinted toward him. Her scream had attracted the attention of a large group of neighboring Eternals, and they ran, slithered, and flew to intercept her. #emph[Oketra, protect me. Give me strength. ] Kawit did not know, really, to whom she was praying, but that did not lessen her confidence that Oketra would provide. And Oketra did. A glowing, pulsing shield formed around Kawit, a tangible expression of Oketra's power and love. Eternals crashed into the shield and bounced off as Kawit continued untouched to the dragon. #emph[Oketra, help me strike true] . Kawit launched the spear into the air and it flew with speed and accuracy she knew she could never have achieved alone. It shone in the air as though launched directly from Oketra's bow as it hurtled toward the side of the unsuspecting dragon's neck. #figure(image("006_Hour of Eternity/09.jpg", width: 100%), caption: [Oketra's Avenger | Art by <NAME>umbo], supplement: none, numbering: none) The Eternals on all sides continued to pound on the force-shield that surrounded her, but to no avail. Oketra's love protected her. She would see justice done this day. At the last possible second, the dragon turned his head toward the spear, and the missile froze mid-air, all speed and force lost in an instant. The spear dropped uselessly to the ground below, snapping in two as it hit the rough stone. The dragon regarded the broken spear for a moment, and then spoke, his voice thunder in a storm, "In a different world, child, in a different time . . .," here the dragon paused, sparing her a glance, "you might have been useful." There was no hate nor anger in his glance, but rather a dry bemusement. He turned and strode off, forgetting she had ever existed. His moment of nonchalance accomplished what a hail of rage could not. She collapsed under the weight of his disregard, stunned at how much of her life he had destroyed without any emotion. It would have been kinder, she realized, to have her life torn away with angry purpose. She knelt there nearly senseless as her shield began flickering. Flickering, and then it was gone. The Eternals closed in, and Kawit did not have strength enough left to scream. #figure(image("006_Hour of Eternity/10.jpg", width: 100%), caption: [Merciless Eternal | Art by <NAME>], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Amenakhte heard footsteps, soft steps, not the hard clink of metal on stone, and thought it might be safe to say a word. In a few minutes, he would not be able to say anything at all. "Help . . ." blood dribbled out of his mouth, and the word gurgled out with it, barely comprehensible. He thought it might be easier to just die then, but he remembered the child underneath him, the brave and smart child who even now stayed silent, careful not to alert any more of the killers. Even as the blood poured out of his mouth, it made him realize how thirsty he was, how much a cup of water would do to heal him. #emph[I will be fine, I just need a cup of water] , he thought. "Help." He said it again, clearly, audibly. It took more strength to say the word than anything else he had done that day, though he had already been strong enough for a lifetime in the last hour alone. Someone turned him over and gasped loudly. He looked at his rescuer, but his eyesight was blurry. All he could make out was that she was human, not one of the army of Eternals that had filled the streets killing everyone they could. "Please," he hacked and spit, more blood coming up. "Please, save the child." He had been running away. They all had. The locusts, the Hekma destroyed, the deaths of the gods. It was all too much. Their world, everything they #emph[thought] about their world, ripped away from them in the time of a day. So they ran. And then they discovered the true horror of the Hours, the true meaning of the God-Pharaoh's return. The Eternals were among them, numerous as the locusts, murderous as the scorpion god, and merciless as the God-Pharaoh himself must be. Their blades swung, their spells flashed, and people died. Amenakhte was large, and he had the broad, strong shoulders and chest of a fighter. But he was not good at fighting, and he had never been brave. The Eternals killed you if you ran, and they killed you if you stayed; Amenakhte had felt the fear taking over his heart until he saw the child wailing in the middle of street. It wasn't his child. He knew that. He had met his child once, a few years ago, even though such chance meetings were usually ignored and certainly never acknowledged. Nevertheless, he had seen the child's broad shoulders, the thick black hair so much like his own, and he had known. #emph[This child is mine. ] And his heart swelled with pride that day, though he could not share his pride with anyone, not even the child's mother, whom he rarely saw. The child he had seen sobbing in the streets did not have thick black hair, nor did he have broad, strong shoulders. But something had pulled at Amenakhte's heart, just as it had on the day he found his own child. The Eternals had started sweeping in from both sides of the street, their blades flashing and their metal-clad feet clacking harshly against stone. He had leapt to the child, scooping him up to carry him away, but the Eternals were everywhere, their blades swinging down, and all that Amenakhte had time to do was put himself between the falling blades and the child, covering him to protect him against all blows. #emph[I am your shield, child.] He had felt every thrust, every cut, but were his shoulders not broad? Was he not strong? With every stab, he thought of the child he protected, his only hope to keep him alive. After a moment that felt like an eternity, the violence was done, and the harsh clacking moved off elsewhere. The man dared not try to move for fear of bringing the Eternals back, but after a few moments, he realized he could not move even if he wanted to. The child had stayed silent throughout without stirring. Even now he could feel no movement. #emph[So brave. So clever. I will save you.] And now the woman was here, and Amenakhte could give the child to the woman. And then he could die. She didn't say anything, but she knelt down and held his hand. Her hands were so warm, so soft. They were almost as good as a drink of water. He looked up at her face, and though he could not see her well, he knew she was beautiful. "You will . . . you will save the child?" Strangely the words were easier now than before, flowing out of him just like blood. She nodded, and Amenakhte could see even through his blurred eyes that she was crying. #emph[Don't cry for me] , he wanted to say. #emph[Just take the child.] But his mouth refused to work. She leaned close, whispering gently into his ear. "The child is . . . I will," she sobbed. "I will . . . save the child." Her voice was like her hands, liquid and warm, like the first drop of golden honey licked off the comb. His vision dimmed, and he tried to drink in her face, her beautiful face, the last sliver of sun before bowing to the night, vast and dark and forever.
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/footnote_04.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test customization. #show footnote: set text(red) #show footnote.entry: set text(8pt, style: "italic") #set footnote.entry( indent: 0pt, gap: 0.6em, clearance: 0.3em, separator: repeat[.], ) Beautiful footnotes. #footnote[Wonderful, aren't they?]
https://github.com/AntonioSilva03/CurriculumVitae
https://raw.githubusercontent.com/AntonioSilva03/CurriculumVitae/main/Curriculum em Português/README.md
markdown
# Modern CV ## Requirements You will need the `Roboto` and `Source Sans Pro` fonts installed on your system or available somewhere. If you are using the `typst` web app, no further action is necessary. You can download them from the following links: - [Roboto](https://fonts.google.com/specimen/Roboto) - [Source Sans Pro](https://github.com/adobe-fonts/source-sans-pro) This template also uses FontAwesome icons via the [fontawesome](https://typst.app/universe/package/fontawesome) package. You will need to install the fontawesome fonts on your system or configure the `typst` web app to use them. You can download fontawesome [here](https://fontawesome.com/download). To use the fontawesome icons in the web app, add a `fonts` folder to your project and upload the `otf` files from the fontawesome download to this folder like so: ![alt text](assets/images/typst_web_editor.png) See `typst fonts --help` for more information on configuring fonts for `typst` that are not installed on your system. ## Building and Testing Locally To build and test the project locally, you will need to install the `typst` CLI. You can find instructions on how to do this [here](https://typst.app/docs/getting-started). With typst installed you can make changes to `lib.typ` and then `install_package_locally.ps1` to install the package locally. Change the import statements in the template files to point to the local package: ```typst #import "@local/modern-cv:0.3.0": * ```` Note that the script parses the `typst.toml` to determine the version number and the folder the local files are installed to. ### Formatting This project uses [typstyle](https://github.com/Enter-tainer/typstyle) to format the code. The script `format_typst.ps1` will format all the `*.typ` files in the project. Be sure to install `typstyle` before running the script. A port of the [Awesome-CV](https://github.com/posquit0/Awesome-CV) Latex resume template in [typst](https://github.com/typst/typst). ## Author | [<img src="https://avatars0.githubusercontent.com/u/6591180?s=460&v=4" width="100"><br><sub>@DeveloperPaul123</sub>](https://github.com/DeveloperPaul123) | |:----:|
https://github.com/swaits/typst-collection
https://raw.githubusercontent.com/swaits/typst-collection/main/finely-crafted-cv/0.1.0/template/main.typ
typst
MIT License
#import "@preview/finely-crafted-cv:0.1.0": * #show: resume.with( name: "<NAME>", tagline: "Innovative marine biologist with 15+ years of experience in ocean conservation and research.", keywords: "marine biology, conservation, research, education, patents", email: "<EMAIL>", phone: "+1-305-555-7890", linkedin-username: "amirapatel", thumbnail: image("assets/my-qr-code.svg"), ) = Research Philosophy My approach to marine biology is rooted in curiosity, collaboration, and conservation. I believe in conducting rigorous scientific research that not only advances our understanding of marine ecosystems but also informs policy decisions to protect our oceans. By fostering interdisciplinary partnerships and engaging with local communities, I strive to create impactful solutions that balance human needs with ecological preservation. = Experience #company-heading("Global Ocean Institute", start: "March 2018", end: "Present", icon: image("./icons/earth.svg"))[ #job-heading("Senior Marine Biologist", location: "Brisbane, Queensland, AU")[ - Leading a team of 12 researchers in a long-term study on coral reef resilience in changing climates. - Developed an AI-powered system for monitoring fish populations, increasing data accuracy by 40%. - Secured \$2.5M in research grants for the institute's sustainable fishing practices initiative. - Mentored 20+ graduate students, with 5 going on to publish in top-tier scientific journals. ] ] #company-heading("OceanTech Solutions", start: "June 2014", end: "February 2018", icon: image("icons/whale.svg"))[ #job-heading("Research Scientist", location: "Baltimore, Maryland")[ - Pioneered use of autonomous underwater vehicles for deep-sea exploration, discovering 3 new species. - Collaborated with engineers to develop biodegradable sensors for ocean pollution monitoring. - Presented findings at 15+ international conferences, establishing the company as a leader in marine tech. ] ] #company-heading("Coral Conservation Alliance", start: "September 2009", end: "May 2014", icon: image("icons/coral.svg"))[ #job-heading("Conservation Biologist", location: "Corpus Christi, Texas")[ - Managed a team of 8 in implementing coral restoration techniques across 5 Caribbean sites. - Increased local community engagement in conservation efforts by 200% through education programs. - Co-authored a policy brief that influenced the establishment of 3 new marine protected areas. ] ] #company-heading("Pacific Marine Research Center", start: "July 2005", end: "August 2009", icon: image("icons/microscope.svg"))[ #job-heading("Research Assistant", location: "San Diego, California", comment: [Contributed to 7 published studies. #footnote[Visit https://amirapatel.org/publications for full list of publications.]] )[] ] = Patents #link( "https://patents.google.com/patent/US20230123456A1", strong("MARINE BIODIVERSITY MONITORING SYSTEM USING ENVIRONMENTAL DNA (US 20230123456A1)") ) #quote[A novel system and method for monitoring marine biodiversity using environmental DNA (eDNA) sampling and analysis. The invention includes an automated collection device capable of filtering seawater at various depths, preserving eDNA samples, and transmitting data in real-time.] = Eligibility and Location - *Eligibility:* United States Permanent Resident - *Location:* Open to remote opportunities or relocation to coastal areas. - *Travel Availability:* Willing to travel up to 40% for field research and conferences. = Education #school-heading("University of California, San Diego", start: "Fall 2001", end: "Spring 2005", icon: image("icons/graduation-cap.svg"))[ #degree-heading("Ph.D. in Marine Biology")[] ] #school-heading("University of Miami", start: "Fall 1997", end: "Spring 2001", icon: image("icons/palm-tree.svg"))[ #degree-heading("B.S. in Marine Science, Minor in Environmental Policy")[] ]
https://github.com/eriol/aruco-tags-pdf
https://raw.githubusercontent.com/eriol/aruco-tags-pdf/main/aruco_mip_36h12.typ
typst
BSD 3-Clause "New" or "Revised" License
#let id = sys.inputs.id #let size = eval(sys.inputs.size) #let is_caption_enabled = sys.inputs.is_caption_enabled #let show_tag(tag, size, is_caption_enabled, caption) = { let image_path = "images/" + tag if is_caption_enabled == "true" { show figure.caption: c => [#c.body] figure( image(image_path, width: size), caption: caption ) } else { show figure.caption: "" figure( image(image_path, width: size), caption: caption ) } } #if id == "0" [ #show_tag( "ARUCO_MIP_36h12_ID0.svg", size, is_caption_enabled, [ARUCO_MIP_36h12 ID: #id], ) ] else if id == "1" [ #show_tag( "ARUCO_MIP_36h12_ID1.svg", size, is_caption_enabled, [ARUCO_MIP_36h12 ID: #id] ) ] else if id == "2" [ #show_tag( "ARUCO_MIP_36h12_ID2.svg", size, is_caption_enabled, [ARUCO_MIP_36h12 ID: #id] ) ]
https://github.com/Marlstar/TypstCustomPackages
https://raw.githubusercontent.com/Marlstar/TypstCustomPackages/master/packages/local/SectionHeader/0.1.0/sectionheader.typ
typst
#let sectionHeader(headerText, c: rgb(64, 177, 230, 100)) = [ #align(center)[ #rect(fill:c, width:100%, inset:8pt, radius:1pt, heading(numbering:none)[#headerText]) ] ]
https://github.com/pawarherschel/typst
https://raw.githubusercontent.com/pawarherschel/typst/main/src/letter.typ
typst
Apache License 2.0
#import "../template/template.typ": * #show: layout #set text(size: 12pt) //set global font size #let dateSeparator = "/" #let date = {[#datetime.today().day()] + dateSeparator + [#datetime.today().month()] + dateSeparator + [#datetime.today().year()]} #let companyName = "<NAME>" #let jobTitle = "Python Intern" #letterHeader( myAddress: [Kharghar, \ Navi Mumbai, \ Maharashtra, \ India - 410210], recipientName: [#companyName], recipientAddress: [], date: [#date], subject: "Subject: Job Application for " + jobTitle, ) Dear Hiring Manager, I am excited to submit my application for the #jobTitle position at #companyName. I am a fresher with little to no experience. However, I am confident in my ability to make a valuable contribution to your team. So far, I've engaged in diverse roles and projects that have enriched my skillset and knowledge. As the Deployment Head for the "SHAN: Shift Handover Application for Nurses" project at MGM's College of Engineering, Navi Mumbai, I led the deployment of a collaborative website, bridging engineering and medical students. I successfully deployed the frontend on Cloudflare Pages and the backend on Cyclic, utilizing the MERN Stack to create an efficient and seamless platform. As for my projects, I've showcased my technical prowess and innovation. My "Booth Archiver" project, initially developed using Python, ported to Rust, demonstrates my ability to create practical tools. This CLI tool not only scrapes data from the Booth website but also generates Excel spreadsheet which makes it easier to search, sort, and filter the data, showcasing a blend of automation and data manipulation skills. I've also ventured into software development through projects like "SQLx VRChat SQLite Test", where I experimented with the SQLx crate in Rust and integrated it with VRCX's SQLite database. I've also made "Stock Crasher" a program that fetches stock prices from Yahoo Finance and then sends it to VRChat via OSC protocol, which is then displayed on the chatbox. Additionally, my participation in the GMTK2023 Game Jam resulted in the creation of "Cosmos Conquerors," a game that ingeniously reverses roles from Space Invaders, demonstrating that I have worked under strict deadlines (48 hours from start to finish). I also have experience in DevOps and Cloud Computing. I used to rent a VPS from oxide.host to host a TailScale VPN server, and then used nginx to reverse proxy pass it to my PC. I used to host a lot of services on my PC, including jellyfin, nextcloud, my own website, and more. I also have experience with Docker and Docker Compose, as I have used them personally to host my own services. Now, I just use Cloudflare Pages to host my website, and Backblade B2 to store my files. Collectively, my professional journey encompasses technical proficiency, and creative problem-solving, positioning me as a well-rounded professional ready to tackle complex challenges in the field. As a highly motivated and detail-oriented individual, I am confident that I would thrive in the fast-paced and dynamic environment at #companyName. I am excited about the opportunity to work with a talented team of professionals and to continue developing my skills in data analysis. Thank you for considering my application. I look forward to the opportunity to discuss my qualifications further. Sincerely, \ // #letterSignature("/src/signature.png") <NAME> #letterFooter()
https://github.com/TGM-HIT/typst-diploma-thesis
https://raw.githubusercontent.com/TGM-HIT/typst-diploma-thesis/main/template/chapters/einleitung.typ
typst
MIT License
#import "../lib.typ": * = Einleitung Zu Beginn wird die Ausgangslage beschrieben, wobei interessant ist woher das Projekt kommt und welche Ansätze an dessen Konzept beteiligt waren. Hier werden auch Ziele gesetzt und Probleme bestimmt, welche in der Arbeit selbst eine große Rolle spielen.
https://github.com/7sDream/fonts-and-layout-zhCN
https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/02-concepts/dimension/walad.typ
typst
Other
#import "/lib/draw.typ": * #import "/lib/glossary.typ": tr #import "/template/lang.typ": arabic #let start = (0, 0) #let end = (1000, 950) #let fg-text = arabic(fill: theme.main)[وَلَد] #let gray-text = arabic(fill: gray)[ولد] #let (bx, by) = (30, 200) #let base = (bx, by) #let boxes = ( ( box: (370, 350), ), ( box: (200, 570), movement: (-110, 600), dashbox: (150, 90), ), ( box: (340, 300), movement: (-145, 450), dashbox: (150, 90), ), ) #let graph = with-unit((ux, uy) => { // mesh(start, end, (100, 100), stroke: 1 * ux + gray) txt(fg-text, base, anchor: "lb", size: 810 * ux, dy: 20) txt(gray-text, (bx, by), anchor: "lb", size: 810 * ux, dy: 20) let line-stroke = ( thickness: 4 * ux, paint: gray.darken(30%), ) let pos = base for arg in boxes { let (width, height) = arg.box rect(pos, width: width, height: -height, stroke: line-stroke) point(pos, radius: 12) let next-pos = (pos.at(0) + width, pos.at(1)) arrow( (pos.at(0), pos.at(1) - 40), (next-pos.at(0), next-pos.at(1) - 40), stroke: (..line-stroke, paint: theme.main), head-scale: 4, ) pos = next-pos if "movement" in arg { let (ox, oy) = arg.movement let endpos = (pos.at(0) + ox, pos.at(1) + oy) arrow( pos, endpos, stroke: (..line-stroke, paint: theme.main, dash: "dashed"), head-scale: 5 ) if "dashbox" in arg { let (width, height) = arg.dashbox let lb = (endpos.at(0) - width / 2, endpos.at(1)) rect( lb, width: width, height: -height, stroke: (..line-stroke, dash: "dashed") ) } } } point(pos, radius: 12) }) #canvas(end, start: start, width: 60%, graph)
https://github.com/coco33920/template_tdd
https://raw.githubusercontent.com/coco33920/template_tdd/main/examples/main.typ
typst
Other
#import "template.typ": template #show: template.with( name: [The Dalek's Den], date: [13 Octobre 2023], title: [Règlement intérieur de The Dalek's Den], logo: "logo_tdd.png", abstract: [Règlement intérieur de l'association _The Dalek's Den_ écrit par _<NAME>_ et ratifié par le conseil d'administration], footer: [Association étudiante de l'ISTIC, Université de Rennes \ Financée par l'Université, l'ISTIC et le FSDIE.], ) #lorem(1000)
https://github.com/gongke6642/tuling
https://raw.githubusercontent.com/gongke6642/tuling/main/Math/Math.typ
typst
#set text( size:10pt, ) #set page( paper:"a5", margin:(x:1.8cm,y:1.5cm), ) #set par( justify: true, leading: 0.52em, ) = 数学 Typst 具有特殊的 数学 语法和库函数,用于排版数学公式。 数学公式可以嵌入文本中显示,也可以作为单独的块状公式显示。 如果数学公式的起始和结束都至少包含一个空格(例如$x^2$),它们将被显示为块状公式。 = 变量 在数学中,单个字母始终按原样显示。 然而,多个字母会被解释为变量和函数。 要逐字显示多个字母,可以将它们放入引号中,并且要访问单个字母变量,可以使用 哈希标签语法。 #image("1.png") = 符号 数学模式提供多种 符号,如 pi、dot 或 RR。 许多数学符号有不同的变体。 您可以通过对符号应用修饰符来选择不同的变体。 Typst 还识别许多简写序列,如 =>,它们近似表示一个符号。 当存在此类简写时,符号的文档中会列出它。 #image("2.png") = 换行 公式也可以包含换行。 每一行可以包含一个或多个对齐点(&),然后这些点将被对齐。 #image("3.png") = 函数调用 数学模式支持特殊的没有哈希前缀的函数调用。 在这些“数学调用”中,参数列表的工作方式与代码中的有点不同: - 在其中,Typst 仍然处于“数学模式”中。 因此,您可以直接将数学写入其中,但需要使用哈希语法传递代码表达式(字符串除外,在数学语法中可用)。 - 它们支持位置参数和命名参数,但不支持尾部内容块和参数扩展。 - 它们为二维参数列表提供附加的语法。 分号(;)将逗号分隔的前导参数合并为数组参数。 #image("4.png") 要在数学调用中写入逐字的逗号或分号,请用反斜杠进行转义。 另一方面,如果冒号直接在标识符之前,则只有在特定方式直接前置的情况下才会被特殊识别,因此在这些情况下逐字显示它,可以在其前插入一个空格。 由哈希前缀引导的函数调用是正常的代码函数调用,不受这些规则的影响。 = 对齐 当方程包含多个对齐点(&)时,这将创建交替右对齐和左对齐的列块。在下面的示例中,表达式(3x + y) / 7是右对齐的,= 9是左对齐的。单词“given”也是左对齐的,因为 && 在一行中创建两个对齐点,交替对齐两次。& & 和 && 行为完全相同。与此同时,“multiply by 7”右对齐,因为只有一个 & 位于其前面。每个对齐点简单地交替在右对齐和左对齐之间。 #image("5.png") = 数字字体 您可以通过 show-set规则 来设置数学字体,如下所示。请注意,只有特殊的 OpenType 数学字体适用于数学排版。 #image("6.png") = 数字模块 所有数学函数都属于 math 模块,在方程中默认可用。在方程之外,可以使用 math. 前缀访问它们。 = 定义 #[ #set list(marker: [--]) - accent 将重音附加到基底。 - attach 下标、上标和限制。 - cancel 在方程的一部分上显示对角删除线。 - cases 左大括号 / 分支。 - class 强制使用特定的数学类。 - equation 数学方程。 - frac 数学分数。 - lr 定界符匹配。 - mat 矩阵。 - op 方程中的文本运算符。 - roots 平方根和其他方根。 - sizes 强制公式中表达式的大小样式。 - styles 显示样式。 - underover 方程的部分上方或下方的定界符。 - variants 公式中的备用字体。 - vec 列向量。 ]
https://github.com/alex-touza/fractal-explorer
https://raw.githubusercontent.com/alex-touza/fractal-explorer/main/paper/meta.typ
typst
#let meta = ( title: "Estudi matemàtic i computacional dels objectes fractals", subtitle: "Un aprofundiment en topologia, geometria i dimensió " ) #let PRINT = true #let FINISHED = false #let CHECKED = false #let PLOTS = true
https://github.com/FlorentCLMichel/quetta
https://raw.githubusercontent.com/FlorentCLMichel/quetta/main/src/tengwar_proto.typ
typst
MIT License
#let tengwar-font = "Tengwar Annatar"; #let tengwar-font-fallback = "tngan"; #let tengwar-font-alt = "Tengwar Annatar Alt"; #let tengwar-font-alt-fallback = "tngana"; #let escape-regxp(x) = if ("$", "^").contains(x) { "\\" + x } else { x } #let to-string(content) = { if content.has("text") { content.text } else if content.has("children") { content.children.map(to-string).join("") } else if content.has("body") { to-string(content.body) } else if content == [ ] { " " } } #let array-to-string(it) = { let res = "" for x in it { res += x } res } #let array-to-string-or(it) = { let res = "" for x in it.slice(0,-1) { res += x + "|" } res + "[" + it.last() + "]" // using brakets for the last element to escape the `?` } #let tinco = "\u{0031}" #let tinco-alt = "\u{0021}" #let ando = "\u{0032}" #let ando-alt = "\u{0040}" #let sule = "\u{0033}" #let anto = "\u{0034}" #let numen = "\u{0035}" #let ore = "\u{0036}" #let romen = "\u{0037}" #let silme = "\u{0038}" #let silme-alt = "\u{002a}" #let hyarmen = "\u{0039}" #let parma = "\u{0071}" #let parma-alt = "\u{0051}" #let umbar = "\u{0077}" #let umbar-alt = "\u{0057}" #let formen = "\u{0065}" #let ampa = "\u{0072}" #let malta = "\u{0074}" #let malta-s = "\u{0161}" #let vala = "\u{0079}" #let arda = "\u{0075}" #let silmenuquerna = "\u{0069}" #let silmenuquerna-alt = "\u{0049}" #let halla = "\u{00bd}" #let calma = "\u{0061}" #let calma-alt = "\u{0041}" #let anga = "\u{0073}" #let anga-alt = "\u{0053}" #let aha = "\u{0064}" #let anca = "\u{0066}" #let noldo = "\u{0067}" #let anna = "\u{0068}" #let lambe = "\u{006a}" #let lambe-alt = "\u{ffff}\u{006a}\u{fffe}" #let esse = "\u{006b}" #let esse-alt = "\u{004b}" #let iglide = "\u{006c}" #let quesse = "\u{007a}" #let quesse-alt = "\u{005a}" #let ungwe = "\u{0078}" #let ungwe-alt = "\u{0058}" #let hwesta = "\u{0063}" #let hwesta-s = "\u{006f}" #let unque = "\u{0076}" #let nwalme = "\u{0062}" #let wilya = "\u{006e}" #let alda = "\u{006d}" #let essenuquerna = "\u{002c}" #let essenuquerna-alt = "\u{003c}" #let uglide = "\u{002e}" #let carrier-i = "\u{0060}" #let carrier-j = "\u{007e}" #let comma = "\u{003d}" #let period = "\u{002d}" #let period = "\u{002d}" #let en-dash = "\u{005c}" #let em-dash = "\u{00c2}" #let exclamationmark = "\u{00c1}" #let questionmark = "\u{00c0}" #let tehta-a = "\u{0043}" #let tehta-e = "\u{0056}" #let tehta-i = "\u{0042}" #let tehta-o = "\u{004e}" #let tehta-u = "\u{004d}" #let tehta-y = "\u{00cf}" #let tehta-y-up = "\u{00d7}" #let tehta-w = "\u{00e9}" #let tehta-aa = "\u{ffff}\u{0043}\u{fffe}" #let tehta-ee = "\u{ffff}\u{0056}\u{fffe}" #let tehta-ii = "\u{ffff}\u{0042}\u{fffe}" #let tehta-oo = "\u{ffff}\u{004e}\u{fffe}" #let tehta-uu = "\u{ffff}\u{004d}\u{fffe}" #let l-paren = "\u{0152}" #let r-paren = "\u{0153}" #let tilde = "p" #let slash = "\u{203a}" #let consonants = ( tinco, tinco-alt, ando, ando-alt, sule, anto, numen, ore, romen, silme, "\\" + silme-alt, hyarmen, parma, parma-alt, umbar, umbar-alt, formen, ampa, malta, malta-s, str(vala), arda, silmenuquerna, silmenuquerna-alt, halla, calma, calma-alt, anga, anga-alt, aha, anca, noldo, anna, lambe, lambe-alt, esse, esse-alt, quesse, quesse-alt, ungwe, ungwe-alt, hwesta, hwesta-s, unque, nwalme, wilya, alda, essenuquerna, essenuquerna-alt, iglide, uglide, ) #let vowels = ( carrier-i, carrier-j, tehta-a, tehta-e, tehta-i, tehta-o, tehta-u, tehta-y, tehta-y-up, tehta-w, ) #let all-letters = ("\u{fffd}",) + vowels + consonants #let letter-shapes = ( str(tinco) : "y", str(tinco-alt) : "y", str(ando) : "yy", str(ando-alt) : "yy", str(sule) : "b", str(anto) : "bb", str(numen) : "m", str(ore) : "n", str(romen) : "y", str(silme) : "y", str(silme-alt) : "y", str(hyarmen) : "b", str(parma) : "y", str(parma-alt) : "y", str(umbar) : "yy", str(umbar-alt) : "yy", str(formen) : "b", str(ampa) : "bb", str(malta) : "m", str(malta-s) : "m", str(vala) : "n", str(arda) : "y", str(silmenuquerna) : "y", str(silmenuquerna-alt): "y", str(halla) : "b", str(calma) : "y", str(calma-alt) : "y", str(anga) : "yy", str(anga-alt) : "yy", str(aha) : "n", str(anca) : "b", str(noldo) : "m", str(anna) : "o", str(lambe) : "O", str(lambe-alt) : "O", str(esse) : "d", str(esse-alt) : "d", str(uglide) : "o", str(quesse) : "y", str(quesse-alt) : "y", str(ungwe) : "yy", str(ungwe-alt) : "yy", str(hwesta) : "b", str(hwesta-s) : "b", str(unque) : "bb", str(nwalme) : "m", str(wilya) : "n", str(alda) : "yy", str(essenuquerna) : "y", str(essenuquerna-alt) : "y", str(iglide) : "n", str(uglide) : "o", ) #let tehtar = ( str(tehta-a), str(tehta-e), str(tehta-i), str(tehta-o), str(tehta-u), str(tehta-y), str(tehta-y-up), str(tehta-w), ) #let vowels-shifted = ( tehta-a + "m" : "\u{0023}", tehta-e + "m" : "\u{0024}", tehta-i + "m" : "\u{0025}", tehta-o + "m" : "\u{005e}", tehta-u + "m" : "\u{0026}", tehta-y + "m" : "\u{00cc}", tehta-y-up + "m" : "\u{00d4}", tehta-w + "m" : "\u{00e8}", tehta-a + "O" : "\u{0023}", tehta-e + "O" : "\u{0024}", tehta-i + "O" : "\u{0025}", tehta-o + "O" : "\u{005e}", tehta-u + "O" : "\u{0026}", tehta-y + "O" : "\u{00b4}", tehta-y-up + "O" : "\u{00d4}", tehta-w + "O" : "\u{00e8}", tehta-a + "yy" : "\u{0023}", tehta-e + "yy" : "\u{0024}", tehta-i + "yy" : "\u{0025}", tehta-o + "yy" : "\u{005e}", tehta-u + "yy" : "\u{0026}", tehta-y + "yy" : "\u{00cc}", tehta-y-up + "yy" : "\u{00d4}", tehta-w + "yy" : "\u{00e8}", tehta-a + "bb" : "\u{0023}", tehta-e + "bb" : "\u{0024}", tehta-i + "bb" : "\u{0025}", tehta-o + "bb" : "\u{005e}", tehta-u + "bb" : "\u{0026}", tehta-y + "bb" : "\u{00cc}", tehta-y-up + "bb" : "\u{00d4}", tehta-w + "bb" : "\u{00e8}", tehta-a + "n" : "\u{0045}", tehta-e + "n" : "\u{0052}", tehta-i + "n" : "\u{0054}", tehta-o + "n" : "\u{0059}", tehta-u + "n" : "\u{0055}", tehta-y + "n" : "\u{00cd}", tehta-y-up + "n" : "\u{00d2}", tehta-w + "n" : "\u{00e9}", tehta-a + "o" : "\u{0044}", tehta-e + "o" : "\u{0046}", tehta-i + "o" : "\u{0047}", tehta-o + "o" : "\u{0048}", tehta-u + "o" : "\u{004a}", tehta-y + "o" : "\u{00ce}", tehta-y-up + "o" : "\u{00d3}", tehta-w + "o" : "\u{00e9}", tehta-a + "b" : "\u{0044}", tehta-e + "b" : "\u{0046}", tehta-i + "b" : "\u{0047}", tehta-o + "b" : "\u{0048}", tehta-u + "b" : "\u{004a}", tehta-y + "b" : "\u{00cd}", tehta-y-up + "b" : "\u{00d3}", tehta-w + "b" : "\u{00ea}", tehta-a + "y" : "\u{0045}", tehta-e + "y" : "\u{0052}", tehta-i + "y" : "\u{0054}", tehta-o + "y" : "\u{0059}", tehta-u + "y" : "\u{0055}", tehta-y + "y" : "\u{00ce}", tehta-y-up + "y" : "\u{00d4}", tehta-w + "y" : "\u{00e9}", tehta-a + "d" : "\u{0045}", tehta-e + "d" : "\u{0046}", tehta-i + "d" : "\u{0047}", tehta-o + "d" : "\u{0048}", tehta-u + "d" : "\u{004a}", tehta-y + "d" : "\u{00cd}", tehta-y-up + "d" : "\u{00d2}", tehta-w + "d" : "\u{00ea}", ) #let vowels-shifted-it = ( tehta-o + "y" : "\u{0048}", ) #let undertilde = ( "m" : "\u{003a}", "O" : "\u{00b0}", "n" : "\u{003b}", "o" : "\u{003b}", "b" : "\u{003b}", "y" : "\u{003b}", "bb" : "\u{003a}", "yy" : "\u{003a}", ) #let overtilde = ( "m" : "\u{0050}", "O" : "\u{0050}", "n" : "\u{0070}", "o" : "\u{0070}", "b" : "\u{0070}", "y" : "\u{0070}", "bb" : "\u{0050}", "yy" : "\u{0050}", ) #let overbar = ( "m" : "\u{007b}", "O" : "\u{007b}", "n" : "\u{005b}", "o" : "\u{005b}", "b" : "\u{005b}", "y" : "\u{005b}", "bb" : "\u{007b}", "yy" : "\u{007b}", ) #let s-hooks = ( str(tinco) : "\u{002b}", str(tinco-alt) : "\u{002b}", str(ando) : "\u{002b}", str(ando-alt) : "\u{002b}", str(sule) : "\u{002b}", str(anto) : "\u{002b}", str(numen) : "\u{002b}", str(ore) : "\u{002b}", str(parma) : "\u{00a1}", str(parma-alt) : "\u{00a1}", str(umbar) : "\u{00a1}", str(umbar-alt) : "\u{00a1}", str(formen) : "\u{00a1}", str(ampa) : "\u{00a1}", str(malta) : "\u{00a1}", str(malta-s) : "\u{00a1}", str(vala) : "\u{00a1}", str(calma) : "\u{007c}", str(calma-alt) : "\u{007c}", str(anga) : "\u{007c}", str(anga-alt) : "\u{007c}", str(aha) : "\u{007c}", str(anca) : "\u{007c}", str(noldo) : "\u{007c}", str(anna) : "\u{007c}", str(quesse) : "\u{007c}", str(quesse-alt) : "\u{007c}", str(ungwe-alt) : "\u{007c}", str(hwesta) : "\u{007c}", str(hwesta-s) : "\u{007c}", str(unque) : "\u{007c}", str(nwalme) : "\u{007c}", str(wilya) : "\u{007c}", str(lambe) : "\u{00a5}", ) #let numbers-shifted = ( "0" : "\u{fff0}", "1" : "\u{fff1}", "2" : "\u{fff2}", "3" : "\u{fff3}", "4" : "\u{fff4}", "5" : "\u{fff5}", "6" : "\u{fff6}", "7" : "\u{fff7}", "8" : "\u{fff8}", "9" : "\u{fff9}", "10" : "\u{fffa}", "11" : "\u{fffb}", ) #let digits = ("\u{00f0}", "\u{00f1}", "\u{00f2}", "\u{00f3}", "\u{00f4}", "\u{00f5}", "\u{00f6}", "\u{00f7}", "\u{00f8}", "\u{00f9}", "\u{00fa}", "\u{00fb}") #let numbers-unshift = ( "\u{fff0}" : "\u{00f0}", "\u{fff1}" : "\u{00f1}", "\u{fff2}" : "\u{00f2}", "\u{fff3}" : "\u{00f3}", "\u{fff4}" : "\u{00f4}", "\u{fff5}" : "\u{00f5}", "\u{fff6}" : "\u{00f6}", "\u{fff7}" : "\u{00f7}", "\u{fff8}" : "\u{00f8}", "\u{fff9}" : "\u{00f9}", "\u{fffa}" : "\u{00fa}", "\u{fffb}" : "\u{00fb}", ) #let number-to-quenya(txt) = { let n_base_10 = int(txt) if n_base_10 == 0 { return numbers-shifted.at("0") } let n_base_12 = () while n_base_10 > 0 { n_base_12.push(calc.rem-euclid(n_base_10, 12)) n_base_10 = calc.div-euclid(n_base_10, 12) } n_base_12.map(m => numbers-shifted.at(str(m))).join() } // Adjust the spacing between esse and other consonants #let re-esse-adjust = regex(esse + "(" + array-to-string-or(tehtar) + "*)" + "(" + array-to-string-or(consonants) + ")") #let adjust-esse(it) = { let m = it.text.match(re-esse-adjust).captures if (text.style == "italic") and ("n", "m", "o").contains(letter-shapes.at(m.at(1))) { esse + h(-0.15em) + m.at(0) + m.at(1) } else { esse + m.at(0) + m.at(1) } } // Adjust the spacing between lambe and silmenuquerna #let re-lambe-silmenuquerna-adjust = regex(lambe + "(" + array-to-string-or(tehtar) + "*)" + silmenuquerna) #let adjust-lambe-silmenuquerna(it) = { let m = it.text.match(re-lambe-silmenuquerna-adjust).captures if (text.style == "italic") { lambe + h(-0.22em) + m.at(0) + silmenuquerna } else { lambe + m.at(0) + silmenuquerna } } // Adjust the vertical positions of tehtars above a tilde, upper y, or esse #let v-adjust-tehta = ( "\u{00e8}": -1em, "\u{00e9}": -1.1em, "\u{00ea}": -1.1em, "\u{00d2}": -1em, "\u{00d3}": -1em, "\u{00d4}": -1em, "\u{00d7}": -1em, str(essenuquerna-alt): -1.2em, ) #let codes-adjust-tehta = v-adjust-tehta.keys() #let re-tehtar-adjust = regex("(" + array-to-string-or(codes-adjust-tehta) + ")" + "(" + array-to-string-or(vowels-shifted.values().map(escape-regxp)) + ")") #let adjust-tehtar(it) = { let m = it.text.match(re-tehtar-adjust).captures m.at(0) + box(height: 0pt, move(dy: v-adjust-tehta.at(m.at(0)), m.at(1))) } // Adjust the spacing between digits #let re-digits-adjust = regex("(" + array-to-string-or(digits) + ")" + "(" + array-to-string-or(digits) + ")") #let adjust-digits(it) = { let m = it.text.match(re-digits-adjust) let d1 = m.captures.at(0) let d2 = m.captures.at(1) if (d1 == digits.at(4)) and (digits.slice(7,9).contains(d2)) { d1 + h(0.1em) + d2 } else if (d1 == digits.at(4)) and (d2 == digits.at(11)) { d1 + h(0.05em) + d2 } else { d1 + d2 } }
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/lang-with-region-01.typ
typst
Other
// with unknown region configured #set text(lang: "zh", region: "XX") #outline()
https://github.com/Zateros/analizis-vizsga
https://raw.githubusercontent.com/Zateros/analizis-vizsga/main/analizis_vizsga.typ
typst
#import "@preview/cetz:0.2.2" #let colorS = color.rgb("#B4D3B4") #let colorQ = color.rgb("#FB772A") #let colorT = color.rgb("#8AEAFD") #set page( paper: "a4", numbering: "1.", margin: (x: 40pt, y: 40pt) ) #set document( author: "<NAME> & <NAME>", title: "Analízis vizsga tételek" ) #set text( size: 15pt, font: "Times New Roman" ) #set par(justify: true) #set enum(numbering: "1.)") #show heading.where(level: 1): it => align(center)[ #it #v(10pt) ] #show heading.where(level: 2): it => block( fill: colorS, inset: 10pt, radius: 4pt, )[#it] #show heading.where(level: 3): it => [#underline[#it]] #let color_description(color, desc) = [ #grid( columns: (auto,auto,auto), gutter: 4pt, align: horizon + center, rect(width: 20pt, height: 20pt, fill: color, radius: (rest: 5pt)), [-], [#desc] ) ] = Analízis vizsga bizonyítással kért tételek #grid( columns: (auto, auto, auto), gutter: 10pt, color_description(colorS, "Sorozat"), color_description(colorT, "Sorok"), color_description(colorQ, "Vegyes") ) == Teljes indukció elve Tegyük fel, hogy minden $n$ természetes számra adott egy $A(n)$ állítás, és azt tudjuk, hogy + $A(0)$ igaz + ha $A(n)$ állítás igaz, akkor $A(n+1)$ is igaz Ekkor az $A(n)$ állítás minden $n$ természetes számra igaz. === Bizonyítás Legyen $ S colon.eq {n in NN bar A(n) "igaz"} $ Ekkor $S subset NN$ és $S$ induktív halmaz, hiszen $0 in S$, és ha $n in S$, azaz $A(n)$ igaz, akkor $A(n + 1)$ is igaz, ezért $n + 1 in S$ teljesül, következésképpen $S$ induktív halmaz. Mivel $NN$ a legszűkebb induktív halmaz, ezért az $NN subset S$ tartalmazás is fennáll, tehát $S eq NN$. Ez pedig azt jelenti, hogy minden $n$ természetes számra igaz. #pagebreak() == A szuprémum elv Legyen $H subset RR$ és tegyük fel, hogy + $H eq.not emptyset$ + $H$ felülről korlátos Ekkor $ exists min{K in RR bar K "felsőkorlátja" H"-nak"} $ === Bizonyítás Legyen $ A colon.eq H space "és" space B colon.eq {K in RR bar K "felsőkorlátja" H"-nak"} $ A feltételek miatt $A eq.not emptyset "és" B eq.not emptyset$, továbbá $ forall a in A "és" forall K in B: a lt.eq K $ A teljességi axiómából következik, hogy $ exists epsilon in RR: a lt.eq epsilon lt.eq K space (a in A, K in B) $ Erre az $epsilon$-ra az teljesül, hogy + $epsilon$ felsőkorlátja $H$-nak, hiszen $a lt.eq epsilon$ minden $a in A$ esetén + $epsilon$ a legkisebb felső korlát, ui. ha $K$ egy felső korlát (azaz $K in B$), akkor $K gt.eq epsilon$. Ez pedig pontosan azt jelenti, hogy $epsilon$ a $H$ halmaz legkisebb felső korlátja. #pagebreak() == Az arkhimédészi tulajdonság Minden $a gt 0$ és minden $b$ valós számhoz létezik olyan $n$ természetes szám, hogy $b lt n dot a$, azaz $ forall a gt 0 "és" forall b in RR: exists n in NN: b lt n dot a $ === Bizonyítás (indirekt módon) Tegyük fel, hogy $ exists a gt 0 "és" exists b in RR: forall n in NN: b gt.eq n dot a $ Legyen $ H colon.eq {n dot a in RR bar n in NN} $ Ekkor $H eq.not emptyset$ és $H$ felülről korlátos, hiszen $n dot a lt.eq b$ minden $n in NN$-re. A szuprémum elv szerint: $ exists sup H eq.colon epsilon $ Ekkor $epsilon$ a legkisebb felsőkorlátja $H$-nak, tehát $epsilon - a$ nem felső korlát. Ez azt jelenti, hogy: $ exists n_0 in NN: n_0 dot a gt epsilon - a arrow.double.r.l.long (n_0 + 1) dot a gt epsilon $ Azonban $(n_0 + 1) dot a in H$, tehát $(n_0 + 1) dot a lt.eq epsilon$, hiszen $epsilon$ felső korlátja a $H$ halmaznak. Így ellentmondáshoz jutunk. #pagebreak() == A Cantor-tulajdonság Tegyük fel, hogy minden n természetes számra adott az $[a_n,b_n] subset RR$ korlátos és zárt intervallum úgy, hogy $ [a_(n+1),b_(n+1)] subset [a_n,b_n] space (n in NN) $ Ekkor $ sect.big_(n in NN)[a_n,b_n] eq.not emptyset $ === Bizonyítás (teljességi axiómát alkalmazva) Legyen $ A colon.eq {a_n bar n in NN} "és" B colon.eq {b_n bar n in NN} $ Először belátjuk, hogy $ a_n lt.eq b_m "tetszőleges" n,m in NN "esetén" $ Valóban, + ha $n lt.eq m$, akkor $a_n lt.eq a_m lt.eq b_m$ + ha $m lt n$, akkor $a_n lt.eq b_n lt.eq b_m$ Mivel $A eq.not emptyset "és" B eq.not emptyset$, ezért "$a_n lt.eq b_m "tetszőleges" n,m in NN "esetén"$" miatt a teljességi axióma feltételei teljesülnek, így $ exists epsilon in RR: a_n lt.eq epsilon lt.eq b_m space space forall n,m in NN "indexre" $ Ha $n eq m$, akkor azt kapjuk, hogy $ a_n lt.eq epsilon lt.eq b_n space arrow.double.l.r.long space epsilon in [a_n,b_n] space space forall n in NN "esetén" $ és azt jelenti, hogy $ epsilon in sect.big_(n in NN)[a_n,b_n] eq.not emptyset $ #pagebreak() == Konvergens sorozatok határértékének egyértelműsége (\*) #h(weak: true,20pt) $exists A in RR: forall epsilon gt 0: exists n_0 in NN: forall n gt n_0 "indexre" |a_n - A| lt epsilon$ Ha az $(a_n) : NN → RR$ sorozat konvergens, akkor a konvergencia definíciójában szereplő $A$ szám egyértelműen létezik. === Bizonyítás Tegyük fel, hogy az $(a_n)$ sorozatra (\*) az $A_1$ és az $A_2$ számokkal is teljesül. Indirekt módon tegyük fel azt is, hogy $A_1 eq.not A_2$. Ekkor $forall epsilon gt 0$ számhoz $ exists n_1 in NN: forall n gt n_1 : abs(a_n − A_1) lt epsilon $ $ exists n_2 in NN: forall n gt n_2 : abs(a_n − A_2) lt epsilon $ Válasszuk itt speciálisan az $ epsilon colon.eq abs(A_1 - A_2)/2 $ (pozitív) számot. Az ennek megfelelő $n_1, n_2$ indexeket figyelembe véve legyen $ n_0 colon.eq max{n_1,n_2} $ Ha $n in NN "és" n gt n_0$, akkor nyilván $n gt n_1 "és" n gt n_2$ is fennáll, következésképpen $ abs(A_1 - A_2) eq abs((A_1 - a_n) + (a_n - A_2))lt.eq abs(a_n - A_1) + abs(a_n - A_2) \ lt epsilon + epsilon eq 2epsilon eq abs(A_1 - A_2) $ amiből (a nyilván nem igaz) $abs(A_1 − A_2) lt abs(A_1 - A_2)$ következne. Ezért csak $A_1 eq A_2$ lehet. #pagebreak() == A konvergencia és a korlátosság kapcsolata Ha az $(a_n)$ sorozat konvergens, akkor korlátos is. === Bizonyítás Tegyük fel, hogy $(a_n)$ konvergens és $lim(a_n) eq A in RR$. Válasszuk a konvergencia definíciója szerinti jelöléssel $epsilon$-t 1-nek. Ehhez a hibakorláthoz $ exists n_0 in NN, forall n gt n_0: abs(a_n - A) lt 1 $ Így $ abs(a_n) eq abs((a_n - A) + A) lt.eq abs(a_n - A) + abs(A) lt 1 + abs(A) space space space (n gt n_0) $ Ha $n lt.eq n_0$, akkor $ abs(a_n) lt.eq max{abs(a_0),abs(a_1),dots,abs(a_n_0)} $ Legyen $ K colon.eq max{abs(a_0),abs(a_1),dots,abs(a_n_0), 1 + abs(A)} $ Ekkor $abs(a_n) lt.eq K$ minden $n in NN$ indexre,és ez azt jelenti, hogy $(a_n)$ sorozat korlátos. #pagebreak() == Monoton részsorozatok létezésére vonatkozó tétel Minden $a eq (a_n)$ valós sorozatnak létezik monoton részsorozata, azaz létezik olyan $v eq (v_n)$ indexsorozat, amellyel $a compose v$ monoton növekvő vagy monoton csökkenő. === Bizonyítás Az állítás igazolásához bevezetjük egy sorozat csúcsának a fogalmát: Azt mondjuk, hogy $a_n_0$ az $(a_n)$ sorozat csúcsa (vagy csúcseleme), ha $ forall n gt.eq n_0 "indexre" a_n lt.eq a_n_0 $ Két eset lehetséges: + A sorozatnak végtelen sok csúcsa van. Ez azt jelenti, hogy $ exists v_0 in NN: a_v_0 "csúcselem, azaz " forall n gt.eq v_0: a_n lt.eq a_v_0 $ $ exists v_1 gt v_0: a_v_1 "csúcselem, azaz " forall n gt.eq v_1: a_n lt.eq a_v_1 (lt.eq a_v_0) $ Ezek a lépések folytathatók, mert végtelen sok csúcselem van. Így olyan $v_0 lt v_1 lt v_2 lt dots$ indexsorozatot kapunk, amelyre $ a_v_0 gt.eq a_v_1 gt.eq a_v_2 gt.eq dots"," $ ezért a csúcsok $(a_v_n)$ sorozata $(a_n)$-nek egy monoton csökkenő részsorozata. + A sorozatnak legfejlebb véges sok csúcsa van. Ez azt jelenti, hogy $ exists N in NN, forall n gt.eq N "esetén" a_n "már nem csúcs" $ Mivel $a_N$ nem csúcselem, ezért $ exists v_0 gt N: a_v_0 gt a_N $ Azonban $a_v_0$ sem csúcselem, ezért $ exists v_1 gt v_0: a_v_1 gt a_v_0 (gt a_N) $ Az eljárást folytatva most olyan $v_0 lt v_1 lt v_2 lt dots$ indexsorozatot kapunk, amelyre $ a_v_0 lt a_v_1 lt a_v_2 lt dots $ Ebben az esetben tehát $(a_v_0)$ sorozat $(a_n)$-nek egy (szigorúan) monoton növekvő részsorozata. #pagebreak() == A sorozatokra vonatkozó közrefogási elv Tegyük fel, hogy az $(a_n), (b_n), (c_n)$ sorozatokra teljesülnek a következők: #list( $ exists N in NN, forall n gt N: a_n lt.eq b_n lt.eq c_n$, $ "az" (a_n) "és a" (c_n) "sorozatnak van határértéke, továbbá"$ ) $ lim(a_n) eq lim(c_n) eq A in macron(RR) $ Ekkor a $(b_n)$ sorozatnak is van határértéke és $lim(b_n) eq A$ #set enum(numbering: "1.") === Bizonyítás Három eset lehetséges:\ *1. eset:* $A in RR$ Legyen $epsilon gt 0$ tetszőleges valós szám. $lim(a_n) = lim(c_n) = A$ azt jelenti, hogy $(a_n) "és" (c_n)$ azonos A határértékkel rendelkező konvergens sorozatok. A konvergencia definíciója szerint tehát $ exists n_1 in NN, forall n gt n_1 : A - epsilon lt a_n lt A + epsilon $ $ exists n_2 in NN, forall n gt n_2 : A - epsilon lt c_n lt A + epsilon $ Legyen $n_0 colon.eq max{N, n_1, n_2}.$ Ekkor $forall n gt n_0$ indexre $ A - epsilon lt a_n lt.eq b_n lt.eq c_n lt A + epsilon $ Ez az jelenti, hogy $ abs(b_n - A) lt epsilon, space "ha" n gt n_0 $ azaz a $(b_n)$ sorozat konvergens, tehát van határértéke, és $lim(b_n) = A$ *2. eset:* $A eq +infinity$ Tegyük fel, hogy $P gt 0$ tetszőleges valós szám. A $lim(a_n) eq +infinity$ értelmezése szerint $ exists n_1 in NN, forall n gt n_1 : a_n gt P $ Legyen $n_0 colon.eq max{N, n_1}.$ Ekkor $forall n gt n_0$ indexre $ P lt a_n lt.eq b_n $ és ez azt jelenti hogy $lim(b_n) eq +infinity$ *3. eset:* $A eq -infinity$ Tegyük fel, hogy $P lt 0$ tetszőleges valós szám. A $lim(c_n) eq -infinity$ értelemzése szerint $ exists n_1 in NN, forall n gt n_1 : c_n lt P $ Legyen $n_0 colon.eq max{N,n_1}$, akkor $forall n gt n_0$ indexre $ P gt c_n gt.eq b_n $ Ez pedig azt jelenti, hogy $lim(b_n) eq -infinity$ #pagebreak() == Műveletek nullsorozatokkal Tegyük fel, hogy $lim(a_n) = 0 "és" lim(b_n) = 0$ Ekkor + $(a_n + b_n)$ is nullsorozat, + ha $(c_n)$ korlátos sorozat, akkor $(c_n dot.op a_n)$ is nullsorozat + $(a_n dot.op b_n)$ is nullsorozat === Bizonyítás *1.* Mivel $lim(a_n) = lim(b_n) = 0, "ezért" forall epsilon gt 0"-hoz"$ $ exists n_1 in NN, forall n gt n_1 : abs(a_n) lt epsilon/2 $ $ exists n_2 in NN, forall n gt n_2 : abs(b_n) lt epsilon/2 $ Legyen $n_0 colon.eq max{n_1,n_2}$. Ekkor $forall n gt n_0$ indexre $ abs(a_n + b_n) lt.eq abs(a_n) + abs(b_n) lt epsilon/2 + epsilon/2 eq epsilon, $ és ez azt jelenti, hogy $lim(a_n + b_n) = 0$, azaz $(a_n + b_n)$ valóban nullsorozat. *2.* A $(c_n)$ sorozat korlátos, ezért $ exists K gt 0 : abs(c_n) lt K (n in NN) $ Mivel $(a_n)$ nullsorozat, ezért $ forall epsilon gt 0"-hoz" exists n_0 in NN, forall n gt n_0 : abs(a_n) lt epsilon/K, $ következésképpen minden $ n gt n_0$ indexre $ abs(c_n dot.op a_n) eq abs(c_n) dot.op abs(a_n) lt K dot.op epsilon/K eq epsilon, $ azaz $lim(c_n dot.op a_n) eq 0.$ *3.* Mivel minden konvergens sorozat korlátos, ezért a $lim(b_n) = 0$ feltételből következik, hogy $(b_n)$ korlátos sorozat. Az állítás tehát a 2. állítás közvetlen következménye. #pagebreak() == Konvergens sorozatok szorzatára vonatkozó tétel Tegyük fel, hogy az $(a_n)$ és a $(b_n)$ sorozat konvergens. Legyen $ lim(a_n) = A in RR "és" lim(b_n) = B in RR $ Ekkor $(a_n dot.op b_n)$ is konvergens és $lim(a_n dot.op b_n) = lim(a_n) dot.op lim(b_n) = A dot.op B$ #set math.cases(reverse: true) === Bizonyítás (\*) #h(weak: true,20pt)$(x_n)$ konvergens, és $alpha in RR$ a határértéke $arrow.r.l.double.long (x_n - alpha)$ nullsorozat (\*) miatt elég megmutatni, hogy $(a_n b_n - A B)$ nullsorozat. Ez a következő átalakítással igazolható: $ a_n b_n - A B = a_n b_n - A b_n + A b_n - A B = underbrace(underbrace(underbrace(b_n, "korlátos") dot.op underbrace((a_n - A),"nullsorozat"),"nullsorozat") + underbrace(underbrace(A,"korlátos") dot.op underbrace((b_n - B),"nullsorozat"), "nullsorozat"),"nullsorozat") $ A fenti gondolatmenetben a $(b_n)$ sorozat azért korlátos, mert konvergens. #pagebreak() == Konvergens sorozatok hányadosára vonatkozó tétel Tegyük fel, hogy az $(a_n) "és a" (b_n)$ sorozat konvergens. Legyen $ lim(a_n) = A in RR "és" lim(b_n) = B in RR $ Ekkor ha $b_n != 0 (n in NN) "és" lim(b_n) != 0$, akkor $ (a_n/b_n) "is konvergens, és" lim(a_n/b_n) = lim(a_n)/lim(b_n) = A/B $ === Bizonyítás (\*) $(x_n)$ konvergens, és $alpha in RR$ a határértéke $arrow.r.l.long.double (x_n - alpha)$ nullsorozat. === Segédtélel: Ha $b_n != 0 (n in NN)$ és $(b_n)$ konvergens, továbbá $B colon.eq lim(b_n) != 0$, akkor az $ (1/b_n) $ reciprok-sorozat korlátos.\ Ennek bizonyításához legyen $epsilon colon.eq abs(B)/2$. Ekkor egy alkalmas $n_0 in NN$ küszöbindex mellett $ abs(b_n - B) lt epsilon eq abs(B)/2 space space forall n gt n_0 "indexre." $ Így minden $n gt n_0$ esetén $ abs(b_n) gt.eq abs(B) - abs(b_n - B) gt abs(B) - abs(B)/2 = abs(B)/2 $ hiszen $abs(B) eq abs(B - b_n + b_n) lt.eq abs(B-b_n) + abs(b_n)$. Tehát $ abs(1/b_n) lt 2/abs(B)," ha " n gt n_0, $ következésképpen az $ abs(1/b_n) lt.eq max{1/abs(b_0),1/abs(b_1),....,1/abs(b_n_0), 2/abs(B)} $ egyenlőtlenség már minden $n in NN$ számra teljesül, ezért az $(1/b_n)$ sorozat valóban korlátos. A segédtételt tehát bebizonyítottuk.\ \ Most az látjuk be, hogy az $ (1/b_n) "sorozat konvergens és" lim(1/b_n) = 1/B $ Ez (\*)-ből következik az alábbi átalakítással: $ 1/b_n - 1/B eq (B - b_n)/(B dot.op b_n) eq underbrace(underbrace(1/(B dot.op b_n),"korlátos") dot.op underbrace((B - b_n),"nullsorozat"),"nullsorozat") $ Az állítás bizonyításának a befejezéséhez már csak azt kell figyelembe venni, hogy $ a_n/b_n eq a_n dot.op 1/b_n space space space (n in NN) $ más szóval az $(a_n/b_n)$ hányados-sorozat két konvergens sorozat szorzata. Így a 2. állítás (konvergens sorozat szorzata) és a reciprok sorozatról az előbb mondottak miatt $ (a_n/b_n) "is konvergens és" lim(a_n/b_n) eq A dot.op 1/B = A/B = lim(a_n)/lim(b_n) $ #pagebreak() == Monoton növekvő sorozatok határértékére vonatkozó tétel (véges és végtelen eset) Minden $(a_n)$ monoton sorozatnak van határértéke. 1. Ha $(a_n) arrow.tr$ és felülről korlátos, akkor $(a_n)$ konvergens és $ lim(a_n) = sup{a_n | n in NN} $ 2. Ha $(a_n) arrow.tr$ és felülről nem korlátos, akkor $lim(a_n) = +infinity$ === Bizonyítás 1. Tegyük fel, hogy az $(a_n)$ sorozat monoton növekvő és felülről korlátos. Legyen $ A colon.eq sup{a_n | n in NN} in RR. $ Ez azt jelenti, hogy $A$ a szóban forgó halmaznak a legkisebb felső korlátja, azaz #list($forall n in NN : a_n lt.eq A "és"$, $forall epsilon gt 0"-hoz" exists n_0 in NN : A - epsilon lt a_"n0" lt.eq A.$) Mivel a feltételezésünk szerint az $(a_n)$ sorozat monoton növekvő, ezért az $ A - epsilon lt a_"n0" lt.eq a_n lt.eq A. $ becslés is igaz minden $n gt n_0$ indexre. Azt kaptuk tehát, hogy $ forall epsilon gt 0"-hoz" exists n_0 in NN, forall n gt n_0 : abs(a_n -A) lt epsilon. $ Ez pontosan azt jelenti, hogy az $(a_n)$ sorozat konvergens, és $lim(a_n) = A$.\ \ 2. Tegyük fel, hogy az $(a_n)$ sorozat monoton növekvő és felülről nem korlátos. Ekkor $ forall P > 0"-hoz" exists n_0 in NN : a_"n0" gt P. $ A monotonitás miatt ezért egyúttal az is igaz, hogy $ forall n gt n_0 : a_n gt.eq a_"n0" gt P, $ és ez pontosan azt jelenti, hogy $lim(a_n) eq +infinity.$ #pagebreak() == Az $a_n colon.eq (1 + 1 / n)^n (n in NN^(+))$ sorozat konvergenciája Az $ a_n colon.eq (1 + 1 / n)^n (n in NN^(+)) $ sorozat szigorúan monoton növekvő és felülről korlátos, tehát konvergens. Legyen $ e colon.eq limits(lim)_(n arrow.r +infinity)(1+1/n)^n. $ === Bizonyítás Az állítást a számtani és a mértani közép közötti egyenlőtlenség „ötletes” felhasználásaival bizonyítjuk. - A monotonitás igazolásához az egyenlőtlenséget az $(n+1)$ darab $ 1, 1+1/n, 1+ 1/n, ... space, 1+1/n $ számra alkalmazzuk. Mivel ezek nem mind egyenlők, ezért $ root(n+1,1 dot.op (1+1/n)^n) lt (1+n dot.op (1+1/n))/(n+1) eq (n+2)/(n+1) = 1 +1/(n+1) $ Mindkét oldalt $(n+1)$-edik hatványra emelve azt kapjuk, hogy $ a_n eq (1+1/n)^n lt (1+ 1/(n+1))^(n+1) eq a_(n+1) (n in NN^(+)) $ amivel beláttuk, hogy a sorozat szigorúan monoton növekvő. - A korlátosság bebizonyításához most az $(n+2)$ darab $ 1/2, 1/2, 1+1/n, 1+ 1/n, ... space, 1+1/n $ számra alkalmazzuk ismét a számtani és a mértani közép közötti egyenlőtlenséget: $ root(n+2,1/2 dot.op 1/2 dot.op (1+1/n)^n) lt (2 dot.op 1/2 + n dot.op (1+1/n))/(n+2) eq (n+2)/(n+2) = 1 $ Ebből következik, hogy $ a_n eq (1+1/n)^n lt 4 space space(n in NN^(+)) $ ezért a sorozat felülről korlátos.\ A monoton sorozatok határértékére vonatkozó tételből következik, hogy a sorozat konvergens. #pagebreak() #show heading.where(level: 2): it => it.body #show heading.where(level: 2): it => block( fill: colorT, inset: 10pt, radius: 4pt, )[#it] == A végtelen sorokra vonatkozó Cauchy-féle konvergenciakritérium A $sum a_n$ sor akkor és csak akkor konvergens, ha $ forall epsilon gt 0"-hoz" exists n_0 in NN, forall m gt n gt n_0 colon abs(a_(n plus 1) plus a_(n plus 2) plus dots plus a_m) lt epsilon $ === Bizonyítás Tudjuk, hogy $ sum a_n "konvergens" &arrow.double.l.r.long &(s_n) "konvergens" &arrow.double.l.r.long (s_n) "Cauchy-sorozat" $ azaz $ forall epsilon gt 0"-hoz" exists n_0 in NN, forall n, m gt n_0 colon abs(s_m minus s_n) lt epsilon $ teljesül. Állításunk abból következik, hogy ha $m gt n$, akkor $ s_m minus s_n eq a_(n plus 1) plus a_(n plus 2) plus dots plus a_m $ #pagebreak() == Végtelen sorokra vonatkozó összehasonlító kritériumok \ Legyenek $sum(a_n) " és " sum(b_n)$ nemnegatív tagú sorok. Tegyük fel, hogy $ exists N in NN, forall n gt.eq N : 0 lt.eq a_n lt.eq b_n $ Ekkor 1. #strong("Majoráns kritérium"): ha a $sum(b_n)$ sor konvergens, akkor $sum(a_n)$ sor is konvergens. 2. #strong("Minoráns kritérium"): ha a $sum(a_n)$ sor divergens, akkor $sum(b_n)$ sor is divergens === Bizonyítás Az általánosság megszorítása nélkül feltehetjük, hogy $a_n lt.eq b_n$ minden $n in NN$ esetén, hiszen véges sok tag megváltozásával egy sor konvergenciája nem változik. Jelölje $(s_n)$, illetve $(t_n)$ a $sum(a_n)$, illetve a $sum(b_n)$ sorok részletösszegeiből álló sorozatokat. A feltevésünk miatt $s_n lt.eq t_n (n in NN)$. Ekkor a nemnegatív tagú sorok konvergenciáról szóló tétel szerint 1. ha a $sum(b_n)$ sor konvergens, akkor $(t_n)$ korlátos, így $(s_n)$ is az. Ezért a $sum(a_n)$ sor is konvergens. 2. ha $sum(a_n)$ sor divergens, akkor $(s_n)$ nem korlátos, így $(t_n)$ sem az. Ezért a $sum(b_n)$ sor is divergens. #pagebreak() == A Cauchy-féle gyökkritérium Tekintsük a $sum(a_n)$ végtelen sort, és tegyük fel, hogy létezik az $ A := lim_(n arrow +infinity) root(n,abs(a_n)) in macron(RR) $ határérték. Ekkor 1. $0 lt.eq A lt 1$ esetén a $sum(a_n)$ sor abszolút konvergens (tehát konvergens is), 2. $A gt 1$ esetén a $sum(a_n)$ sor divergens 3. $A eq 1$ esetén a $sum(a_n)$ sor lehet konvergens is, divergens is === Bizonyítás Mivel $root(n, abs(a_n)) gt.eq 0 (n in NN)$, ezért $A gt.eq 0$. 1. Tegyük fel, hogy $0 lt.eq A lt 1$ Vegyünk egy $A$ és 1 közötti $q$ számot! $ lim(root(n,abs(a_n))) lt q arrow.double.long exists n_0 in NN, forall n gt n_0 : root(n,abs(a_n)) lt q, "azaz" abs(a_n) lt q^n $ Mivel $0 lt q lt 1$, ezért a $sum(q^n)$ mértani sor konvergens. Így a majoráns kritérium szerint a $sum(abs(a_n))$ sor is konvegens, és ez azt jelenti, hogy a $sum(a_n)$ végtelen sor abszolút konvergens. 2. Tegyük fel, hogy $A gt 1$ Vegyünk most egy 1 és $A$ közötti $q$ számot! $ lim(root(n, abs(a_n))) gt q arrow.r.double.long exists n_0 in NN, forall n gt n_0 : root(n, abs(a_n)) gt q, "azaz" abs(a_n) gt q^n $ Tehát, véges sok $n$ indextől eltekintve $abs(a_n) gt q^n gt 1$\ Ebből következik, hogy $lim(a_n) != 0$, és így a $sum(a_n)$ sor divergens. 3. Tegyük fel, hogy $A eq 1$. Ekkor a $sum(1/n)$ divergens sor esetében $abs(a_n) eq 1/n$, azaz $ lim_(n arrow +infinity)root(n,abs(a_n)) eq lim_(n arrow + infinity)1/(root(n,n)) eq 1 $ a $sum(1/n^2)$ konvegens sor esetében $abs(a_n) eq 1/n^2$, azaz $ lim_(n arrow +infinity)root(n,abs(a_n)) eq lim_(n arrow + infinity)1/(root(n,n^2)) eq 1 $ #pagebreak() == A d'Alembert-féle hányadoskritérium \ Tegyük fel, hogy a $sum(a_n)$ végtelen sor tagjai közül egyik sem 0 és létezik az $ A := lim_(n arrow + infinity)abs(a_(n+1)/a_n) in macron(RR) $ határérték. Ekkor\ 1. $0 lt.eq A lt 1$ esetén a $sum(a_n)$ sor abszolút konvergens (tehát konvergens is), 2. $A > 1$ esetén a $sum(a_n)$ sor divergens, 3. $A eq 1$ esetén a $sum(a_n)$ sor lehet konvegens is, divergens is. === Bizonyítás \ Világos, hogy $A gt.eq 0$.\ 1. Legyen $0 lt.eq A lt 1$ és vegyünk egy olyan $q$ számot, amire $A lt q lt 1$ teljesül. Ekkor $ lim_(n arrow +infinity)(abs(a_(n+1)))/(abs(a_n)) lt q arrow.double.long exists n_0 in NN, forall n gt.eq n_0 : (abs(a_(n+1)))/(abs(a_n)) lt q, "azaz" abs(a_(n+1)) lt q abs(a_n) $ Ez azt jelenti, hogy $ abs(a_(n_0+1)) lt q abs(a_n_0), abs(a_(n_0+2)) lt q abs(a_(n_0+1)), ... , abs(a_(n-1)) lt q abs(a_(n-2)), abs(a_(n)) lt q abs(a_(n-1)) $ minden $n gt.eq n_0$ esetén. Így $ abs(a_n) lt q abs(a_(n-1)) lt q^2 abs(a_(n-2)) lt ... lt q^(n-n_0) abs(a_n_0) eq q^(-n_0) abs(a_n_0) q^n eq a q^n $ ahol $a := q^(-n_0) abs(a_n_0)$ egy n-től független konstans. A $sum(a q^n)$ mértani sor konvergens, mert $0 lt q lt 1$. Ezért a majoráns kritérium szerint a $sum(abs(a_n))$ sor is konvergens, vagyis a $sum(a_n)$ végtelen sor abszolút konvergens. 2. Legyen $A gt 1$ és vegyünk most egy olyan $q$ számot, amire $1 lt q lt A$ teljesül. Ekkor $ lim_(n arrow +infinity) (abs(a_(n+1)))/(abs(a_n)) gt q arrow.double.long exists n_0 in NN, forall n gt.eq n_0 : (abs(a_(n+1)))/(abs(a_n)) gt q, "azaz" abs(a_(n+1)) gt q abs(a_n) gt abs(a_n) $ Ebből következik, hogy a $lim(a_n) != 0$, így a $sum(a_n)$ sor divergens. 3. Tegyük fel, hogy $A eq 1$. Ekkor \ $sum(1/n)$ divergens sor esetében $abs(a_n) = 1/n$, azaz $lim_(n arrow +infinity) abs(a_(n+1))/abs(a_n) eq lim_(n arrow + infinity) n/(n+1) eq 1$ \ \ $sum(1/n^2)$ konvergens sor esetében $abs(a_n) eq 1/n^2$azaz $lim_(n arrow infinity) abs(a_(n+1))/abs(a_n) eq lim_(n arrow infinity) n^2/(n+1)^2 eq 1$ #pagebreak() == Leibniz-típusú sorok konvergenciája === Definíció A $0 lt.eq a_(n+1) lt.eq a_n (n in NN^+)$ feltételt kielégítő sorozatból képzett $ ∑_(n eq 1) (−1)^(n + 1) a_n eq a_1 − a_2 + a_3 − a_4 + dots $ váltakozó előjelű sort *Leibniz-típusú sornak* nevezzük. *Konvergencia:* A $sum_(n eq 1) (−1)^(n + 1) a_n$ Leibniz-típusú sor akkor és csak akkor konvergens, ha $lim(a_n) eq 0$. === Bizonyítás $arrow.double$) A sorok konvergenciájának szükséges feltétele értelmében, ha a $sum (−1)^(n + 1) a_n$ sor konvergens, akkor $lim((−1)^(n + 1) a_n) eq 0$, ami csak akkor lehetséges, ha $lim(a_n) eq 0$. $arrow.double.l$) Tegyük fel, hogy $sum_(n eq 1) (−1)^(n + 1)a_n$ egy Leibniz-típusú sor, és $lim(a_n) eq 0$. Igazoljuk, hogy a sor konvergens. Legyen $ s_n colon.eq sum_(k eq 1)^n (-1)^(k + 1) a_k eq a_1 - a_2 + a_3 - a_4 + a_5 - dots + (-1)^(n + 1) a_n space space (n in NN^+) $ Szemléltessük az $(s_n)$ részletösszeg-sorozat első néhány tagját! #v(20pt) #grid( columns: (auto, auto), gutter: 75pt, [ #cetz.canvas({ import cetz.draw: * set-style(mark: (end: "straight")) line((), (rel: (10, 0), update: true), name: "tengely") content( "tengely.end", [ #v(25pt) $RR$ ] ) circle( ("tengely.start",1,"tengely.end"), radius: .1, name: "s2", fill: black, ) content( "s2.center", (0,0), [$s_2$] ) circle( ("tengely.start",2.47,"tengely.end"), radius: .1, name: "s4", fill: black, ) content( "s4.center", (0,0), [$s_4$] ) circle( ("tengely.start",4,"tengely.end"), radius: .1, name: "s5", fill: black, ) content( "s5.center", (0,-1), padding: -.7, [$s_5$] ) circle( ("tengely.start",5.75,"tengely.end"), radius: .1, name: "s3", fill: black, ) content( "s3.center", (0,-1), padding: -.7, [$s_3$] ) circle( ("tengely.start",7.75,"tengely.end"), radius: .1, name: "s1", fill: black, ) content( "s1.center", (0,0), [$s_1 eq a_1$] ) arc( "s2.center", start: -180deg, stop: 0deg, radius: 2.38, name: "s2tos3" ) content( ( name: "s2tos3", anchor: 50%, ), [ #pad(top: 25pt)[ $a_3 (lt.eq a_2)$ ] ] ) arc( "s4.center", start: -180deg, stop: 0deg, radius: .78, name: "s4tos5" ) content( ( name: "s4tos5", anchor: 50%, ), [ #pad(top: 25pt)[ $a_5 (lt.eq a_4)$ ] ] ) arc( "s1.center", start: 0deg, stop: 180deg, radius: 3.38, name: "s1tos2" ) content( ( name: "s1tos2", anchor: 50%, ), [ #pad(top: -15pt)[ $a_2 (lt.eq a_1)$ ] ] ) arc( "s3.center", start: 0deg, stop: 180deg, radius: 1.65, name: "s3tos4" ) content( ( name: "s3tos4", anchor: 50%, ), [ #pad(top: -15pt)[ $a_4 (lt.eq a_3)$ ] ] ) }) ], [ #show math.equation: set align(left) $ s_1 eq a_1 \ s_2 eq a_1 - a_2 eq s_1 - a_2 \ s_3 eq a_1 - a_2 + a_3 eq s_2 + a_3 \ s_4 eq a_1 - a_2 + a_3 - a_4 eq s_3 - a_4 \ s_5 eq a_1 - a_2 + a_3 - a_4 + a_5 eq s_4 + a_5 \ $ ] ) Most megmutatjuk, hogy az ábra alapján sejthető tendencia valóban igaz, azaz, hogy az $(s_(2n))$ sorozat monoton növekvő, és az $(s_(2n+1))$ sorozat monoton csökkenő. #pagebreak() - A páros indexű részsorozatnál a következő csoportosításból látható, hogy $ s_(2n) eq overbrace(underbrace((a_1 − a_2), gt.eq 0) + underbrace((a_3 − a_4), gt.eq 0) + dots + underbrace((a_(2n−3) − a_(2n−2)), gt.eq 0), s_(2n-2)) + underbrace((a_(2n−1) − a_(2n)), gt.eq 0) $ minden $n in NN^+$ esetén, tehát $(s_(2n))$ valóban monoton növekvő. - Hasonlóan, a páratlan indexű részsorozatnál $ s_(2n+1) eq overbrace(a_1 + underbrace((-a_2 + a_3), lt.eq 0) + underbrace((-a_4 + a_5), lt.eq 0) + dots + underbrace((-a_(2n−2) + a_(2n−1)), lt.eq 0), s_(2n-1)) + underbrace((-a_(2n) + a_(2n+1)), lt.eq 0) $ minden $n in NN^+$ esetén, tehát $(s_(2n+1))$ monoton csökkenő sorozat. Másrészt, az $s_0 colon.eq 0$ értelmezés mellett $ s_(2n+1) − s_(2n) eq a_(2n+1) gt.eq 0 space space (n in NN) $ teljesül, amiből következik, hogy $s_(2n) lt.eq s_(2n+1)$ minden $n in NN$ esetén. Ekkor $ (1) space space space s_2 lt.eq s_4 lt.eq s_6 lt.eq dots lt.eq s_(2n) lt.eq s_(2n+1) lt.eq dots lt.eq s_5 lt.eq s_3 lt.eq s_1 $ Tehát $(s_(2n))$ és $(s_(2n+1))$ korlátos sorozatok. Mivel mindkettő monoton és korlátos, ezért konvergens is. Jelölje $A eq lim(s_(2n+1))$ és $B eq lim(s_(2n))$ a határértéküket. Ekkor $ A - B eq lim_(n arrow + infinity) s_(2n+1) - lim_(n arrow + infinity) s_(2n) eq lim_(n arrow + infinity) (s_(2n+1) - s_(2n) ) eq lim_(n arrow + infinity) a_(2n+1) eq lim_(n arrow + infinity) a_n eq 0, $ hiszen $(a_(2n+1))$ részsorozata az $(a_n)$ sorozatnak. Ezért $A eq B$, tehát az $(s_(2n))$ és az $(s_(2n+1))$ részsorozatok határértéke megegyezik. Ebből következik, hogy az $(s_n)$ sorozat konvergens. Ez pedig azt jelenti, hogy a Leibniz-típusú sor valóban konvergens. #pagebreak() == Sorok téglányszorzatának konvergenciája \ Tegyük fel, hogy a $sum_(n eq 0) a_n$ és a $sum_(n eq 0) b_n$ végtelen sorok konvergensek. Ekkor a $sum_(n eq 0) t_n$ téglányszorzatuk is konvergens és $ sum_(n eq 0)^(+infinity) t_n eq sum_(n eq 0)^(+infinity) a_n dot.op sum_(n eq 0)^(+infinity) b_n $ azaz konvergens sorok téglányszorzata is konvergens, és a téglányszorzat összege a két sor összegének szorzatával egyezik meg. === Bizonyítás \ A bizonyítás alapja a sorozatoknál tanult műveletek és határátmenet felcserélhetőségére vonatkozó tétel. Jelölje $A_n, B_n "és " T_n$ rendre a $sum_(n eq 0) a_n, sum_(n eq 0) b_n "és " sum_(n eq 0) t_n$ sorok n-edik részletösszegeit. Ekkor $ T_n eq sum_(k eq 0)^n t_k eq sum_(k eq 0)^n (sum_(max{i,j} eq k) a_i b_j) eq sum_(max{i,j} lt.eq n) a_i b_j eq (sum_(i eq 0)^n a_i) dot.op (sum_(j eq 0)^n b_j) eq $ $ eq A_n B_n arrow (sum_(n eq 0)^(+infinity) a_n) dot.op (sum_(n eq 0)^(+infinity) b_n), "ha " n arrow +infinity $ Ez azt jelenti, hogy a $(T_n)$ sorozat konvergens, és így a $sum t_n$ végtelen sor is konvergens, és $ sum_(n eq 0)^(+infinity) t_n eq lim(T_n) eq (sum_(n eq 0)^(+infinity) a_n) dot.op (sum_(n eq 0)^(+infinity) b_n) $ #pagebreak() == Hatványsorok konvergenciasugara Tetszőleges $sum_(n eq 0) alpha_n (x-a)^n$ hatványsor konvergenciahalmazára a következő három eset egyike áll fenn: 1. $exists 0 lt R lt +infinity$, hogy a haványsor $forall x in RR : abs(x-a) lt R$ pontban abszolút konvegens és $forall x in RR : abs(x-a) gt R$ pontban divergens. 2. A hatványsor csak az $x eq a$ pontban konvergens. Ekkor legyen $R := 0$ 3. A hatványsor abszolút konvergens $forall x in RR$ esetében. Ekkor legyen $R := +infinity$. R-et a hatványsor konvergenciasugarának nevezzük. === Bizonyítás Az állítás elég $a eq 0$ esetén igazolni. ==== Segédtétel Tegyük fel, hogy a $sum alpha_n x^n$ hatványsor konvergens egy $x_0 eq.not 0$ pontban. Ekkor $forall x in RR : abs(x) lt abs(x_0)$ esetén a hatványsor abszolút konvegens az x pontban. ==== Segédtétel bizonyítása Mivel a $sum alpha_n x_0^n$ végtelen sor konvergens, ezért $lim(a_n x_0^n) eq 0$, így az $(a_n x_0^n)$ sorozat korlátos, azaz $ exists M gt 0 : abs(alpha_n x_0^n) lt.eq M lt +infinity space (n in NN) $ Legyen $x in RR$ olyen, amire $abs(x) lt abs(x_0)$ teljesül. Ekkor $ abs(alpha_n x^n) eq abs(alpha_n x_0^n) dot.op abs(x/x_0)^n lt.eq M dot.op abs(x/x_0)^n =: M q^n space (n in NN) $ A $sum abs(alpha_n x^n) $ végtelen sor tehát majorálható a $sum(M q^n)$ mértani sorral, ami konvergens, mert $abs(q) eq abs(x/x_0) lt 1$. Így a majoráns kritérium szerint a $sum abs(alpha_n x^n)$ sor is konvergens, tehát a $sum(alpha_n x^n)$ végtelen sor is konvergens. ==== Tétel bizonyítása Tekintsük a $sum alpha_n x^n$ hatványsort. Ez $x eq 0$-ban nyilván konvergens, ezért $K H(sum alpha_n x^n) eq.not emptyset$, és így $ exists sup K H (sum_(n eq 0) alpha_n x^n) =: R in macron(RR) "és " R gt.eq 0 $ A következő három eset lehetséges 1. $0 lt R lt +infinity$. Legyen $abs(x) lt R$ tetszőleges. Ekkor a szuprémum definíciója szerint $exists x_0 gt 0 : abs(x) lt x_0 lt R$ és $x_0$ a konvergenciahalmaz eleme, azaz $sum alpha_n x_0^n$ konvergens. Ekkor a segédtétel szerint $sum alpha_n x^n$ abszolút konvergens. Ha $abs(x) gt R$ tetszőleges, akkor az R szám definíciója és a segédtétel szerint a $sum alpha_n x^n$ sor divergens. 2. $R eq 0$. A $sum alpha_n x^n$ hatványsor az $x eq 0$ pontban nyilván konvergens. Tegyük fel, hogy $x eq.not 0$ olyan pont ahol $sum alpha_n x^n$ konvergens. Ekkor a segédtétel szerint a hatványsor konvergens az $abs(x)/2 gt 0$ pontban, ami nem lehetségesm mert $R = 0$. A hatványsor tehát csak az $x eq 0$ pontban konvergens. 3. $R eq +infinity$. Legyen $x in RR$ tetszőleges. Ekkor a szuprémum definíciója értelmében $exists x_0 gt 0 : abs(x) lt x_0$ és $x_0$ a konvergenciahalmaz eleme, azaz $sum alpha_n x_0^n$ konvergens. Ekkor a segédtétel szerint $sum alpha_n x^n$ abszolút konvergens. #pagebreak() == A Cauchy-Hadamard-tétel \ Tekintsük a $sum_(n eq 0) alpha_n (x-a)^n$ hatványsort, és tegyük fel, hogy $ exists lim(root(n, abs(alpha_n))) =: A in macron(RR) $ Ekkor a hatványsor konvergenciasugara $ R = 1/A space (1 / (+infinity) := 0, 1/0 := +infinity) $ === Bizonyítás \ Nyilvánvaló, hogy $A gt.eq 0$. Rögzítsük tetszőlegesen az $x in RR$ számot, és alkamazzuk a Cauchy-féle gyökkritériumot a $ sum alpha_n (x-a)^n$ végtelen számsorra: $ lim_(n arrow +infinity) root(n, abs(alpha_n (x-a)^n)) eq (lim_(n arrow +infinity) root(n, abs(alpha_n))) dot.op abs(x-a) eq A abs(x-a), "és így" $ $ A abs(x-a) lt 1 arrow.long.double "a sor konvergens", space A abs(x-a) gt 1 arrow.long.double "a sor divergens." $ 1. Ha $0 lt a lt +infinity$, akkor A-val lehet osztani, és akkor $ x in ( a - 1/A, a+ 1/A) arrow.double.long " a sor konv.," x in.not [a - 1/A, a+ 1/A] arrow.long.double "a sor div." $ amiből következik, hogy $R eq 1/A$ 2. Ha $ A eq +infinity$, akkor $forall x in RR, x != a: A abs(x-a) eq (+infinity) dot.op abs(x-a) eq +infinity gt 1$\ Ezért a hatványsor az $x eq a$ pont kivételével divergens, azaz $R eq 0$ 3. Ha $A eq 0$, akkor $forall x in RR: A abs(x-a) eq 0 dot.op abs(x-a) eq eq 0 lt 1$\ Ezért a hatványsor minden $x in RR$ pontban konvergens, azaz $R eq +infinity$ #pagebreak() == Függvények határértékének egyértelműsége \ Ha az $f in RR arrow.long RR$ függvénynek az $a in D^'_f$ pontban van határértéke, akkor a definícióban szereplő $A in macron(RR)$ egyértelműen létezik. === Bizonyítás \ Tegyük fel, hogy két különböző $A_1, A_2 in macron(RR)$ elem eleget tesz a definíció feltételeinek. Mivel két különböző $macron(RR)$-beli elem diszjunkt környezetekkel szétválasztható ezért $ exists epsilon gt 0 : K_epsilon (A_1) sect K_epsilon (A_2) eq emptyset $ A határérték definíciója szerint egy ilyen $epsilon$-hoz $ exists delta_1 gt 0, forall x in K_delta_1 (a) sect D_f : f(x) in K_epsilon (A_1) $ $ exists delta_2 gt 0, forall x in K_delta_2 (a) sect D_f : f(x) in K_epsilon (A_2) $ Legyen $delta := min{delta_1, delta_2}$. Ekkor $ forall x in K_delta (a) sect D_f : f(x) in K_epsilon (A_1) sect K_epsilon (A_2) eq emptyset, "de " K_delta (a) sect D_f != emptyset, "mert " a in D^'_f. $ Ellentmondásra jutottunk, és ezzel a határérték egyértelműségét igazoltuk. #pagebreak() == A határértékre vonatkozó átviteli elv \ Legyen $f in RR arrow RR, a in D^'_f "és " A in macron(RR)$. Ekkor $ lim_a f eq A arrow.l.r.double.long forall(x_n) : NN arrow D_f \\ {a}, lim_(n arrow +infinity) x_n eq a "esetében " lim_(n arrow +infinity) f(x_n) eq A $ === Bizonyítás $arrow.double.r space space lim_a f eq A arrow.double.long forall epsilon gt 0"-hoz" exists delta gt 0, forall x in K_delta (a) sect D_f : f(x) in K_epsilon (A).$ Legyen $(x_n)$ egy, a tételben szereplő sorozat, és $epsilon gt 0$ egy tetszőleges rögzített érték. $ lim x_n eq a arrow.long.double delta"-hoz" exists n_0 in NN, forall n gt n_0 : x_n in K_delta (a) $ Mivel $x_n in D_f \\ {a}$, így $x_n in K_delta (a) sect D_f$, amiből $f(x_n) in K_epsilon (A)$ teljesül minden $n gt n_0$ indexre. Ez azt jelenti, hogy az $(f(x_n))$ sorozatnak van határértéke, és $lim_(n arrow +infinity) f(x_n) eq A$ $arrow.l.double$ Tegyük fel, hogy $ forall(x_n) : NN arrow D_f \\ {a}, lim_(n arrow +infinity) x_n eq a "esetén " lim_(n arrow +infinity) f(x_n) eq A. $ Megmutatjuk, hogy $lim_a f = A$ Indirekt módon tegyük fel, hogy a $lim_a f = A$ egyenlőség nem igaz. Ez pontosan azt jelenti, hogy $ exists epsilon gt 0, forall delta gt 0"-hoz" exists x_delta in K_delta (a) sect D_f : f(x_delta) in.not K_epsilon (A) $ A $delta eq 1/n (n in NN^+)$ választással ez azt jelenti, hogy $ exists epsilon gt 0, forall n in NN^+"-hoz" exists x_n in K_(1/n) (a) sect D_f : f(x_n) in.not K_epsilon (A) $ Legyen $x_0 in D_f \\ {a}$ tetszőleges. Az $(x_n) : NN arrow D_f \\ {a}$ sorozat nyilván a-hoz tart (hiszen $x_n in K_(1/n) (a)$), de a függvényértékek $(f(x_n))$ sorozata nem tart A-hoz (hiszen $f(x_n) in.not K_epsilon (A)$), ami ellentmond a feltételünknek. #pagebreak() == Monoton függvények hatértékei \ Legyen $(alpha, beta) subset RR$ tetszőleges (korlátos vagy nem korlátos) nyílt intervallum. Ha az f függvény monoton $(alpha, beta)$-n, akkor f-nek $forall a in (alpha, beta)$ pontban létezik a jobb oldali, illetve a bal oldali határértéke, és ezek végesek. \ 1. Ha f $arrow.tr (alpha,beta)$-n, akkor $ lim_(a+0) f eq inf{f(x) | x in (alpha, beta), x gt a} $ $ lim_(a-0) f eq sup{f(x) | x in (alpha, beta), x lt a} $ 2, Ha f $arrow.br (alpha, beta)$-n, akkor $ lim_(a+0) f = sup{f(x) | x in (alpha, beta), x gt a} $ $ lim_(a-0) f = inf{f(x) | x in (alpha,beta), x lt a} $ === Bizonyítás Tegyük fel, hogy $f arrow.tr (alpha,beta)-n$. A jobb oldali határértékre vonatkozó állítást igazoljuk. Legyen $ m := inf{f(x) | x in (alpha,beta), x gt a} $ Világos, hogy $m in RR$. Az infimum definíciójából következik, hogy 1. $forall x in (alpha, beta), x gt a : m lt.eq f(x)$ 2. $forall epsilon gt 0"-hoz" exists x_1 in (alpha,beta), x_1 gt a : f(x_1) lt m + epsilon$ Így $m lt.eq f(x_1) lt.eq m + epsilon$. Mivel $f arrow.tr (alpha,beta)$-n, ezért $ m lt.eq f(x) lt.eq f(x_1) lt m + epsilon space (x in (a, x_1)) $ A $delta := x_1 - a gt 0$ választással tehát azt mutattuk meg, hogy $ forall epsilon gt 0"-hoz" exists delta gt 0, forall x in (alpha,beta), a lt x lt a + delta : 0 lt.eq f(x) - m lt epsilon eq f(x) in K_epsilon (m) $ Ez pedig azt jelenti, hogy f-nek a-ban van jobb oldali határértéke, és az m-mel egyenlő, azaz $ lim_(a+0) f eq m eq inf{f(x) | x in (alpha,beta), x gt a}. $ A tétel többi állítása hasonlóan bizonyítható. #pagebreak() == Az összetett függvény folytonossága \ Tegyük fel, hogy $f,g in RR arrow.long RR, g in C{a} "és " f in C{g(a)}.$ Ekkor $f space circle.small space g in C{a}$, azaz az összetett föggvény örökli a belső- és a külső függvény folytonosságát. === Bizonyítás \ A feltételek szerint $g(a) in D_f$, ezért $g(a) in R_g sect D_f$, azaz $R_g sect D_f != emptyset$. Így valóban beszélgetünk az $f circle.small space g$ összetett függvényről, és $a in D_(f circle.small g)$ is igaz. \ Legyen $(x_n) : NN arrow D_(f circle.small g) subset D_g$ egy olyan sorozat, amelyre $lim(x_n) eq a$. Mivel\ $g in C{a}$, így a folytonosságra vonatkozó átviteli elv szerint $lim(g(x_n)) eq g(a)$. Jelölje $ b := g(a) "és " y_n := g(x_n) space (n in NN) $ Ekkor $(y_n) : NN arrow D_f$ és $lim(y_n) eq b$. Mivel $f in C{b}$, így a folytonosságra vonatkozó átviteli elv szerint $lim(f(y_n)) eq f(b)$. Ugyanakkor $ f(b) eq f(g(a)) eq (f circle.small g)(a) "és " f(y_n) eq f(g(x_n)) eq (f circle.small g)(x_n) space (n in NN) $ Azt igazoltuk tehát, hogy $forall (x_n) : NN arrow D_(f circle.small g), lim(x_n) eq a$ sorozat esetén igaz, hogy $ lim_(n arrow +infinity) (f circle.small g)(x_n) eq lim_(x arrow +infinity) (f(y_n)) eq f(b) eq (f circle.small g)(a) $ Ezért a folytonosságra vonatkozó átviteli elv szerint $f circle.small g in C{a}$ #pagebreak() #show heading.where(level: 2): it => it.body #show heading.where(level: 2): it => block( fill: colorQ, inset: 10pt, radius: 4pt, )[#it] == Korlátos és zárt intervallumon értelmezett folytonos függvény korlátossága. Ha $f in C[a,b]$, akkor $f$ korlátos az $[a,b]$ intervallumon === Bizonyítás Az $f$ függvény korlátos $[a,b]$-n, ha $ exists K gt 0, forall x in [a,b] : abs(f(x)) lt.eq K $ Az állítást indirekt módon bizonyítjuk: tegyük fel, hogy $f$ nem korlátos $[a,b]$-n, azaz $ forall K gt 0"-hoz" exists x in [a,b]:abs(f(x)) gt K $ Ekkor a $K eq n in NN$ választással azt kapjuk, hogy $ (\*) space forall n in NN"-hez" exists x_n in [a,b]:abs(f(x_n)) gt n $ Az $(f(x_n))$ sorozat tehát nem korlátos Mivel $x_n in [a,b]$ korlátos sorozat, ezért a Bolzano-Weierstrass kiválasztási tétel szerint létezik ennek egy $(x_n_k)$ konvergens részsorozata. Legyen $alpha eq lim(x_n_k)$. Ekkor $alpha in [a,b]$. Ugyanakkor $f in C{a}$. Így a folytonosságra vonatkozó átviteli elv szerint létezik a $ lim(f(x_n_k)) eq f(alpha) $ véges határérték. Ebből következik az, hogy az $(f(x_n_k))$ sorozat korlátos, ami ellentmond (\*)-nak. Ezzel a tétel állítását bebizonyítottuk. #pagebreak() == Weierstrass tétele. Egy korlátos és zárt intervallumon értelmezett folytonos függvénynek mindig van abszolút maximum- és abszolút minimumhelye, azaz $ f in C[a,b] arrow.long.double exists alpha,beta in [a,b], forall x in [a,b] : f(beta) lt.eq f(x) lt.eq f(alpha) $ === Bizonyítás Már igazoltuk, hogy ha $f$ folytonos $[a,b]$-n, akkor $f$ korlátos $[a,b]$-n. Ezért $ m eq inf{f(x) | x in [a,b]} in RR space "és " space M eq sup{f(x) | x in [a,b]} in RR $ Igazoljuk, hogy az $f$ függvénynek van abszolút maximumhelye, azaz \ $exists alpha in [a,b]:f(alpha) eq M$ A szuprémum definíciójából következik, hogy $ forall n in NN^+"-hez" exists y_n in R_f : M - 1/n lt y_n lt.eq M $ Viszont: $ y_n in R_f (n in NN^+) arrow.long.double forall n in NN^+"-hez" exists x_n in [a,b]:f(x_n) eq y_n $ Az így értelmezett $(x_n):NN^+ arrow [a,b]$ sorozat korlátos, ezért a Bolzano-Weierstrass-féle kiválasztási tétel miatt a sorozatnak van $(x_n_k)$ konvergens részsorozata. Jelölje $alpha eq lim(x_n_k)$. Ekkor $alpha in [a,b]$. Ugyanakkor $f in C{alpha}$. Így a folytonosságra vonatkozó átviteli elv szerint $ lim_(k arrow +infinity) f(x_n_k) eq f(alpha) $ Mivel minden $n_k$-ra $ M - 1/n_k lt f(x_n_k) eq y_n_k lt.eq M $ teljesül, ezért $limits(lim)_(k arrow + infinity) y_n_k eq M$, így $f(alpha) eq M$. Megmutattuk tehát azt, hogy $alpha$ az $f$ függvénynek egy maximumhelye. Hasonlóan bizonyítható az abszolút minimum létezése. #pagebreak() == A Bolzano-tétel Ha egy korlátos és zárt intervallumon értelmezett folytonos függvény az intervallum két végpontjában különböző előjelű, akkor a függvénynek legalább egy zérushelye van, azaz $ f in C[a,b] "és " f(a) dot.op f(b) < 0 arrow.long.double exists xi in (a,b) : f(xi) eq 0 $ === Bizonyítás Az állítás bizonyításának az alapja az ún. _#strong("Bolzano-féle felezési eljárás.")_\ Tegyük fel, hogy $ f(a) lt 0 lt f(b) $ #grid( columns: (auto,auto), gutter: 5pt, align: horizon, box()[ Legyen $ [x_0,y_0] eq [a,b] $ Az intervallumot megfelezzük. Legyen $z_0 eq (x_0 + y_0)/2$ Három eset lehetséges: 1. $f(z_0) eq 0$, ekkor $xi eq z_0$ zérushelye $f$-nek 2. $f(z_0) gt 0$ esetén legyen $[x_1,y_1] eq [x_0,z_0]$ 3. $f(z_0) lt 0$ esetén legyen $[x_1,y_1] eq [z_0, y_0]$ ], image("bolzano.png") ) Ha $f(z_0) eq.not 0$, akkor olyan $[x_1,y_1]$ intervallumot sikerült megadni, amire $ f(x_1) lt 0 lt f(y_1) $ teljesül, ezért átveheti az $[x_0,y_0]$ intervallum szerepét, de a hossza ennek fele, azaz $(b-a)/2$ Az $[x_1,y_1]$ intervallumot megfelezve is ugyanaz a három eset lehetséges. Ha a $z_1$ felezőpontban $f(z_1) eq.not 0$ akkor az intervallumból azt a felét tartjuk meg, amelynek két végpontjában $f$ különböző előjelű. Ez lesz az $[x_2,y_2]$ intervallum, amivel az eljárás megismételhető. Folytassuk az eljárást! Ekkor vagy véges sok lépésben találunk olyan $xi$-t amelyre $f(xi) eq 0$, vagy nem. Az utóbbi esetben olyan $[x_n, y_n]$ intervallumsorozatot kapunk, amire minden $n in NN$ esetén 1. $[x_(n+1), y_(n+1)] subset [x_n,y_n]$, 2. $f(x_n) lt 0 "és " f(y_n) gt 0$, 3. $y_n - x_n eq (b-a)/2^n arrow.long_(n arrow +infinity) 0$ A valós számok Cantor-tulajdonsága szerint az 1) tulajdonságból következik, hogy a fenti egymásba skatulyázott intervallumsorozat metszete nem üres. A 3) tulajdonságból következik, hogy ez a metszet egyelemű halmaz, hiszen minden eleme $x_n$ és $y_n$ között található. Jelölje $xi$ a metszet egyedüli elemét, azaz $ sect.big_(n in NN) [x_n,y_n] eq {xi} $ A konstrukcióból következik, hogy $ lim_(n arrow +infinity) x_n eq xi eq lim_(n arrow +infinity) y_n $ Mivel $f$ folytonos $xi$-ben, ezért az átvételi elv szerint $ lim_(n arrow +infinity) f(x_n) eq f(xi) eq lim_(n arrow +infinity) f(y_n) $ De a 2) tulajdonságból következik, hogy $ lim_(n arrow +infinity) f(x_n) lt.eq 0 lt.eq lim_(n arrow +infinity) f(y_n) $ azaz $f(xi) lt.eq 0$ és $f(xi) gt.eq 0$, ami csak úgy teljesülhet, ha $f(xi) eq 0$. A bizonyítás hasonló, ha $f(a) gt 0$ és $f(b) lt 0$. #pagebreak() == Az $e$ szám irracionalitása. Az $e$ szám irracionális. === Bizonyítás Azt már tudjuk, hogy $ e eq sum_(n eq 0)^(+infinity) 1/n! eq 1+1/1!+1/2!+1/3!+... $ Az állítással ellentétben tegyük fel, hogy $e$ racionális, azaz $ e eq p/q, " ahol " p,q in NN^+ " és " q gt.eq 2 $ (a $q gt.eq 2$ feltehető, egyébként bővítjük a törtet). Az $ s_n := 1 + 1/1! + 1/2! + 1/3! + ... + 1/n! space (n in NN^+) $ sorozat szigorúan monoton növekvő módon tart $e$-hez, ha $n arrow.long +infinity$. Legyen $n gt q$ tetszőleges egész. Ekkor $ 0 lt q! dot.op (s_n - s_q) eq q! dot.op (1/(q+1)! + 1/(q+2)! + ... + 1/n!) eq $ $ eq 1/(q+1) + 1/((q+1)(q+2)) + ... + 1/((q+1)dot.op ... dot.op n) lt.eq $ $ lt.eq 1/(q+1) dot.op (1 + 1/(q+1) + 1/(q+1)^2 + ... + 1/(q+1)^(n-q-1)) lt.eq $ $ lt.eq 1/(q+1) dot.op 1/(1- 1/(q+1)) eq 1/q lt.eq 1/2 $ Ebből az $n arrow.long +infinity$ határátmenetet véve azt kapjuk, hogy $ (\#) space space 0 lt q! dot.op (e - s_q) lt.eq 1/2 $ hiszen $q! dot.op (e - s_q) eq.not 0$, mert $s_q lt e$ Az indirekt feltételből az következik, hogy $ q! dot.op (e -s_q) eq q! dot.op (p/q - s_q) eq q! dot.op (p/q -1 -1/1! -1/2! - ... - 1/q!) $ egész szám. Ez viszont (\#) alapján nem lehetséges. #pagebreak() == A $pi$ szám értelmezésére vonatkozó tétel A $cos$ függvénynek a $[0,2]$ intervallumban pontosan egy zérushelye van, azaz $[0,2]$-nek pontosan egy $xi$ pontjában áll fenn a $cos xi eq 0$ egyenlőség. Ennek a $xi$ számnak a kétszereseként *értelmezzük a $pi$ számot:* $ pi := 2 xi $ === Bizonyítás A Bolzano-tételt alkamazzuk. Világos, hogy $cos in C[0,2]$ és $cos 0 eq 1$. Másrészt $ cos 2 eq 1 - 2^2/2! + 2^4/4! - 2^6/6! + 2^8/8! - 2^10/10! + 2^12/12! - ... eq $ $ eq underbrace(1- 2 + 2/3, eq "-1/3") - 2^6/6! dot.op underbrace((1 - 2^2/(7 dot.op 8)), gt 0) - 2^10/10! dot.op underbrace((1-2^2/(11 dot.op 12)), gt 0) - ... lt -1/3 lt 0 $ A Bolzano-tétel feltételei tehát teljesülnek, ezért $exists xi in (0,2): cos xi eq 0$. A $xi$ pont egyértelműsége következik abból, hogy a $cos arrow.b$ a $[0,2]$ intervallumban, azaz $ (\*) "ha " 0 lt.eq x lt y lt.eq 2 ", akkor " cos x gt cos y $ Ezt fogjuk most igazolni. Az eddigiekből következik, hogy $ cos x gt cos y arrow.long.l.r.double cos x - cos y eq -2 dot.op sin (x+y)/2 dot.op sin (x-y)/2 eq $ $ eq 2 dot.op sin (x+y)/2 dot.op sin (y-x)/2 gt 0 $ Mivel $ 0 lt.eq x lt y lt.eq 2 arrow.long.double 0 lt (x+y)/2 lt 2 "és " 0 lt (y-x)/2 lt 2, $ ezért a (\*) állítás a $ sin z eq z - z^3/3! + z^5/5! - z^7/7! + ... eq z dot.op underbrace((1- z^2/(2 dot.op 3)), gt 0) + z^5/5! dot.op underbrace((1 - z^2/(6 dot.op 7)), gt 0) + ... gt 0 (z in (0,2)) $ egyenlőtlenség következménye.
https://github.com/haryu703/ccstudy-91
https://raw.githubusercontent.com/haryu703/ccstudy-91/main/main.typ
typst
#import "@preview/polylux:0.3.1": * #import themes.simple: * #show: simple-theme.with( aspect-ratio: "16-9" ) #show link: underline #title-slide[ = Bitcoin Cash Upgrade 2024-05-15 ] #slide[ == 自己紹介 - #link("https://twitter.com/haryu703")[haryu703] - コインチェック株式会社 (2020〜) ] #slide[ == 今回のアップグレードの概要 今回は下記の1件のプロトコルアップデートが行われた - #link("https://gitlab.com/0353F40E/ebaa/-/blob/9606b73b10551e4ef56e238c7a7bedc4f95236dd/README.md")[CHIP-2023-04 Adaptive Blocksize Limit Algorithm for Bitcoin Cash] - ブロックサイズの上限を需要に応じて自動で増減させる ] #slide[ == ブロックサイズ上限の歴史 - 2010年-2017年: 1MB - 2017年-2018年: 8MB - 2018年-2024年: 32MB - 2024年-: 32MB - ] #slide[ == 背景 - ブロックサイズの上限はネットワークを健全に維持するために必要 - 需要や技術の進歩に合わせて上限を変更する必要はある - ブロックサイズを上げるには関係者の合意を取るなどのコストがかかる ] #slide[ == 目的 - 今後のブロックサイズに関する合意コストをなくす - 需要に応じたブロックサイズの上限を自動で設定する ] #set text(size: 20pt) #slide[ == 方法 「control function」と「elastic buffer function」という2つの要素で制御される $ y_n &= epsilon_n + beta_n \ epsilon_n &= cases( epsilon_0 && "if" n <= n_0, epsilon_(n-1) + gamma dot (zeta dot x_(n-1) - epsilon_(n-1) - zeta dot beta_(n-1) dot (zeta dot x_(n-1) - epsilon_(n-1)) / (zeta dot y_(n-1) - epsilon_(n-1))) && "if" n > n_0 "and" zeta dot x_(n-1) > epsilon_(n-1), max(epsilon_(n-1) + gamma dot (zeta dot x_(n-1) - epsilon_(n-1)), epsilon_0) && "if" n > n_0 "and" zeta dot x_(n-1) <= epsilon_(n-1) ) \ beta_n &= cases( beta_0 && "if" n <= n_0, max(beta_(n-1) - theta dot beta_(n-1) + delta dot (epsilon_n - epsilon_(n-1)), beta_0) && "if" n > n_0 "and" zeta dot x_(n-1) > epsilon_(n-1), max(beta_(n-1) - theta dot beta_(n-1), beta_0) && "if" n > n_0 "and" zeta dot x_(n-1) <= epsilon_(n-1) ) \ $ ] #slide[ - $y$: ブロックサイズの上限 - $n$: ブロック高 - $epsilon$: control function - $beta$: elastic buffer function - $n_0, epsilon_0, beta_0$: 初期値 - $x$: 実際に作られたブロックのサイズ - $gamma$: control function の 「forget factor」 - ブロックサイズの増減率を調整する - $zeta$: control function の「asymmetry factor」 - ブロックサイズの増加率と減少率の差を調整する - $theta$: elastic buffer の減少率 - control function 側の増加率が$theta$より低いと elastic buffer は減少する - $delta$: elastic buffer の「gearing ratio」 - elastic buffer と control function をどの程度連動させるかを調整する ] #slide[ === mainnet のパラメータ #set text(size: 19pt) - $epsilon_0 &= 16000000$ - $beta_0 &= 16000000$ - $n_0 &= "ハードフォーク時点のブロック高"$ - $zeta &= 1.5$ - $gamma &= 1 / 37938$ - $delta = 10$ - $theta = 1 / 37938$ \ - ブロックサイズ上限の初期値は $y_0 = epsilon_0 + beta_0 = 32000000$ でハードフォーク前と同じ - このアルゴリズムが有効化されている testnet は$epsilon_0$、$beta_0$および$n_0$が異なる - その他、一時的に$y_"temporary_max" = 2000000000 (2 "GB")$が設定されている - 32-bit アーキテクチャや p2p プロトコルの制約 - 2028年5月までに取り除かれるらしい ] #slide[ === パラメータの特徴 ==== control function - ブロックサイズ増加率の上限: $((epsilon_n - epsilon_(n-1)) / epsilon_(n-1))_max = gamma dot (zeta - 1) = 1 / 75876$ - 年間で最大 +200 % - ブロックサイズ減少率の上限: $((epsilon_n - epsilon_(n-1)) / epsilon_(n-1))_min = - gamma = -1 / 37938$ - 年間で最大 -75 % ==== elastic buffer function - $epsilon$ に対する $beta$ の上限: $(beta_n / epsilon_n)_max = delta dot gamma / theta dot (zeta -1) / (gamma / theta dot (zeta - 1) + 1) = 3.33$ - $beta$の減少率は$theta$で、年間で最大 -75 % - 半減するのは$log(0.5) / log(1 - theta) = 26296$ブロックで10分間に1ブロックなら約6ヶ月 - 急激なブロックサイズの上昇に対応できるような増加をするらしい ] #slide[ === パラメータの選び方 ==== Asymmetry factor ($zeta$) 「Asymmetry factor」は control function の増減率の関係を決める $zeta = 2$ だと増加率と減少率は同じになる - ハッシュレートを 50 % 持った攻撃者によるスパム TX でブロックサイズを増やす攻撃に対し、防御側が空ブロックを作ることが強制される - 防御側は fee を得られないため攻撃側に対して不利 \ $zeta = 1.5$だと上記の攻撃シナリオに耐性がつく - ハッシュレートが 50:50 の場合、防御側は上限の33%のブロックサイズまで作れる - 空ブロックでブロックサイズを小さくする攻撃はしやすくなる - こちらは防御側が fee を受け取れるため有利 ] #slide[ === Forget factor ($gamma$) 「Forget factor」は control function の増減率の関係を決める - 1年間(52959 ブロック)の最大増加率が +100 % になるように設定された - BIP-101 で提案されていた増加率よりは高いが、最大増加率を維持するのは現実的ではないため実際に BIP-101 のブロックサイズを超えることは考えにくい === Gearing ratio ($delta$) と Decay rate ($theta$) 「Gearing ratio」と「Decay rate」は elastic buffer の大きさと増減速度を決める - 大きさは最大で$beta$が$epsilon$の3.33倍になるように設定されている - 数ヶ月でブロックサイズが倍になっても大丈夫らしい - 減少速度は半年で半分になるように設定されている ] #slide[ == シナリオ 下記を繰り返す場合 #footnote[https://gitlab.com/0353F40E/ebaa/-/raw/9606b73b10551e4ef56e238c7a7bedc4f95236dd/simulations/results/abla-ewma-elastic-buffer-bounded-01-ne-scenario-13.png] - すべてのブロックがブロックサイズ上限で8ヶ月 - 33%のブロックがブロックサイズ上限、他のブロックが21MBで4ヶ月 #figure( image("abla-ewma-elastic-buffer-bounded-01-ne-scenario-13.png", width: 30%), ) ] #slide[ 90%のブロックがブロックサイズ上限の90%、残りが21MBが続く場合 #footnote[https://gitlab.com/0353F40E/ebaa/-/raw/9606b73b10551e4ef56e238c7a7bedc4f95236dd/simulations/results/abla-ewma-elastic-buffer-bounded-01-ne-scenario-14.png] #figure( image("abla-ewma-elastic-buffer-bounded-01-ne-scenario-14.png", width: 40%), ) ] #slide[ ハッシュレートの50%がスパム攻撃をする場合 #footnote[https://gitlab.com/0353F40E/ebaa/-/raw/9606b73b10551e4ef56e238c7a7bedc4f95236dd/simulations/results/abla-ewma-elastic-buffer-01-scenario-15.png] - 1-4年目: 50%のブロックがブロックサイズ上限、残りが10.67MB - 5-8年目: 50%のブロックがブロックサイズ上限、残りが21.33MB #figure( image("abla-ewma-elastic-buffer-01-scenario-15.png", width: 40%), ) ] #slide[ == まとめ - ブロックサイズの上限を自動で変更するアルゴリズムが導入された - 今後ブロックサイズの上限は需要に応じてハードフォーク無しに変更される ]
https://github.com/MDLC01/unichar
https://raw.githubusercontent.com/MDLC01/unichar/main/CHANGELOG.md
markdown
MIT License
# Changelog ## Version 0.3.0 - Add `math-class` attribute to codepoints. - Some codepoints have their math class overridden by Typst. This is the Unicode math class, not the one used by Typst. - The `id` of codepoints now returns a string without the `"U+"` prefix. ## Version 0.2.0 - Codepoints now have an `id` attribute which is its corresponding "U+xxxx" string. - The `block` attribute of a codepoint now contains a `name`, a `start`, and a `size`. - Fix an issue that made some codepoints cause a panic. - Include data from NameAlias.txt. ## Version 0.1.0 - Add the `codepoint` function.
https://github.com/piepert/philodidaktik-hro-phf-ifp
https://raw.githubusercontent.com/piepert/philodidaktik-hro-phf-ifp/main/src/parts/spue/anforderungen/philosophischer_unterricht.typ
typst
Other
#import "/src/template.typ": * == #ix("Philosophischer Unterricht", "Unterricht, philosophisch") Die Religionsphilosophie und das Fach "Religion" sind für einige Studierende schwer zu trennen. Was macht eine religionsphilosophische Unterrichtseinheit eigentlich _philosophsich_? In der Einheit "Gottesbegriffe"#en[Vgl. @MBWKMV2002_RP710[S. 25]] reicht es etwa nicht, verschiedene Gotteskonzeptionen zu erarbeiten -- dieser Inhalt zählt wohl eher in den Religions- oder Sachkundeunterricht. Wie läuft man nicht in der SPÜ gefahr, eine Sachkundestunde zu halten? Eine Stunde gehört dann zum Fach Philosophie, wenn sie sich an die gegebenen Spezifikationen des Rahmenplans hält, oder sich mit den Inhalten und Methoden der Philosophie generell beschäftigt. Die Rahmenpläne sagen dazu folgendes: - *Stufen 5-10*: "Der Unterricht im Fach Philosophieren mit Kindern strebt eine Einheit der Methodik philosophischen Denkens und der Methodik des Unterrichts an. In diesem Sinne bilden Lehrer und Schüler eine Untersuchungsgemeinschaft."#ens[@MBWKMV1996_RP56[S. 11]][@MBWKMV2002_RP710[S. 13.]] - *Stufe 11 und 12:* #(sym.quote.low.double)Zum einen kann sich das Unterrichtsfach an der Fachwissenschaft Philosophie, zum anderen an Verfahren innerhalb der Gesamttätigkeit Philosophieren -- Staunen, Wundern, Zweifeln, Infragestellen -- orientieren. [...] Der Kern der Philosophie besteht im Philosophieren, der Tätigkeit des philosophischen Denkens, der philosophischen Kritik und Reflexion. Demzufolge ist der Philosophieunterricht vom Zusammenspiel philosophischer Denkrichtungen -- Analytische Philosophie, Konstruktivismus, Phänomenologie, Dialektik, Hermeneutik, Dekonstruktion -- und fachspezifischen Medien -- Textlektüre, Unterrichtsgespräch, Schreiben eigener Texte -- und Methoden des Philosophierens -- Begriffsanalyse, Argumentieren, Gedankenexperiment, Metapher-Analyse, Theatrales Philosophieren, Philosophieren mit Bild, Musik, Literatur, Film und Spiel -- geprägt.#(sym.quote.l.double)#en[@MBWKMV2019_RP1112[S. 4]] *Der Philosophieunterricht bewegt sich nicht nur in Inhalten der Philosophie, sondern kann bereits aufgrund der Auswahl der Untersuchungsmethoden philosophisch werden.* Daher kann jedes beliebige Thema aus einer philosophischen Sichtweise betrachtet werden, solange es mit philosophischen Methoden bearbeitet werden kann und im Unterricht auch damit bearbeitet wird. Damit sind die Makromethoden des Philosophieunterrichts gemeint -- nach Martens die #ix("sokratisch-aristotelischen Kategorien", "Kategorien, sokratisch-aristotelisch") oder nach Rohbeck die #ix("Denkrichtungen", "Denkrichtung"), die hier ebenfalls genannt sind.
https://github.com/TheWebDev27/Calc-II-Honors-Project
https://raw.githubusercontent.com/TheWebDev27/Calc-II-Honors-Project/main/part3.typ
typst
#set text( font: "New Computer Modern", size: 10pt ) #set par( leading: .75em ) We now employ nonstandard analysis to prove the incredible fundamental theorem of calculus, which relates a function's area under its curve to its antiderivative. Before we can do this, however, we must first establish the following result: #set text(font: "Source Serif") #set align(center) #grid( columns: 80%, rows: auto, [ #set align(left) Consider a small change in input $delta x$ for some function $f(x)$ that is continuous on some interval. The corresponding small change in the output can be expressed like so: #set align(center) $f(x + delta x) - f(x) = f'(x) dot delta x + epsilon dot delta x$, #set align(left) where $f'(x)$ is the derivative of $f(x)$ and $epsilon approx 0$. ] ) #set text(font: "New Computer Modern") #set text(9pt) #figure( image("images/tangent line visual.png", width: 85%), caption: [Tangent line visualization] ) #set text(10pt) #set align(left) A few small things to note: #set align(center) #grid( columns: 90%, rows: auto, [ #set align(left) 1) $Delta$ is typically used represent a small difference between two quantities, while $delta$ is typically used to represent an infinitesimal value. The difference is merely semantical, as both represent the same core idea. 2) In Figure 9, $f'(x_0)$ does _not_ represent the actual equation of the tangent line but merely serves as a label showing that the tangent line has a slope of $f'(x_0)$. 3) In Figure 9, $epsilon$ is not intended to represent the vertical distance between the tangent line and $f(x_0)$. It's meaning will be clarified shortly. ] ) #set align(left) The result can quickly be shown by starting with the limit definition of the derivative at $(x_0, f(x_0))$, #set align(center) $display(f'(x_0) = lim _(Delta x arrow 0) (f(x_0 + Delta x) - f(x_0))/(Delta x))$. #set align(left) As a reminder, this says that the slope of the tangent line at $(x_0, f(x_0))$ is given by the limit of the slope of the *secant line* between $(x_0, f(x_0))$ and $(x_0 + Delta x, f(x_0 + Delta x))$ as $Delta x arrow 0$, where a secant line is simply a line that intersects a curve at least twice. We can see in Figure 9 how the slope of the tangent line slightly differs from the slope of the secant line. Although the secant line is omitted from the figure, this is certain to be the case, because if they were equal, then the gap marked by $epsilon$ would not exist #footnote[It is possible for this gap to not be present, but $f(x)$ would have to be linear. This would result in $epsilon$ being 0.]. Therefore, we can say that #set align(center) $display((f(x_0 + Delta x) - f(x_0))/(Delta x) &= f'(x_0) + epsilon) \ f(x + Delta x) - f(x) &= f'(x_0) dot Delta x + epsilon dot Delta x$, #set align(left) where $epsilon$ represents the small difference in _slope_ between the secant and tangent lines. It can also be thought of as the error inherent in the limit from the slope of the tangent line. As $Delta x arrow 0$, the slope of the secant line approaches that of the tangent line, so $epsilon arrow 0$ as well. From an infinitesimal perspective, both values are infinitesimal or approximately zero, and the overarching idea applies broadly to any $x$ where $f(x)$ is continuous, so (1) can be rewritten more generally as #set align(center) $#h(82pt) f(x + delta x) - f(x) &= f'(x) dot delta x + epsilon dot delta x$, #h(82pt) (3) #set align(left) where $epsilon$ and $delta x$ are both infinitesimal. (4) tells us that a nonlinear change -- the left side -- is equal to the sum of i) a linear change, $f'(x) dot delta x$, and ii) the product of the error and the change in $x$. The result has been shown. A brief review of Riemann sums is warranted as well. A *Riemann sum* is an approximation of the area under a curve via a division into small rectangles. Consider a function $f(x)$ continuous on the interval $[a,b]$. The rectangles are obtained by first partitioning the interval $[a,b]$ into $n$ subintervals, so each partition point $x_k$ is given by #set align(center) $display(x_k = a + (k(b-a))/n)$, #set align(left) where $k$ is an integer from 0 to $n$, and $display((b-a)/n)$ represents the length of each subinterval. The subintervals act as bases for the rectangles, and the rectangles' heights depend on $f(x)$. For the upcoming proof, we will be focused on the *left Riemann sum*, where the height of each rectangle is determined by the left endpoints of the subintervals. With this concept, the area is approximated by: #set align(center) $display(sum_(k=1)^n f[((k-1)(b-a))/n] dot Delta x)$, #set align(left) where $display(f[((k-1)(b-a))/n])$ is the height of the $k$th rectangle and $Delta x$ is the increment. A more thorough explanation of this summation is not necessary, as the proof that follows relies on a variation of it that will indeed be closely looked at. \ #set align(left) We are now ready to prove the fundamental theorem of calculus. #set text(font: "Source Serif") #set align(center) #grid( columns: 80%, rows: auto, [ #set align(left) *Theorem 5 - The Fundamental Theorem of Calculus* For a function $f(x)$ that is continuous over some closed interval [a,b], if another function $F(x)$ exists where #set align(center) $d F(x) = F'(x)d x = f(x)d x$ #set align(left) for all $x$ in [a,b], then #set align(center) $display(integral _a^b f(x)d x = F(b) - F(a))$. ] ) #set text(font: "New Computer Modern") #set align(left) If $F(x)$ is an *antiderivative* of $f(x)$, or $d/(d x)F(x) = f(x)$, over the interval $[a, b]$, then the integral of $f(x)$ on said interval is simply the difference between $F(x)$ evaluated at $x=b$ and $x=a$. #set align(center) #figure( image("images/riemann sum.png", width:60%), caption: [Riemann sum visualized] ) #set align(left) The integral is approximated by the left Riemann sum of $f(x)$ from $a$ to $b$ where the increment is an infinitesimal $delta x$: #set align(center) #h(65pt) $display(integral_a^b f(x)d x approx sum_(x=a \ #text[step] delta x)^(b-delta x) f(x) dot delta x)$, where $delta x approx 0$. #h(65pt) (3) #set align(left) The notation of the summation in (3) may perplex readers who are familiar with #set align(center) $display(sum_(k=1)^n) a_k$ #set align(left) where $k$ is the *index* and $a_k$ is the $k$th term in the sum. The same thing is happening in (3), but instead of the index incrementing by 1, it instead increments by $delta x$ -- hence the "step $delta x$". (3) can be conceptualized with the visual shown in Figure 10 but instead on a far smaller scale with the area divided up into an infinitely large number of rectangles. Notice how the sum only increments from $a$ to $b - delta x$, as $f(b - delta x)$ corresponds to the height of the final rectangle toward the right of Figure 10. Proceeding with the proof, since $F'(x) = f(x)$, (2) tells us that #set align(center) $F(x + delta x) - F(x) = f(x) dot delta x + epsilon dot delta x$. #set align(left) We can now sum both sides #set align(center) #h(37pt)$display(sum_(x=a \ #text[step ] delta x)^(b-delta x)[F(x + delta x) - F(x)] = sum_(x=a \ #text[step ] delta x)^(b-delta x)f(x) dot delta x + sum_(x=a \ #text[step ] delta x)^(b-delta x) epsilon dot delta x)$, #h(37pt) (4) #set align(left) and this produces a telescoping sum on the left. This is because #set align(center) $display(sum_(x=a \ #text[step ] delta x)^(b-delta x)[F(x + delta x) - F(x)])$ #v(4pt) $= [F(a + delta x) - F(a)] - [F(a+2 delta x) - F(a + delta x)] - [F(a + 3 delta x) - F(a + 2 delta x)] - dots.h.c - [F(b - delta x + delta x) - F(b - delta x)] \ = F(b') - F(a),$ #set align(left) where $b'$ is a number that is close to $b$ but not exactly equal. The reason for this is that the $delta x$'s in the quantity $F(b-delta x + delta x)$ are not necessarily the same. The rationale is subtle, but it essentially boils down to the fact that adding a long sequence of infinitesimals to $a$ will not land us exactly on $b$ but on a value very close to it. In particular, the value $b - delta x$ _conceptualizes_ the idea of a number infinitely close to $b$ but does not represent a definite value where $delta x$ cancels out to zero. It's best to think of the quantity $F(b-delta x + delta x)$ as one that lies infinitely close to $F(b)$. From here, we can now say that #set align(center) $display(integral_a^b f(x)d x approx sum_(x=a \ #text[step] delta x)^(b-delta x)f(x)d x = F(b')-F(a)-sum_(x=a \ #text[step] delta x)^(b-delta x) epsilon dot delta x)$ #set align(left) which is obtained by replacing the summation on the left of (4) with $F(b') - F(a)$ and subtracting #v(0pt)$display(sum_(x=a \ #text[step] delta x)^(b-delta x) epsilon dot delta x)$ from both sides. Subtracting again gives #set align(center) $display(sum_(x=a \ #text[step] delta x)^(b-delta x)f(x)d x - [F(b') - F(a)] = -sum_(x=a \ #text[step ] delta x)^(b-delta x) epsilon dot delta x)$, #set align(left) and taking the absolute value of both sides results in the inequalities #set align(center) $display(abs(sum_(x=a \ #text[step] delta x)^(b-delta x)f(x)d x - [F(b') - F(a)]) <= abs(sum_(x=a \ #text[step ] delta x)^(b-delta x) epsilon dot delta x) <= sum_(x=a \ #text[step ] delta x)^(b-delta x) abs(epsilon) dot delta x)$. #set align(left) The first inequality is just a way of saying that if two quantities are equal, then it is technically true that the absolute value of the first quantity cannot be larger than that of the second. It is an important inequality in the proof, as the quantity on the left represents the distance between the approximated integral and the difference of the antiderivative evaluated at (almost) $b$ and $a$, so we want to show that it goes infinitely close to 0. Now why does the second inequality hold? Recall that the triangle inequality states that $abs(a+b) <= abs(a) + abs(b)$ for any numbers $a$ and $b$. In this case, the second inequality is merely an extended triangle inequality. The reader is encouraged to reconsider the analogy utilized back when the triangle inequality was first introduced, extend the logic to this case, and convince themselves of this fact. If $max(abs(epsilon))$ is the largest term in the summation $display(sum_(x=a \ #text[step ] delta x)^(b-delta x) abs(epsilon) dot delta x)$, then #set align(center) #v(2pt) $display(sum_(x=a \ #text[step ] delta x)^(b-delta x) abs(epsilon) dot delta x <= max(abs(epsilon)) dot sum_(x=a \ #text[step ] delta x)^(b-delta x) delta x = max(abs(epsilon)) dot (b' - a) approx 0).$ #set align(left) The first inequality can be understood by thinking of the sum #set align(center) $1 dot 2 + 2 dot 2 + 3 dot 2 + dots.h.c + 10 dot 2$, #set align(left) where each term is given by $a dot 2$ and $a$ is a whole number from 1 through 10. If we now take the maximum value of $a$, 10, and replace every $a$ in the sum with 10, then the sum clearly grows larger. The equality following the inequality replaces $display(sum_(x=a \ #text[step ] delta x)^(b-delta x) delta x)$ with $(b' - a)$. Remember that these calculations #v(0pt) all stem from applying (2) to the fact that $d/(d x) F(x) = f(x)$, so $epsilon approx 0$, which means #set align(center) $display(max(abs(epsilon)) dot (b' - a) approx 0),$ #set align(left) and #set align(center) $display(integral_a^b f(x)d x approx sum_(x=a \ #text[step ] delta x)^(b-delta x) f(x) delta x approx F(b') - F(a))$. #set align(left) Lastly, since $F(x)$ is continuous, $F(b') approx F(b)$ (remember that $b'$ is off from $b$ by merely an infinitesimal amount), we reach the conclusion that #set align(center) $display(integral_a^b f(x)d x = F(b) - F(a)).$ #set align(left) A few minutiae are left out for the sake of brevity, and the proof as a whole is far from airtight, but it succeeds in giving us a solid insight as to how the fundamental theorem of calculus can be argued from the angle of nonstandard analysis. #pagebreak() #text(14pt)[ Reflection ] The advent of nonstandard analysis lead to proofs of various results that were unable to be practically proven with real analysis (proving them with real analysis was not impossible, though it would have been exceedingly difficult). What this entails back then was that the ease of notation with nonstandard analysis helped mathematicians see things that were more hidden from a real analysis perspective. It has been shown, however, that a result proven using one system can readily be proven with the other, and as of today the applications of nonstandard analysis seem to steer toward an area of mathematics that is not particularly connected with other areas; nonstandard analysis as a whole has managed to produce its own set of unique questions and problems. In general, real analysis (and more broadly standard analysis) and nonstandard analysis by no means replace each other, but rather serve as two distinct approaches toward analysis, and a preference toward either approach ultimately comes down to what one is first exposed to in their mathematical endeavors. #pagebreak()
https://github.com/topdeoo/Course-Slides
https://raw.githubusercontent.com/topdeoo/Course-Slides/master/Seminar/template/main.typ
typst
#import "../../theme/iTalk.typ": * #import "@preview/algo:0.3.3": algo, i, d, comment, code // TODO fill all "TODO" with your information #show: nenu-theme.with( short-title: "TODO", short-date: "TODO", short-author: "Virgil" ) #let argmax = math.op("arg max", limits: true) #let argmin = math.op("arg min", limits: true) #title-slide( title: "TODO", authors: ( name: "凌典", email: "<EMAIL>" ), logo: image("../template/fig/nenu-logo-title.png", width: 30%), institution: "Northeast Normal University", date: "TODO" )
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/raw_02.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Typst syntax inside. ```typ #let x = 1``` \ ```typ #f(1)```
https://github.com/npujol/npujol.github.io
https://raw.githubusercontent.com/npujol/npujol.github.io/main/Me/basic-cv/basic-cv-de.typ
typst
#import "@preview/basic-resume:0.1.0": * // Put your personal information here, replacing mine #let name = "<NAME>" #let location = "Berlin, Deutschland" #let email = "<EMAIL>" #let github = "github.com/npujol" #let linkedin = "linkedin.com/in/npujolm" #let personal-site = "npujol.github.io" #show: resume.with( author: name, location: location, email: email, github: github, linkedin: linkedin, personal-site: personal-site, ) == Beruferfahrung #work( title: "Software Developer", location: "Berlin, Deutschland", company: "InterContent Group", dates: dates-helper(start-date: "2021", end-date: "Heute"), ) - Entwicklung und Implementierung von Microservices auf der AWS-Infrastruktur, einschließlich EC2, ECS, Lambda und Microsoft Azure Containers Apps, wobei jeder Dienst an die spezifischen Anforderungen angepasst wurde. Für eine effiziente Paketierung und Bereitstellung wurden Docker-Container verwendet. - Verwalten und automatisieren Sie den Prozess der Infrastrukturerstellung und -bereitstellung durch CI/CD-Pipelines mit GitHub Actions, Infrastructure as Code (IaC) mit Terraform und Konfigurationsmanagement mit YAML. - Implementierung von Überwachungs- und Protokollierungslösungen mit Amazon CloudWatch und Sentry, um eine effiziente Problemlösung und Performance-Analyse zu ermöglichen. Die Postman-API wurde zum Testen und Validieren von API-Endpunkten verwendet. #work( title: "Software Developer", location: "Havanna, Kuba", company: "Universidad de las Ciencias Informáticas", dates: dates-helper(start-date: "2014", end-date: "2019"), ) - Entwicklung der Website für die Verwaltung der Postgraduiertenaktivitäten der Universität unter Verwendung von Python, Django, Django REST Framework und PostgreSQL als Hauptdatenbank. Implementierung von Backend-Funktionalitäten unter Berücksichtigung der besten Praktiken in der Backend-Webentwicklung. - Entwicklung und Einsatz von automatisierten Datenaufbereitungsaufgaben und Fehlererkennungsprozessen unter Verwendung von Celery und Redis zur Optimierung der Datenvorverarbeitung und zur Gewährleistung der Datenintegrität. - Durchführung von Datenanalysen, Mustererkennung und prädiktiver Modellierung unter Verwendung von Python-Bibliotheken wie Jupyter, scikit-learn, NumPy, Pandas und Cython, um datengestützte Entscheidungsfindung und Erkenntnisse zu ermöglichen. == Ausbildung #edu( institution: "Universidad de las Ciencias Informáticas", location: "Havanna, Kuba", dates: dates-helper(start-date: "Mai 2016 ", end-date: "Dezember 2018"), degree: "Master-Abschluss in Informatik", ) - *GPA:* 4.82\/5.0 - *Relevante Kursarbeit:* Advanced Mathematics, Advanced Programming Topics Computational Mathematics, Computer Security, Flexible methods for data consultation and analysis, Functional programming, Statistical Methods for Scientific Research. #edu( institution: "Universidad de las Ciencias Informáticas", location: "Havanna, Kuba", dates: dates-helper(start-date: "November 2009 ", end-date: "Juli 2014"), degree: "Bachelor in Software Ingenieurwesen", ) - *GPA:* 4.71\/5.0 - *Relevante Kursarbeit:* Data Structures, Algebra I and II, Discrete Mathematics, Software Engineering, Programming, Mathematics, Computational Intelligence, Digital Systems == Projekte #project( name: "anki_wiktionary", dates: dates-helper(start-date: "2020", end-date: "Heute"), url: "github.com/npujol/anki_wiktionary", ) - Entwicklung eines Projekts, das Anki-Notizen unter Verwendung von linguistischen Daten aus Wiktionary erstellt. Implementierung eines Telegram-Bots, die es Nutzern ermöglicht, zu interagieren und die Erstellung von Anki-Notizen anzufordern. Die Python-Telegram-Bot-Bibliothek wurde zur Erstellung und Verwaltung des Telegram-Bots verwendet, um die Erstellung von Notizen zu ermöglichen. Verwendung von deep-translator für die Sprachübersetzung bzw. von pydantic für die Datenvalidierung. Integration von Selenium WebDriver und Selenium for Web Automation, um die programmatische Erstellung und Verwaltung von Anki-Notizdecks direkt innerhalb der Anki-Anwendung zu ermöglichen. == Fähigkeiten - *Skills:* python, django, terraform, golang, aws, azure, devops, docker, javascript, postgresql, celery, redis, github actions, yaml, latex, pandas, pydantic, git, linux, postman, sentry, bash, typst, TDD, selenium - *Sprachen:* Spanisch(Mütersprache), Deutsch(B1), Englisch(B1)
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/021.%20iflisp.html.typ
typst
iflisp.html If Lisp is So Great May 2003If Lisp is so great, why don't more people use it? I was asked this question by a student in the audience at a talk I gave recently. Not for the first time, either.In languages, as in so many things, there's not much correlation between popularity and quality. Why does <NAME> (King of Torts sales rank, 44) outsell <NAME> (Pride and Prejudice sales rank, 6191)? Would even Grisham claim that it's because he's a better writer?Here's the first sentence of Pride and Prejudice: It is a truth universally acknowledged, that a single man in possession of a good fortune must be in want of a wife. "It is a truth universally acknowledged?" Long words for the first sentence of a love story.Like <NAME>, Lisp looks hard. Its syntax, or lack of syntax, makes it look completely unlike the languages most people are used to. Before I learned Lisp, I was afraid of it too. I recently came across a notebook from 1983 in which I'd written: I suppose I should learn Lisp, but it seems so foreign. Fortunately, I was 19 at the time and not too resistant to learning new things. I was so ignorant that learning almost anything meant learning new things.People frightened by Lisp make up other reasons for not using it. The standard excuse, back when C was the default language, was that Lisp was too slow. Now that Lisp dialects are among the faster languages available, that excuse has gone away. Now the standard excuse is openly circular: that other languages are more popular.(Beware of such reasoning. It gets you Windows.)Popularity is always self-perpetuating, but it's especially so in programming languages. More libraries get written for popular languages, which makes them still more popular. Programs often have to work with existing programs, and this is easier if they're written in the same language, so languages spread from program to program like a virus. And managers prefer popular languages, because they give them more leverage over developers, who can more easily be replaced.Indeed, if programming languages were all more or less equivalent, there would be little justification for using any but the most popular. But they aren't all equivalent, not by a long shot. And that's why less popular languages, like Jane Austen's novels, continue to survive at all. When everyone else is reading the latest John Grisham novel, there will always be a few people reading Jane Austen instead.Japanese TranslationRomanian TranslationSpanish Translation
https://github.com/glyn/url-shortener-maths
https://raw.githubusercontent.com/glyn/url-shortener-maths/main/nhn.typ
typst
= URL Shorterner Performance #show math.equation: set text(font: "New Computer Modern Math") #set math.equation( numbering: (..nums) => numbering("(1)", ..nums), number-align: bottom, supplement: none ) The total cost, $C_n$, of shortening the maximum number of URLs, $n$, is given by: $ C_n = sum_(k=0)^(n-1) r_(k,n) $ <cost> where $r_(k,n)$ is the cost of finding an available shortened URL at random, when $k$ out of $n$ are unavailable (already taken). Clearly: $ r_(k,n) = sum_(i=1)^∞ i p_n (i, k) $ <find> where $p_n (i, k)$ is the probability of finding an available URL on the $i$th attempt when $k$ out of $n$ are already taken. $ &p_n (1, k) = (n - k)/n \ &p_n (2, k) = (k/n) ((n - k)/n) \ &⋮ \ &p_n (i, k) = (k/n)^(i-1) ((n - k)/n) $ <prob> So: $ r_(k,n) &= sum_(i=1)^∞ i p_n (i, k) && #h(5em) "from" #[@find] \ &= sum_(i=1)^∞ i [(k/n)^(i-1) ((n - k)/n)] && #h(5em) "substituting" #[@prob] \ &= (n-k)/n sum_(i=1)^∞ i(k/n)^(i-1) $ <find2> #pagebreak() #set math.equation(numbering: none) Let$ α &= k/n && #h(5em) "(note" α<1 ")" $ #set math.equation( numbering: (..nums) => numbering("(1)", ..nums) ) #import "@preview/physica:0.9.1": * and let $ S_α &= sum_(i=1)^∞ i α^(i-1) \ &= sum_(i=1)^∞ dv(, α) α^i \ &= dv(, α) sum_(i=1)^∞ α^i \ &= dv(, α) ((sum_(i=0)^∞ α^i) - 1) \ &= dv(, α) sum_(i=0)^∞ α^i \ &= dv(, α) (1/(1-α)) && #h(5em) "see Geometric Series on wikipedia" \ &= 1 / (1-α)^2 $ <geom> #line(length: 100%) Therefore: $ r_(k,n) &= (n-k)/n sum_(i=1)^∞ i(k/n)^(i-1) && #h(5em) "from" #[@find2] \ &= (n-k)/n (1 / (1-k/n)^2) && #h(5em) "using" #[@geom] \ &= (1-k/n) (1 / (1-k/n)^2) \ &= 1 / (1-k/n) \ &= n / (n-k) $ <find3> #pagebreak() #set math.equation(numbering: none) So: $ C_n &= sum_(k=0)^(n-1) r_(k,n) && #h(5em) "by definition" #[@cost] \ &= sum_(k=0)^(n-1) n / (n-k) && #h(5em) "by" #[@find3] \ &= n sum_(k=0)^(n-1) 1 / (n-k) \ &= n sum_(j=1)^n 1/j && #h(5em) "subsituting" j = n - k \ &= n H_n $ where $ H_n = sum_(j=1)^n 1/j $ is the $n$th _Harmonic number_. #line(length: 100%) == Example If $n=26000$, the total cost is: $ C_26000 &= 26000 #sym.times H_26000 \ &≈ 26000 #sym.times 10.743 && #h(5em) "(using Wolfram alpha)" \ &= 279318 $
https://github.com/isaacholt100/isaacholt100.github.io
https://raw.githubusercontent.com/isaacholt100/isaacholt100.github.io/master/maths-notes/3-durham%3A-year-3/topology/topology.typ
typst
#import "../../template.typ": * #show: doc => template(doc, hidden: (), slides: false) // FIND: - \*(\w+)\*: ([\s\S]*?)(?=\n-|\n\n)\n // REPLACE: #$1[\n $2\n]\n #let powset(X) = $cal(P)(X)$ #let inv(x) = $#x^(-1)$ #let vd(v) = $bold(#v)$ #let ideal(..gens) = $angle.l #gens.pos().join(",") angle.r$ #let St = $op("St")$ #let int = $op("int")$ = Metric spaces == Metrics #definition[ *Metric space* is $(X, d)$, $X$ is set, $d: X times X -> [0, infinity)$ is *metric* satisfying: - $d(x, y) = 0 <==> x = y$ - *Symmetry*: $d(x, y) = d(y, x)$ - *Triangle inequality*: $d(x, y) <= d(x, z) + d(z, y)$ ] #example[ - $p$-adic metric: for $p in lr([1, oo))$ $ d_p (x, y) = (sum_(i = 1)^n |x_i - y_i|^p)^(1/p) $ - Extension of the $p$-adic metric: $ d_infinity (x, y) = max{|x_i - y_i|: i in [n]} $ - Metric of $C([a, b])$: $ d(f, g) = sup{|f(x) - g(x)|: x in [a, b]} $ - Discrete metric: $ d(x, y) = cases(0 & "if" x = y, 1 & "if" x != y) $ ] #definition[ *Open ball of radius $r$ around $x$*: $ B(x; r) := {y in X: d(x, y) < r} $ ] #definition[ *Closed ball of radius $r$ around $x$*: $ D(x; r) := {y in X: d(x, y) <= r} $ ] == Open and closed sets #definition[ $U subset.eq X$ is *open* if $ forall x in U, exists epsilon > 0: B(x; epsilon) subset.eq U $ ] #definition[ $A subset.eq X$ is *closed* if $X - A$ is open. ] #note[ It is possible for sets to be neither closed nor open, or both closed and open. ] #example[ With standard metric on $RR$, any singleton ${x} in RR$ is closed and not open (same holds for $RR^n$). ] #definition[ Let $X$ be metric space, $x in N subset.eq X$. $N$ is *neighbourhood* of $x$ if $ exists "open " V subset.eq X: x in V subset.eq N $ ] #corollary[ Let $x in X$, then $N subset.eq X$ neighbourhood of $x$ iff $exists epsilon > 0: x in B(x; epsilon) subset.eq N$. ] #proposition[ Open balls are open, closed balls are closed. ] #lemma[ Let $(X, d)$ metric space. - $X$ and $nothing$ are both open and closed. - Arbitrary unions of open sets are open. - Finite intersections of open sets are open. - Finite unions of closed sets are closed. - Arbitrary intersections of closed sets are closed. ] #example[ If $X$ has discrete metric, any $A subset.eq X$ is open and closed. ] == Continuity #definition[ - *Sequence* in $X$ is $a: NN_0 -> X$, written $\(a_n\)_(n in NN)$. - $(a_n)$ *converges to $a$*, $lim_(n -> oo) a_n = a$, if $ forall epsilon > 0, exists n_0 in NN: forall n >= n_0, d(a, a_n) < epsilon $ ] #proposition[ Let $X, Y$ metric spaces, $a in X$, $f: X -> Y$. The following are equivalent: - $forall epsilon > 0, exists delta > 0: forall x in X, d_X (a, x) < delta ==> d_Y (f(a), f(x)) < epsilon$. - For every sequence $(a_n)$ in $X$ with $a_n -> a$, $f(a_n) -> f(a)$. - For every open $U subset.eq Y$ with $f(a) in U$, $f^(-1) (U)$ is a neighbourhood of $a$. If $f$ satisfies these, it is *continuous at $a$*. ] #definition[ $f$ *continuous* if continuous at every $a in X$. ] #proposition[ $f: X -> Y$ continuous iff $f^(-1)(U)$ open for every open $U subset.eq Y$. ] #example[ Let $d$ be discrete metric, $d_2$ be $2$-adic metric. - Any $f: (X, d) -> (RR, d_2)$ is continuous. - $id: (RR, d_2) -> (RR, d)$ is not continuous. ] = Topological spaces == Topologies #definition[ *Power set* of $X$: $cal(P)(X) := {A: A subset.eq X}$. ] #definition[ *Topology* on set $X$ is $tau subset.eq cal(P)(X)$ with: - $nothing in tau$, $X in tau$. - *Closure under arbitrary unions*: if $forall i in I, U_i in tau$, then $ union.big_(i in I) U_i in tau $ - *Closure under finite intersections*: $U_1, U_2 in tau ==> U_1 sect U_2 in tau$ (this is equivalent to $U_1, ..., U_n in tau ==> sect.big_(i in [n]) U_i in tau$). $(X, tau)$ is *topological space*. Elements of $tau$ are *open* subsets of $X$. $A subset.eq X$ *closed* if $X - A$ is open. ] #definition[ $tau = powset(X)$ is the *discrete topology* on $X$. ] #definition[ $tau = {nothing, X}$ is the *indiscrete topology* on $X$. ] #example[ - For metric space $(M, d)$, let $tau_d$ exactly contain sets which are open with respect to $d$. Then $(M, tau_d)$ is a topological space. $d$ *induces* topology $tau_d$. - Let $X = NN_0$ and $tau = {nothing} union {U subset.eq X: X - U "is finite"}$, then $(X, tau)$ is topological space. ] #proposition[ For topological space $X$: - $X$ and $nothing$ are closed - Arbitrary intersections of closed sets are closed - Finite unions of closed sets are closed ] #proposition[ For topological space $(X, tau)$ and $A subset.eq X$, the *induced (subspace) topology on $A$* $ tau_A = {A sect U: U in tau} $ is a topology on $A$. ] #example[ Let $X = RR$ with standard topology induced by metric $d(x, y) = |x - y|$. Let $A = [1, 5]$. Then $lr([1, 3)) = A sect (0, 3)$ and $[1, 5] = A sect (0, 6)$ are open in $A$. ] #example[ Consider $RR$ with standard topology $tau$. Then - $tau_ZZ$ is the discrete topology on $ZZ$. - $tau_QQ$ is not the discrete topology on $QQ$. ] #proposition[ Metrics $d_p$ for $p in lr([1, oo))$ and $d_oo$ all induce same topology on $RR^n$, called the *standard topology* on $RR^n$. ] #definition[ $(X, tau)$ is *Hausdorff* if $ forall x != y in X, exists U, V in tau: U sect V = nothing and x in U, y in V $ ] #lemma[ Any metric space $(M, d)$ with topology induced by $d$ is Hausdorff. ] #example[ Let $|X| >= 2$ with indiscrete topology. Then $X$ is not Hausdorff, since $tau = {X, nothing}$ and if $x != y in X$, only open set containing $x$ is $X$ (same for $y$). But $X sect X = X != nothing$. ] #definition[ *Furstenberg's topology on $ZZ$*: define $U subset.eq ZZ$ to be open if $ forall a in U, exists 0 != d in ZZ: a + d ZZ := {a + d n: n in ZZ} subset.eq U $ ] #proposition[ Furstenberg's topology is Hausdorff. ] == Continuity #definition[ Let $X, Y$ topological spaces. - $f: X -> Y$ is *continuous* if $ forall V "open in" Y, f^(-1) (V) "open in" X $ - $f$ is *continuous at $a in X$* if $ forall V "open in" Y "with" f(a) in V, exists U "open in" X: a in U subset.eq f^(-1) (V) $ ] #lemma[ $f: X -> Y$ continuous iff $f$ continuous at every $a in X$. (Key idea for proof: $union_(a in f^(-1) (V)) U_a subset.eq f^(-1) (V) = union_(a in f^(-1) (V)) {a} subset.eq union_(a in f^(-1) (V)) U_a$) ] #example[ Inclusion $i: (A, tau_A) -> (X, tau_X)$, $A subset.eq X$, is always continuous. ] #lemma[ Compositions of continuous functions are continuous. ] #lemma[ Let $f: X -> Y$ be function between topological spaces. Then $f$ is continuous iff $ forall A "closed in" Y, quad f^(-1) (A) "closed in" X $ ] #remark[ We can use continuous functions to decide that sets are open or closed. ] #definition[ *$n$-sphere* is $ S^n := {(x_1, ..., x_(n + 1)) in RR^(n + 1): sum_(i = 1)^(n + 1) x_i^2 = 1} $ ] #example[ In the standard topology, the $n$-sphere is a closed subset of $RR^(n + 1)$. (Consider the preimage of ${1}$ which is closed in $RR$). ] #example[ - Can consider set of square matrices $M_(n, n) (RR) tilde.equiv RR^(n^2)$ and give it the standard topology. - Note $ det(A) = sum_(sigma in "sym"(n)) ("sgn"(sigma) product_(i = 1)^n a_(i, sigma(i))) $ is a polynomial in the entries of $A$ so is continuous function from $M_n (RR)$ to $RR$. - $"GL"_n (RR) = {A in M_n (RR): det(A) != 0} = det^(-1) (RR - {0})$ is open. - $"SL"_n (RR) = {A in M_n (RR): det(A) = 1} = det^(-1) ({1})$ is closed. - $O(n) = {A in M_n (RR): A A^T = I}$ is closed: $f_(i, j) (A) = \(A A^T\)_(i, j)$ is continuous and $ O(n) = sect.big_(1 <= i, j <= n) \(f_(i, j)\)^(-1) \(\{delta_(i, j)\}\) $ - $"SO"(n) = O(n) sect "SL"_n (RR)$ is closed. ] #definition[ For $X, Y$ topological spaces, $h: X -> Y$ is *homeomorphism* if $h$ is bijective, continuous and $h^(-1)$ is continuous. $X$ and $Y$ are *homeomorphic*, $X tilde.equiv Y$. $h$ induces bijection between $tau_X$ and $tau_Y$ which commutes with unions and intersections. ] #proposition[ Compositions of homeomorphisms are homeomorphisms. ] #example[ In standard topology, $(0, 1)$ is homeomorphic to $RR$. (Consider $f: (-pi/2, pi/2) -> (-oo, oo)$, $f = tan$, $g: (0, 1) -> (-pi/2, pi/2)$, $g(x) = pi (x - 1/2)$ and $f compose g$). ] #example[ $RR$ with standard topology $tau_"st"$ is not homoeomorphic to $RR$ with the discrete topology $tau_d$. (Consider $h^(-1) ({a}) = {h^(-1) (a)}$, ${a} in tau_d$ but ${h^(-1) (a)} in.not tau_"st"$). ] #example[ Let $X = RR union \{overline(0)\}$. Define $f_0: RR -> X$, $f_0(a) = a$ and $f_(overline(0)): RR -> X$, $f_(overline(0))(a) = a$ for $a != 0$, $f_(overline(0))(0) = overline(0)$. Topology on $X$ has $A subset.eq X$ open iff $f_0^(-1)(A)$ and $f_(overline(0))^(-1)(A)$ open. Every point in $X$ lies in open set: for $a in.not \{0, overline(0)\}$, $a in \(a - (|a|)/2, a + (|a|)/2\)$ and both pre-images of this are same open interval, for $0$, set $U_0 = (-1, 0) union {0} union (0, 1) subset.eq X$ then $f_0^(-1) (U_0) = (-1, 1)$ and $f_(underline(0))^(-1) (U_0) = (-1, 0) union (0, 1)$ are both open. For $overline(0)$, set $U_(overline(0)) = (-1, 0) union {overline(0)} union (0, 1) subset.eq X$, then $f_(overline(0))^(-1)(U_(overline(0))) = (-1, 1)$ and $f_0^(-1)(U_(overline(0))) = (-1, 0) union (0, 1)$ are both open. So $U_0$ and $U_(overline(0))$ both open in $X$. $X$ is not Hausdorff since any open sets containing $0$ and $overline(0)$ must contain "open intervals" such as $U_0$ and $U_(overline(0))$. ] #example(name: "Furstenberg's proof of infinitude of primes")[ Since $a + d ZZ$ is infinite, any nonempty finite set is not open, so any set with finite complement is not closed. For fixed $d$, sets $d ZZ$, $1 + d ZZ, ..., (d - 1) + d ZZ$ partition $ZZ$. So the complement of each is the union of the rest, so each is open and closed. Every $n in ZZ - {-1, 1}$ is prime or product of primes, so $ZZ - {-1, 1} = union.big_(p "prime") p ZZ$, but finite unions of closed sets are closed, and since $ZZ - {-1, 1}$ has finite complement, the union must be infinite. ] = Limits, bases and products == Limit points, interiors and closures #definition[ For topological space $X$, $x in X$, $A subset.eq X$: - *Open neighbourhood of $x$* is open set $N$, $x in N$. - $x$ is *limit point* of $A$ if every open neighbourhood $N$ of $x$ satisfies $ (N - {x}) sect A != nothing $ ] #corollary[ $x$ is not limit point of $A$ iff exists neighbourhood $N$ of $x$ with $ A sect N = cases({x} & "if" x in A, nothing & "if" x in.not A) $ ] #example[ Let $X = RR$ with standard topology. - $0 in X$, then $(-1\/2, 1\/2)$ is open neighbourhood of $0$. - If $U subset.eq X$ open, $U$ is open neighbourhood for any $x in U$. - Let $A = {1/n: n in ZZ - {0}}$, then only limit point in $A$ is $0$. ] #definition[ Let $A subset.eq X$. - *Interior* of $A$ is largest open set contained in $A$: $ A^circle.small := union.big_(U "open" \ U subset.eq A) U $ - *Closure* of $A$ is smallest closed set containing $A$: $ overline(A) := sect.big_(F "closed" \ A subset.eq F) F $ If $overline(A) = X$, $A$ is *dense* in $X$. ] #lemma[ - $overline(X - A) = X - A^circle.small$ - $overline(A) = X - (X - A)^circle.small$ ] #example[ Let $QQ subset RR$ with standard topology. Then $QQ^circle.small = nothing$ and $overline(QQ) = RR$ (since every nonempty open set in $RR$ contains rational and irrational numbers). ] #lemma[ $overline(A) = A union L$ where $L$ is the set of limit points of $A$. ] #theorem(name: "Dirichlet prime number theorem")[ Let $a, d$ coprime, then $a + d ZZ$ contains infinitely many primes. ] #example[ Let $A$ be set of primes in $ZZ$ with Furstenberg topology. By above lemma, only need to find limit points in $ZZ - A$ to find $overline(A)$. $10 ZZ$ is an open neighbourhood of $0$ for $0$ inside $ZZ - A$. For $a in.not {-1, 0, 1}$, $a + 10a ZZ$ is an open neighbourhood of $a$. These sets have no primes so the corresponding points are not limit points of $A$. For $plus.minus 1$, any open neighbourhood of $plus.minus 1$ contains a set $plus.minus 1 + d ZZ$ for some $d != 0$, but by the Dirichlet prime number theorem, this set contains at least one prime. So $overline(A) = A union {plus.minus 1}$. ] #lemma[ - Let $A subset.eq M$ for metric space $M$. If $x$ is limit point of $A$ then exists sequence $x_n$ in $A$ such that $lim_(n -> oo) x_n = x$. - If $x in M - A$ and exists sequence $x_n$ in $A$ with $lim_(n -> oo) x_n = x$ then $x$ is limit point of $A$. ] == Bases #definition[ A *basis* for topology $tau$ on $X$ is collection $cal(B) subset.eq tau$ such that $ forall U in tau, exists B subset.eq cal(B): U = union.big_(b in B) b $ (every open $U$ is a union of sets in $B$). ] #example[ - For metric space $(M, d)$, $cal(B) = {B(x; r): x in M, r > 0}$ is basis for the induced topology. (Since if $U$ open, $U = union_(u in U) {u} subset.eq union_(u in U) B(u, r_u) subset.eq U$.) - In $RR^n$ with standard topology, $cal(B) = {B(q; 1\/m): q in QQ^n, m in NN}$ is a *countable* basis. (Find $m in NN$ such that $1/m < r/2$ and $q in QQ^n$ such that $q in B(p; 1/m)$, then $B(q; 1/m) subset.eq B(p; r) subset.eq U$ using the triangle inequality). ] #theorem[ Let $f: X -> Y$ be map between topological spaces. The following are equivalent: - $f$ is continuous. - If $cal(B)$ is basis for topology $tau$ on $Y$ then $f^(-1)(B)$ is open for every $B in cal(B)$. - $forall A subset.eq X, f\(overline(A)\) subset.eq overline(f(A))$. - $forall V subset.eq Y, overline(f^(-1)(V)) subset.eq f^(-1)\(overline(V)\)$. - $f^(-1)(C)$ closed for any closed set $C subset.eq Y$. ] #theorem[ Let $X$ be a set and collection $cal(B) subset.eq cal(P)(X)$ be such that: - $forall x in X, exists B in cal(B): x in B$ - If $x in B_1 sect B_2$ with $B_1, B_2 in cal(B)$, then $exists B_3 in cal(B): x in B_3 subset.eq B_1 sect B_2$. Then there is unique topology $tau_(cal(B))$ on $X$ for which $cal(B)$ is a basis. We say $cal(B)$ *generates* $tau_(cal(B))$. We have $tau_B = {union_(i in I) B_i: B_i in cal(B), I "indexing set"}$. ] == Product topologies #definition[ *Cartesian product* of topological spaces $X, Y$ is $X times Y := {(x, y): x in X, y in Y}$. We give it the *product topology* which is generated by $cal(B)_(X times Y) := {U times V: U in tau_X, V in tau_Y}$. ] #example[ - Let $X = Y = RR$, then product topology is same as standard topology on $RR^2$. - Let $X = Y = S^1$, then $X times Y = T^2 = S^1 times S^1$ is the *$2$-torus*. *$n$-torus* is defined for $n >= 3$ by $ T^n := S^1 times T^(n - 1) $ ] #definition[ If $tau_1 subset.eq tau_2$ are topologies, then $tau_1$ is *smaller* than $tau_2$ ($tau_2$ is *larger* than $tau_1$). ] #definition[ For topological spaces $X, Y$, *projection maps* $pi_X: X times Y -> X$ and $pi_Y: X times Y -> Y$ are $ pi_X (x, y) = x, quad pi_Y (x, y) = y $ ] #proposition[ For $X times Y$ with product topology, - $pi_X$ and $pi_Y$ are continuous. - $pi_X$ and $pi_Y$ map open sets to open sets. - Product topology is smallest topology for which $pi_X$ and $pi_Y$ are continuous. ] #proposition[ Let $X, Y, Z$ topological spaces, then $f: Z -> X times Y$ (with product topology on $X times Y$) continuous iff both $pi_X compose f: Z -> X$ and $pi_Y compose f: Z -> Y$ are continuous. ] #example[ Let $f: X -> RR^n$, $pi_i: RR^n -> RR$, $pi_i (x) = x_i$, $f_i = pi_i compose f$, then $f$ is continuous iff all $f_i$ are continuous. ] #proposition[ Let $X, Y$ nonempty topological spaces. Then $X times Y$ with product topology is Hausdorff iff $X$ and $Y$ are both Hausdorff. ] = Connectedness == Clopen sets and examples #definition[ Let $X$ topological space, then $A subset.eq X$ is *clopen* if $A$ is open and closed. ] #definition[ $X$ is *connected* if the only clopen sets in $X$ are $X$ and $nothing$. ] #example[ - $RR$ with standard topology is connected. - $QQ$ with induced topology from $RR$ is not connected (consider $L = QQ sect \(-oo, sqrt(2)\)$ and $QQ - L = QQ sect \(sqrt(2), oo\)$). - The connected subsets of $RR$ are the intervals. ] #definition[ $A subset.eq RR$ is an interval iff $forall x, y in A, forall z in RR, x < z < y ==> z in A$. ] #example[ - $X = {0, 1}$ with discrete topology is not connected (${1}$ and ${0}$ both open so both closed). - $X = {0, 1}$ with $tau = {nothing, {1}, {0, 1}}$ is connected. - $ZZ$ with Furstenberg topology is not connected. ] #theorem(name: "continuity preserves connectedness")[ If $h: X -> Y$ continuous and $X$ connected, then $h(X) subset.eq Y$ is connected. ] #corollary[ If $h: X -> Y$ is homeomorphism and $X$ is connected then $Y$ is connected. ] #theorem[ Let $X$ topological space. The following are equivalent: - $X$ is connected. - $X$ cannot be written as disjoint union of two non-empty open sets. - There exists no continuous surjective function from $X$ to a discrete space with more than one point. ] #example[ - $"GL"_n (RR)$ is not connected (since $det: "GL"_n (RR) -> RR - {0}$ is continuous and surjective and $RR - {0} = (-oo, 0) union (0, oo)$). - $O(n)$ is not connected. - $(0, 1)$ is connected (since $RR tilde.equiv (0, 1)$ and $RR$ is connected). - $X = lr((0, 1])$ and $Y = (0, 1)$ are not homeomorphic (consider $h(1) = p in Y$). ] #definition[ Let $A = B union C$, $B sect C = emptyset$, then $B$ and $C$ are *complementary subsets* of $A$. ] #remark[ If complementary $B$ and $C$ open in $A$, then $B$ and $C$ clopen in $A$. So if $B, C != emptyset$ then $A$ not connected. ] == Constructing more connected sets, components, path-connectedness #proposition[ Let $X$ topological space, $Z subset.eq X$ connected. If $Z subset.eq Y subset.eq overline(Z)$ then $Y$ is connected. In particular, with $Y = overline(Z)$, the closure of a connected set is connected. ] #proposition[ Let $A_i subset.eq X$ connected, $i in I$, $A_i sect A_j != emptyset$ and $union_(i in I) A_i = X$. Then $X$ is connected. ] #theorem[ If $X$ and $Y$ are connected then $X times Y$ is connected. ] #example[ - $RR^n$ is connected. - $B^n = {x in RR^n: d_2 (0, x) < 1}$ is connected ($B^n$ is homeomorphic to $RR^n$). - $D^n = {x in RR^n: d_2 (0, x) <= 1} = overline(B^n)$ is connected. ] #example[ - $forall n in NN$, $S^n$ is connected. - $forall n in NN$, $T^n$ is connected. ] #definition[ *Component* of topological space $X$ is maximal connected subset of $X$. ] #proposition[ In a topological space $X$: - Every $p in X$ is in a unique component. - If $C_1 != C_2$ are components, then $C_1 sect C_2 = emptyset$. - $X$ is the union of its components. - Every component is closed in $X$. ] #example[ - If $X$ connected, then its only component is itself. - If $X$ discrete, then each singleton in $tau_X$ is a component. - In $QQ$ with induced standard topology from $RR$, every singleton is a component. ] #definition[ *Path* in topological space $X$ is continuous function $gamma: [0, 1] -> X$. $gamma$ is said to be path from $gamma(0)$ to $gamma(1)$. ] #definition[ $X$ is *path-connected* if for every $p, q in X$, there is a path from $p$ to $q$. ] #proposition[ Every path-connected topological space is connected. ] #example[ Let $ Z = {(x, sin(1\/x)) in RR^2: 0 < x <= 1} $ $Z$ is path-connected, as a path from $(x_1, sin(1\/x_1))$ to $(x_2, sin(1\/x_2))$ is given by $ gamma(t) = (x_1 + (x_2 - x_1)t, sin(1/(x_1 + (x_2 - x_1)t))) $ So then $Z$ is connected by the above proposition, and since the closure of a connected set is connected, $overline(Z)$ is connected. ] Every point $(0, y)$, $y in [-1, 1]$ is a limit point of $Z$. Assume $overline(Z)$ is path-connected. Then there is a path $gamma: [0, 1] -> overline(Z)$ from $(0, 0)$ to $(1, sin(1))$. Since $(pi_X compose gamma)(0) = 0$ and $(pi_X compose gamma)(1) = 1$ and $pi_X compose gamma$ is continuous, by the Intermediate Value Theorem, $exists t_1 in [0, 1]: (pi_X compose gamma)(t_1) = 2\/pi$. By IVT again, $exists t_2 in [0, t_1]: (pi_X compose gamma)(t_2) = 2/(2pi)$. We obtain a strictly decreasing sequence $(t_n) subset.eq [0, 1]$ where $(pi_X compose gamma)(t_n) = 2/(n pi)$ which is bounded below by $0$, so must converge with limit $t^*$. Now $pi_Y compose gamma$ is continuous, so $lim_(n -> oo) (pi_Y compose gamma)(t_n) = (pi_Y compose gamma)(t^*)$. But $(pi_Y compose gamma)(t_n) = sin((n pi)/2)$, and as $n -> oo$, this oscillates between $-1$ and $1$ and does not converge, so contradiction. = Compactness #definition[ Let $X$ topological space, *cover* of $X$ is collection $\(U_i\)_(i in I)$ of subsets of $X$ with $ union.big_(i in I) U_i = X $ If every $U_i$ is open, it is an *open cover*. If $J subset.eq I$, then $\(U_i\)_(i in J)$ is a *subcover* of $\(U_i\)_(i in I)$ if it is also a cover. ] #definition[ $X$ is *compact* if every open cover of $X$ admits a finite subcover. ] #example[ - If $X$ is finite then $X$ is compact. - $RR$ is not compact. - If $X$ infinite with $tau = {U subset.eq X: X - U "is finite"} union {emptyset}$, then $X$ is compact. ] #proposition[ Let $X$ have topology with basis $cal(B)$. Then $X$ is compact iff every cover $\(B_i\)_(i in I)$ of $X$, $B_i in cal(B)$, admits a finite subcover of $X$. ] #remark[ To determine compactness of $Y subset.eq X$ with induced topology, consider open covers $Y = union_(i in I) (U_i sect Y)$ for $U_i$ open in $X$, which is equivalent to $Y subset.eq union_(i in I) U_i$. ] #example[ $[0, 1]$ is compact. ] #proposition[ If $f: X -> Y$ continuous, $X$ compact, then $f(X)$ is compact. ] #proposition[ If $X$ compact, $A subset.eq X$ closed in $X$, then $A$ is compact. ] #theorem[ If $X$ is Hausdorff and $A subset.eq X$ is compact then $A$ is closed. ] #corollary[ If $X$ compact, $Y$ is Hausdorff, $f: X -> Y$ continuous bijection, then $f$ is homeomorphism. ] #theorem[ If $X$, $Y$ compact, then $X times Y$ is compact. ] #definition[ $S subset.eq RR^n$ is *bounded* if $ exists r in RR: S subset.eq B(0; r) $ ] #theorem(name: "Heine-Borel")[ $A subset.eq RR^n$ is compact iff it is closed and bounded. ] #example[ - $S^n$ is compact. - $T^n$ is compact. - $X = {vd(x) in RR^3: x_1^2 + x_2^2 - x_3^3 = 1}$ is not compact, since $forall n in NN$, $\(n, 0, \(n^2 - 1\)^(1\/3) \) in X$, so $X subset.eq.not B(n)$, so is unbounded, so not compact by Heine-Borel. ] #corollary[ Let $f: X -> RR$, $X$ compact, $f$ continuous. Then $f$ attains its maximum and minimum. ] #theorem(name: "Bolzano-Weierstrass")[ An infinite subset $A$ of a compact space $X$ has a limit point in $X$. ] = Quotient spaces #definition[ Let $X$ topological space, $tilde$ equivalence relation on $X$. Write $X\/tilde$ for the set of equivalence classes of $tilde$: for $x in X$, $ [x] := {y in X: y tilde x}, quad X\/tilde thick := {[x]: x in X} $ There is a surjective map, the *quotient map*, $pi: X -> X\/tilde$, $pi(x) = [x]$. ] #example[ Let $X = RR^3$, define equivalence relation $ (x_1, y_1, z_1) tilde (x_2, y_2, z_2) <=> z_1 = z_2 $ Then $pi(a, b, c) = [(a, b, c)] = {(x, y, z) in RR^3: z = c}$. Elements of $RR^3\/tilde$ are horizontal planes. ] #definition[ Let $X$ topological space, $tilde$ equivalence relation on $X$. Then $X\/tilde$ is given *quotient topology* defined by $ U subset.eq X\/tilde "open" <==> pi^(-1)(U) "open in" X $ ] #proposition[ Quotient topology defines a topology on $X\/tilde$. ] #proposition[ Quotient topology on $X\/tilde$ is largest such that $pi$ is continuous. ] #proposition[ Let $X$ topological space with equivalence relation $tilde$, $Y$ topological space. Then $f: X\/tilde thick -> Y$ continuous iff $f compose pi: X -> Y$ is continuous. ] #example[ In $RR$, let $x tilde y <==> x - y in ZZ$. Define $exp: RR -> S^1 subset.eq CC$, $exp(t) = e^(2pi i t)$ and $overline(exp): RR\/tilde thick -> S^1$, $overline(exp)([t]) = exp(t)$. Then $ [s] = [t] <==> s - t = k in ZZ <==> overline(exp)(s) = e^(2pi i k) e^(2pi i t) = e^(2pi i t) = overline(exp)(t) $ Hence $overline(exp)$ is well-defined and injective, and is surjective since $exp$ is. Also, $overline(exp)$ is continuous since $exp = overline(exp) compose pi$ is. $RR^2$ is a metric space and so is Hausdorff, so $S^1 subset RR^2$ with the induced topology is Hausdorff. Now e.g. $pi([-10, 10]) = RR\/tilde$, $[-10, 10]$ is compact and $pi$ continuous so $RR\/tilde$ is compact. Since $overline(exp)$ is a continuous bijection, these three properties imply $overline(exp)$ is a homeomorphism. Hence $RR\/tilde thick tilde.equiv S^1$. ] #definition[ Let $A subset.eq X$, define $x tilde y <==> x = y$ or $x, y in A$. Then define $X\/A := X\/tilde$. ] #example[ $S^n tilde.equiv D^n \/ S^(n - 1)$. Any point in $D^n$ can be written as $t dot.op phi$, $t in [0, 1]$, $phi in S^(n - 1)$. Define $ f: D^n -> S^n, quad f(t dot.op phi) &:= (cos(pi t), phi sin(pi t)) in RR times RR^n = RR^(n + 1) \ ==> f(0 dot.op phi) & = (1, vd(0)), thick f(1\/2 dot.op phi) = (0, phi), thick f(1 dot.op phi) = (-1, 0) $ Define $overline(f): D^n \/ S^(n - 1) -> S^n$, $overline(f)([t dot.op phi]) = f(t dot.op phi)$. If $t_1 dot.op phi_1 != t_2 dot.op phi_2$, then $ [t_1 dot.op phi_1] = [t_2 dot.op phi_2] <==> t_1 dot.op phi_1, t_2 dot.op phi_2 in S^(n - 1) & <==> t_1 = t_2 = 1 \ & <==> f(t_1 dot.op phi_1) = (-1, vd(0)) = f(t_2 dot.op phi_2) \ & <==> overline(f)([t_1 dot.op phi_1]) = overline(f)([t_2 dot.op phi_2]) $ $f$ is surjective, so $overline(f)$ is also. Now $overline(f) compose pi = f$ which is continuous, so by above proposition, $overline(f)$ is continuous. $S^n subset RR^(n + 1)$ is Hausdorff, $D^n subset RR^n$ is closed and bounded so is compact by Heine-Borel, and so $D^n \/ S^(n - 1)$ is compact (since $pi$ continuous). Also, $f$ is a continuous bijection. These imply that $overline(f)$ is homeomorphism. ] = Topological groups == Examples #definition[ A *topological group* $G$ is Hausdorff space which is also a group such that $ circle.filled.small: G times G -> G, thick thick circle.filled.small (g, h) = g h quad "and" quad i: G -> G, thick thick i(g) = g^(-1) $ are continuous. ] #example[ - $RR^n$ with addition is topological group. - $"GL"_n (RR)$ with multiplication and its subgroups $O(n)$ and $"SO"(n)$ are topological groups (each entry in $A B$ is sum of products of entries of $A$ and $B$, so matrix multiplication is continuous, matrix inversion also continuous). ] #proposition[ - Any group with discrete topology is topological group. - Any subgroup of topological group is also topological group. ] #example[ - $CC - {0}$ with multiplication has topological subgroup $S^1 subset CC - {0}$. - Define *quaternions* as vector space $HH := ideal(1, i, j, k)$, with topology taken from $RR^4$. $HH - {0}$ is a multiplicative group with $S^3$ a topological subgroup. For $q = a + b i + c j + d k in HH$, $a, b, c, d in RR$, we have $i j := k$, $j k := i$, $k i := j$, $j i := -k$, $k j := -i$, $i k := -j$. For $q != 0$, $ q^(-1) = (a - b i - c j - d k)/(a^2 + b^2 + c^2 + d^2) $ - Note however that $S^2$ is not a topological group. ] #definition[ For topological group $G$, $x in G$, define *left translation by $x$* as $ L_x: G -> G, quad L_x (g) := x g $ Similarly, *right translation by $x$* is $ R_x: G -> G, quad R_x (g) := g x $ ] #proposition[ $L_x$ has inverse $(L_x)^(-1) = L_(x^(-1))$ and is homeomorphism. Similarly for $R_x$. ] #notation[ A specified inclusion $G limits(arrow.hook)^x G times G$ is the map $G -> {x} times G$ composed with the inclusion map ${x} times G -> G times G$. (similarly for $G times {x}$). ] #proposition[ Let $G$ topological group, $K$ the component containing identity of $G$. Then $K$ is normal subgroup of $G$. ] #example[ $O(n)$ is not connected, but $"SO"(n)$ is connected and contains $I_n$, so is a normal subgroup of $O(n)$ ] == Actions, orbits, orbit spaces #definition[ *Action* of group $G$ on topological space $X$ is map $circle.filled.small: G times X -> X$ such that $forall g, h in G$, $forall x in X$, - $(h g) circle.filled.small x = h circle.filled.small (g circle.filled.small x)$. - $1 circle.filled.small x = x$. - $g: X -> X$ defined by $g(x) = g circle.filled.small x$ is continous. Note: $g$ has inverse map $g^(-1)$ which is also continuous, so both are homeomorphisms. ] #definition[ *Action* of topological group $G$ on topological space $X$ is continuous map $circle.filled.small: G times X -> X$ such that $forall g, h in G$, $forall x in X$, - $(h g) circle.filled.small x = h circle.filled.small (g circle.filled.small x)$. - $1 circle.filled.small x = x$. ] #remark[ For the above definition, the condition $g(x) = g circle.filled.small x$ being continuous isn't required since $g$ is the composition of continuous maps: $ X limits(arrow.hook)^g G times X limits(-->)^circle.filled.small X, quad x -> (g, x) -> g circle.filled.small x $ ] #example[ - Trivial action: $(g, x) |-> g circle.filled.small x = x$, so $circle.filled.small = pi_X$. - Let $G = "GL"_n (RR)$, $X = RR^n$, let the action be matrix multiplication: $(A, vd(x)) -> A circle.filled.small vd(x) = A vd(x)$. This induces an action of subgroups $O(n)$ or $"SO"(n)$ on $X = RR^n$. - Let $H$ subgroup of topological group $G$, *left translation action* of $H$ on $G$ is $circle.filled.small: H times G -> G$, $h circle.filled.small g = h g$. Equivalently, $phi(h) = L_h$. - Let $N$ normal subgroup of topological group $G$, *conjugation action* of $G$ on $N$ is $circle.filled.small: G times N -> N$, $g circle.filled.small n = g n g^(-1)$. ] #definition[ Let $G$ act on topological space $X$, define equivalence relation $tilde$ on $X$ by $ x tilde y <==> exists g in G: g(x) := g circle.filled.small x = y $ An equivalence class for this relation is an *orbit*, denoted $G x$. *Orbit space*, $X\/G$, is quotient space $X\/tilde$. Action is *transitive* if $X\/G$ is a singleton. ] #example[ - If $G$ acts trivially, every orbit is singleton and $X\/G = X$. - $RR^n\/"GL"_n (RR)$ contains two points and has neither discrete nor indiscrete topology. - Action of $O(n)$ on $S^(n - 1)$ is transitive for $n in NN$. Action of $"SO"(n)$ on $S^(n - 1)$ is transitive for $n >= 2$. ] #lemma[ If connected topological group $G$ acts on topological space $X$, then the orbits are connected in $X$. ] #theorem[ Let $G$ connected topological group act on topological space $X$. If $X\/G$ is connected, then $X$ is connected. ] #notation[ Define specified inclusion $i_1: M_n (RR) limits(arrow.hook)^1 M_(n + 1) (RR)$ by $A -> mat(1, 0; 0, A)$. So $M_n (RR)$ can be regarded as subspace of $M_(n + 1) (RR)$. ] #proposition[ - Using the inclusion $limits(arrow.hook)^1$, $"SO"(n)$ is subgroup of $"SO"(n + 1)$. - Viewing these as topological groups, if subgroup $"SO"(n)$ acts on $"SO"(n + 1)$, orbit space is $"SO"(n + 1)\/"SO"(n) tilde.equiv S^n$. ] #corollary[ The topological group $"SO"(n)$ is connected for $n in NN$. ] #import "@preview/cetz:0.2.0": canvas #import "@preview/cetz:0.2.0" #let polygon(points, labels: (), show-vertices: true, color: black, centre: (0, 0), ..other) = { let circ = circle let c = centre let (cx, cy) = (0, 0) import cetz.draw: * // translate(x: centre.at(0), y: centre.at(1)) for (x, y) in points { (cx, cy) = (cx + x, cy + y) } (cx, cy) = (cx / points.len(), cy / points.len()) // (cx, cy) = (cx + c.at(0), cy + c.at(1)) // circle((cx, cy), radius: 0.1) // let (cx, cy) = centre points.push(points.first()) cetz.draw.merge-path(..other, stroke: color + 1.5pt, { // translate(x: centre.at(0), y: centre.at(1)) for i in range(points.len() - 1) { let (x1, y1) = points.at(i) let (x2, y2) = points.at(i + 1) cetz.draw.line((x1 + c.at(0), y1 + c.at(1)), (x2 + c.at(0), y2 + c.at(1))) } }) for i in range(points.len() - 1) { if show-vertices { let (x, y) = points.at(i) circle((x + c.at(0), y + c.at(1)), radius: 0.05, fill: color, stroke: none) } if labels.len() > 0 { let (x, y) = points.at(i) let (dx, dy) = (x - cx, y - cy) let anchor = (x + dx / 6, y + dy / 6) cetz.draw.content((anchor.at(0) + c.at(0), anchor.at(1) + c.at(1)), circ(fill: none, stroke: none, inset: 0.2em)[#labels.at(i)]) } } } #let ngon(n, centre: (0, 0), radius: 1, show-vertices: true, color: black, ..other) = { let top = (radius, 0) let points = () for i in range(n) { let x = top.at(0) * calc.cos(2*calc.pi*i/n) - top.at(1) * calc.sin(2*calc.pi*i/n) let y = top.at(0) * calc.sin(2*calc.pi*i/n) + top.at(1) * calc.cos(2*calc.pi*i/n) points.push((x, y)) } return polygon(points, centre: centre, show-vertices: show-vertices, color: color, ..other) } = Introduction #notation[ Let $I = [0, 1]$. ] #definition[ *Closed $n$-disc* is $ D^n := {vd(x) in RR^n: norm(x) <= 1} $ ] #definition[ *Open $n$-disc* is $ E^n := {vd(x) in RR^n: norm(x) < 1} $ ] #definition[ *$n$-sphere* is $ S^n := {vd(x) in RR^(n + 1): norm(x) = 1} $ ] #definition[ *Cylinder* is $S^1 times I$. ] #definition[ The *$2$-torus (torus)* can be defined as $TT := S^1 times S^1$ or $TT := (I times I) \/ tilde$ where $ forall x in I, (x, 0) tilde (x, 1), quad forall y in I, (0, y) tilde (1, y) $ ] #definition[ *Klein bottle* is given by $KK := (I times I) \/ tilde$ where $ forall x in I, (x, 0) tilde (x, 1), quad forall y in I, (0, y) tilde (1, 1 - y) $ ] #definition[ *Map* is continuous $f: X -> Y$ where $X, Y$ are topological spaces. ] = Simplicial complexes == Simplicial complexes and triangulations #definition[ Let $v_0, ..., v_n in RR^N$, $n <= N$. - $v_0, ..., v_n$ are in *general position* if ${v_1 - v_0, ..., v_n - v_0}$ are linearly independent. - *Convex hull* of $v_0, ..., v_n$ is set of all *convex linear combinations* of $v_0, ..., v_n$: $ ideal(v_0, ..., v_n) := {sum_(i = 0)^n lambda_i v_i: sum_(i = 0)^n lambda_i = 1, forall i in {0, ..., n}, lambda_i >= 0 } $ - An *$n$-simplex*, $sigma^n = ideal(v_0, ..., v_n)$, is convex hull of $v_0, ..., v_n$ in general position. The *vertices* $v_0, ..., v_n$ *span* $sigma^n$ and $sigma^n$ is *$n$-dimensional*. ] #example[ - $0$-simplex is a point. - $1$-simplex is a closed line segment. - $2$-simplex is closed triangle including its interior. - $3$-simplex is closed tetrahedron including its interior. ] #definition[ If $sigma^n = ideal(v_0, ..., v_n)$ is $n$-simplex and ${i_0, ..., i_r} subset.eq {0, ..., n}$, then $ideal(v_(i_0), ..., v_(i_r))$ is $r$-simplex and $ideal(v_(i_0), ..., v_(i_r)) subset.eq sigma^n$. Any such sub-simplex is called *$r$-face* of $sigma^n$. A *proper face* is an $(n - 1)$-face. The *$i$th face* of $sigma^n$ is the $(n - 1)$-simplex $ideal(v_0, ..., v_(i - 1), v_(i + 1), ..., v_n)$. ] #definition[ A *finite simplicial complex* $K subset RR^N$ is finite union of simplices in $RR^N$ such that - If $sigma^n$ is simplex in $K$ and $tau^r$ is $r$-face of $sigma^n$, then $tau^r$ is simplex in $K$. - If $sigma_1^n$ and $sigma_2^m$ are simplices in $K$ with $sigma_1^n sect sigma_2^m != nothing$, then there exists $r in {0, ..., min(n, m)}$ and $r$-simplex $tau^r$ in $K$ such that $tau^r$ is $r$-face of both $sigma_1^n$ and $sigma_2^m$ and $sigma_1^n sect sigma_2^m = tau^r$. *Dimension* of $K$ is maximum value of $n$ for which there is an $n$-simplex in $K$. ] #remark[ A finite simplicial complex $K subset RR^N$ is a topological space when equipped with subspace topology from $RR^N$. ] #remark[ Second condition implies that two simplices can meet in at most one common face (this is important when considering quotient topologies and identifying edges with each other). It also implies that any set of $n$ vertices defines either only one or no $n$-simplices in $K$. ] #definition[ *Triangulation* of topological space $X$ is homeomorphism $h: X -> K$ for some finite simplicial complex $K$. We say $K$ *triangulates* $X$. $X$ is *triangulable* if it has at least one triangulation. ] #remark[ If a triangulation exists, it is not unique. ] #example[ The black and blue figures are simplicial complexes that triangulate $S^1$: #canvas(length: 2cm, { ngon(3, radius: 0.7, stroke: 1.5pt) ngon(4, radius: 0.7, centre: (3, 0), color: blue) }) ] == Simplicial maps #definition[ A map $f: K -> L$ between finite simplicial complexes $K$ and $L$ is *simplicial* if - For every vertex $v$ of $K$, $f(v)$ is a vertex of $L$. - If $sigma = ideal(v_0, ..., v_n)$ is simplex $sigma$ in $K$, $f(sigma)$ is simplex of $L$ with vertices $f(v_0), ..., f(v_n)$, where map $f|_sigma$ is defined linearly as $ f(sum_(i = 0)^n lambda_i v_i) = sum_(i = 0)^n lambda_i f(v_i) $ ] #remark[ Vertices $f(v_0), ..., f(v_n)$ of simplex $f(sigma)$ may not be distinct, so $f(sigma)$ may be simplex of lower dimension than $sigma$. ] #remark[ For triangulations $h_X: X -> K_X$ and $h_Y: Y -> K_Y$ of topological spaces $X$ and $Y$, a simplicial map $f: K_X -> K_Y$ induces a map $F: X -> Y$ by $F = h_Y^(-1) compose f compose h_X$. ] #example[ $F: S^1 -> S^1$, $F(e^(i pi t)) = e^(2 i pi t)$ is the *2 times* map. Let $f: K_1 -> K_2$, $f(v_i) = w_(i mod 3)$, $f$ is simplicial map. Then $F$ is induced by $f$, where $K_1$ and $K_2$ are as below: #canvas(length: 2cm, { ngon(6, centre: (0, 0), labels: ($v_0$, $v_1$, $v_2$, $v_3$, $v_4$, $v_5$)) ngon(3, centre: (3, 0), labels: ($w_0$, $w_1$, $w_2$)) }) ] == Barycentric subdivision and simplicial approximation #definition[ *Barycentre* of $sigma^k = ideal(v_0, ..., v_k) subset RR^N$ is $ overline(sigma^k) = 1/(k + 1) (v_0 + dots.h.c + v_k) in RR^N $ ] #example[ - Barycentre of $0$-simplex is itself. - Barycentre of $1$-simplex is midpoint of the line. // #canvas(length: 2cm, { // ngon(3, centre: (0, 0)) // cetz.draw.circle((0, 0), radius: 0.05, stroke: none, fill: red) // }) ] #definition[ Let $K subset RR^N$ be finite simplicial complex. *First barycentric subdivision* of $K$ is the simplicial complex $K^((1))$ such that: - The vertices of $K^((1))$ are the barycentres $overline(sigma^k)$ for every simplex $sigma^k$ in $K$. - The vertices $overline(sigma^(k_0)), ..., overline(sigma^(k_m)) in K^((1))$ span an $m$-simplex in $K^((1))$ if the original simplices $sigma^(k_0), ..., sigma^(k_m)$ in $K$ are (up to relabelling) strictly nested: $ sigma^(k_0) lt.curly dots.h.c lt.curly sigma^(k_m) $ where $sigma^i lt.curly sigma^j$ iff $sigma^i$ is $i$-face of $sigma^j$ with $i < j$ (thus $k_0 < dots.h.c < k_m$). ] #definition[ The $r$th barycentric subdivision of $K$ is defined inductively for $r > 1$ by $K^((r)) := (K^((r - 1)))^((1))$. ] #proposition[ Let $K$ be finite simplicial complex. - If $K$ is triangulation of topological space $X$, then so is $K^((r))$ for all $r in NN$. - Each simplex in $K^((1))$ is contained in a simplex of $K$. - If $dim(K) = n$, then length of longest $1$-simplex in $K^((1))$ is at most $n\/(n + 1)$ times length of longest $1$-simplex in $K$. ] #theorem(name: "Simplicial approximation theorem")[ For each $i in {1, 2}$, let $h_i: X_i -> K_i$ be triangulation of topological space $X_i$ by finite simplicial complex $K_i$. Let $f: X_1 -> X_2$ be map. Then $forall epsilon > 0$ there exist $n, m in NN$ and a simplicial map $s: K_1^((n)) -> K_2^((m))$ such that for $F := h_2 compose f compose h_1^(-1)$, $ s tilde.eq F quad "and" quad forall x in K_1, quad |F(x) - s(x)| < epsilon $ ] = Surfaces == Surfaces #definition[ Let $S$ be Hausdorff, compact, connected topological space. - $S$ is *surface* if for all $x in S$, there exists $U subset.eq S$ such that $x in U$ and $U tilde.equiv E^2$ or $U tilde.equiv E^2 sect (RR times RR_(>=0)) =: E^2 sect RR_+^2$. - *Boundary* of $S$, $diff S$, is set of all $x in S$ such that there is not a $U subset.eq S$ with $x in U$ and $U tilde.equiv E^2$. - *Interior* of $S$ is $"int"(S) := S - diff S$. - $S$ is *closed surface* if $diff S = emptyset$ ($S$ is *locally Euclidean of dimension 2*). - $S$ is *surface with boundary* if $diff S != emptyset$. Surface with boundary is closed surface from which interiors of finite number of pairwise disjoint closed discs have been removed. ] #definition[ Let $K$ be finite simplicial complex, $x in K$. *Open star* of $x$ in $K$, $"St"(x, K)$, is union of ${x}$ and interiors of all simplices containing $x$. ] #example[ Let $K$ be 2d finite simplicial complex, $x in K$. - If there exists a $2$-simplex $sigma^2 subset.eq K$ such that $x in "int"(sigma^2)$, then $St(x, K) = int(sigma^2) tilde.equiv E^2$. - If there exists a $1$-simplex $sigma^1 subset.eq K$ such that $x in int(sigma^1)$, then $ St(x, K) = int(sigma^1) union {int(sigma^2): sigma^1 "is face of" sigma^2 subset.eq K, sigma^2 "is 2-simplex"} $ Here, $St(x, K) tilde.equiv E^2$ iff there are exactly two $2$-simplices meeting along $sigma^1$. - If $x in K$ is vertex, then $ St(x, K) = {x} & union {int(sigma^1): x "vertex of" sigma^1 subset.eq K, sigma^1 "is 1-simplex"} \ & union {int(sigma^2): x "vertex of" sigma^2 subset.eq K, sigma^2 "is 2-simplex"} $ Here $St(x, K) tilde.equiv E^2$ iff $x$ is vertex of $n >= 3$ $2$-simplices, and along any of its edges containing $x$, each of these $2$-simplices meets precisely one other $2$-simplex (from the remaining $n - 1$). ] #lemma[ Let $M$ be topological space triangulated by connected, finite simplicial complex $K$. Then $M$ is closed surface iff $ forall x in K, quad St(x, K) tilde.equiv E^2 $ and the ways that this can happen are as listed above, with exactly two $2$-simplices meeting along each $1$-simplex. ] #remark[ If $h: M -> K$ is triangulation of topological space $M$ and $dim(K) != 2$, then $M$ is not closed surface. It is enough to check the open star condition (in above example) at all vertices of $K$: if there is $x in K$ such that $St(x, K) tilde.equiv.not E^2$, then there exists vertex $v$ of $K$ such that $St(v, K) tilde.equiv.not E^2$. ] #corollary[ Let $X$ topological space, triangulated by connected finite simplicial complex $K$, $dim(K) = 2$. Then $X$ is closed surface iff for every vertex $v in K$, $St(v, K) tilde.equiv E^2$. ] #remark[ This means $X$ is closed surface if open star of every vertex of triangulation of $X$ is homeomorphic to union of two copies of $E^2 sect RR_+^2$ glued along the parts of their boundaries that are contained in $E^2 sect RR_+^2$. ] #remark[ If we remove an edge from the open star of a vertex, and this produces a disjoint union of open sets, the original space cannot be a surface, since removing a segment from $E^2$ yields a connected space and removing a segment from $E^2 sect RR_+^2$ yields either a connected space or a disjoint union of two non-open sets. ] #definition[ *Real projective plane* is closed surface arising from identifying the edges of the unit square with the following: $ PP := (I times I)\/tilde, quad (x, 0) tilde (1 - x, 1), quad (0, y) tilde (1, 1 - y) $ It may also be defined as quotient of $S^2$ by identifying diametrically opposite points: $ PP = S^2 \/ tilde, quad forall x in S^2, quad x tilde -x $ ] == Orientations on surfaces #definition[ An *orientation on $RR^2$* is choice of direction in which to travserse circles around the origin. There are exactly two choices. ] #definition[ *Simple closed curve* in topological space is subspace homeomorphic to circle, i.e. connected curve with no self-intersections and ends where it begins. ] #definition[ Surface $S$ is *orientable* if for all $x in int(S)$, any choice of local orientation at $x$ is preserved after translation along any simple closed curve in $int(S)$ containing $x$. $S$ is *non-orientable* if there exists $x in int(S)$ and simple closed curve $C subset.eq int(S)$ through $x$ such that translation along $C$ reverses any choice of local orientation at $x$. Every surface is either orientable or non-orientable. ] #remark[ Orientability or non-orientability respectively correspond to the surface having two sides or one side. ] #example[ $S^2, TT$ are orientable. Mobius band and Klein bottle are non-orientable. ] #lemma[ $S$ is non-orientable iff it contains subspace homeomorphic to Mobius band. ] #theorem[ Let $S_1, S_2$ be homeomorphic surfaces. $S_1$ is orientable iff $S_2$ is orientable. ] #remark[ $2$-simplex can be given orientation by drawing a direction around it (anticlockwise or clockwise) or by drawing direction around its boundary. A $2$-simplex can be oriented in 2 ways, which can be represented by ordering of the vertices: $ideal(v_0, v_1, v_2)$, $ideal(v_1, v_2, v_0)$ and $ideal(v_2, v_0, v_1)$ represent same orientation, $ideal(v_1, v_0, v_2)$ represents different orientation. ] #definition[ Let $K$ finite simplicial complex that triangulates surface $S$ such that all $2$-simplices in $K$ are oriented. - The orientations of two $2$-simplices in $K$ which share an edge are *compatible* if they induce opposite orientations on the shared edge. - $K$ is *$Delta$-orientable* if there exists choice of orientations on its $2$-simplices such that any two $2$-simplices which share an edge have compatible orientations. Such a choice, if it exists, is a *$Delta$-orientation* on $K$. ] #theorem[ Surface is orientable iff one (and so every) finite simplicial complex which triangulates it is $Delta$-orientable. ] == Constructions on surfaces #definition[ For surfaces $S_1, S_2$, their *connected sum*, $S_1 \# S_2$, is obtained by removing the interiors of one small open disc from interior of each surface, and identifying the two newly formed boundary circles. If $S_1, S_2$ oriented, directions around the boundary circles induced by the respective orientations must be identified such that the directions are opposite to each other. Then $S_1 \# S_2$ inherits an orientation which agrees (upon restriction) with those of the original surfaces $S_1$ and $S_2$. ] #proposition[ - Since $S_1$, $S_2$ connected, it does not matter which two open discs are removed, the result is the same up to homeomorphism. - $\#$ is commutative and associative. - $S^2$ is the identity for $\#$ operation: $M \# S^2 tilde.equiv M$. ] #definition[ For $g in NN_0$, *closed orientable surface of genus $g$ ($g$-holed torus)* is $ M_g = S^2 \# underbrace(T \# dots.h.c \# T, g "times") $ ] #example[ The Klein bottle is given by $KK tilde.equiv PP \# PP$. ] #definition[ *Adding handle* to surface $S$ is as follows: remove two open discs from $S$. Attach the ends of cylinder $S^1 times I$ to the resulting boundary circles. If $S$ (and cylinder) are oriented, require that the two resulting boundary circles are glued to those of the cylinder with opposite orientations, which ensures the new surface is still oriented. But if $S$ is not orientable, this doesn't matter, as all possible results are homeomorphic. ] #example[ - $S^2$ with handle added is homeomorphic to the torus. - $S^2$ with $g$ handles added is homeomorphic to $M_g$. - $M_n$ with handle added is homeomorphic to $M_(n + 1)$. ] #definition[ *Attaching a cross cap (Mobius band)* to surface $S$ is as follows: remove open disc from $S$, and identify resulting boundary circle with boundary circle of Mobius band. Attaching a cross-cap always makes the surface non-orientable. ] #example[ Adding cross-cap to $S^2$ gives real projective plane $PP$. ] #remark[ Connected sums of surfaces, surfaces with handles and surfaces with cross caps are always surfaces. ] = Homotopy and the fundamental group == Homotopy #definition[ The *stereographic projection* is the bijection $ phi: S^n - (0, ..., 0, 1) -> RR^n, quad (y_1, ..., y_(n + 1)) |-> (y_1/(1 - y_(n + 1)), ..., y_n/(1 - y_(n + 1))) $ ] #definition[ Let $X, Y$ topological spaces. *Homotopy* between maps $f: X -> Y$ and $g: X -> Y$ is map $H: X times [0, 1] -> Y$ with $ forall x in X, quad H(x, 0) = f(x) and H(x, 1) = g(x) $ $f$ and $g$ are *homotopic*, $f tilde.eq g$, if there is a homotopy between them. We can think of homotopy as "path of maps" starting at $f: X -> Y$ and ending at $g: X -> Y$: for $t in [0, 1]$, define $h_t: X -> Y$, $h_t (x) = H(x, t)$, which varies continuously from $f$ at $t = 0$ to $g$ at $t = 1$. ] #example[ Let $f, g: RR -> RR$ maps, then $ H: RR times [0, 1] -> RR, quad (x, t) |-> (1 - t) f(x) + t g(x) $ is homotopy between $f$ and $g$. ] #import "@preview/cetz:0.2.0": canvas, plot #let f(x) = (x - 2) * (x - 1) * (x + 3) #let g(x) = -(x + 3) * (x - 0.5) * (x - 2.5) + 10 #figure(canvas(length: 1cm, { plot.plot( axis-style: "school-book", size: (12, 6), x-tick-step: none, // x-ticks: ((-2, $-2$), (4, $4$)), y-tick-step: none, // y-ticks: ((2, $2$), (-4, $-4$)), {plot.add( style: (stroke: red + 2pt), domain: (-3, 3), x => f(x), // mark: "o", label: $ f(x) $ ) plot.add( style: (stroke: blue + 2pt), domain: (-3, 3), x => g(x), label: $ g(x) $ ) plot.add( style: (stroke: color.mix((red, 30%), (blue, 70%)) + 2pt), domain: (-3, 3), x => f(x) * (1 - 0.7) + g(x) * 0.7, label: $ 0.3 f(x) + 0.7 g(x) $ ) plot.add( style: (stroke: color.mix((red, 80%), (blue, 20%)) + 2pt), domain: (-3, 3), x => f(x) * (1 - 0.2) + g(x) * 0.2, label: $ 0.8 f(x) + 0.2 g(x) $ )} ) })) #example[ Consider $S^1 subset CC$, so $S^1 = {e^(i pi s): s in [0, 2)}$. Let $a: S^1 -> S^1$ be the *antipodal map*, $a(e^(i pi s)) = -e^(i pi s)$. Then $a tilde.eq id$, with homotopy given by $H: S^1 times I -> S^1$, $H(e^(i pi s)) = e^(i pi (s + t))$. ] #lemma[ Homotopy is equivalence relation between maps. ] #definition[ Map $f: X -> Y$ is *null homotopic* if it is homotopic to a constant map, i.e. to map $c: X -> Y$ with $c(x) = y_0$, $y_0 in Y$ fixed. ] #example[ Identity map $id_(D^2): D^2 -> D^2$ is null homotopic: let $c: D^2 -> D^2$, $c(x) = 0$. Consider $H: D^2 times [0, 1] -> D^2$, $H(x, t) = (1 - t)x$, then $H$ is homotopy between $id_(D^2)$ and $c$, since $H$ is continuous and $H(x, 0) = x = id_(D^2)(x)$, $H(x, 1) = 0 = c(x)$. ] #definition[ Map $f: X -> Y$ is *homotopy equivalence* if there exists a map $g: Y -> X$ (a *homotopy inverse*) such that $g compose f tilde.eq id_X$ and $f compose g tilde.eq id_Y$. $X$ and $Y$ are *homotopy equivalent*, $X tilde.eq Y$ if there exists homotopy equivalence between them. If $X tilde.eq Y$, we say they have the same *homotopy type*. ] #theorem[ Homotopy equivalence is equivalence relation on topological spaces. ] #example[ Let $P = {vd(p)}$ be the one point space, then $D^2 tilde.eq P$: let $f: D^2 -> P$, $f(x) = vd(p)$, $g: P -> D^2$, $g(vd(p)) = 0$. Then $f compose g = id_P tilde.eq id_P$. Now $forall x in D^2$, $(g compose f) (x) = 0$ so $g compose f tilde.eq id_(D^2)$ as $g compose f$ is constant map. ] #definition[ Topological space $X$ is *contractible* if it is homotopy equivalent to a one-point space. ] #example[ Let $X$ topological space. The *cone on $X$* is $ C X = (X times [0, 1])\/tilde $ where $tilde$ identifies all points of the form $(x, 0)$ with each other, i.e. it collapses the end $X times {0}$ to a single point. We have $D^n tilde.equiv C S^(n - 1)$. ] #proposition[ For all topological spaces $X$, the cone $C X$ is contractible. ] #example[ For a finite simplicial complex $K subset RR^N$, $C K subset RR^(N + 1)$ has vertices equal to vertices of $K$ together with $P = (0, ..., 0, 1) in RR^(N + 1)$. Simplices in $C K$ of dimension $>= 1$ are those in $K$ together with all simplices $ideal(v_0, ..., v_r, P)$ where $ideal(v_0, ..., v_r)$ is simplex in $K$. ] #lemma[ Every contractible space is path connected. ] #lemma[ If $X$ and $Y$ are homeomorphic, they are homotopy equivalent (converse does not hold). ] #definition[ - It is useful to assume that every topological space $X$ has a particular distinguished *base point* $x_0 in X$. - We then require that all maps and homotopies between spaces map base points to base points. - The pair $(X, x_0)$ is a *based space*. - If $K$ is finite simplicial complex and $v_0$ is vertex of $K$, then $(K, v_0)$ is *pointed*. - A *based map* $f: (X, x_0) -> (Y, y_0)$ is a map $X -> Y$ and satisfies $f(x_0) = y_0$. - A *based homotopy* $H: (X, x_0) times [0, 1] -> (Y, y_0)$ between based maps $f, g: (X, x_0) -> (Y, y_0)$ is homotopy $H: X times [0, 1] -> Y$ with $forall t in [0, 1]$, $H(x_0, t) = y_0$. - All results shown for homotopies are true for based homotopies. ] == The fundamental group #remark[ We consider circle $S^1$ as unit circle in $CC$ and give it base point $1$. ] #definition[ A *loop* in based space $(X, x_0)$ is based map $ lambda: (S^1, 1) -> (X, x_0) $ Equivalently, a loop in $(X, x_0)$ is path in $X$ beginning and ending at $x_0$: $ lambda: [0, 1] -> (X, x_0), quad lambda(0) = lambda(1) = x_0 $ Two loops $lambda, mu: [0, 1] -> (X, x_0)$ are homotopic if there exists based homotopy between them, i.e. if there is map $ & H: [0, 1] times [0, 1] -> X, \ forall s in I, quad & H(s, 0) = lambda(s), \ forall s in I, quad & H(s, 1) = mu(s), \ forall t in I, quad & H(0, t) = H(1, t) = x_0 $ This corresponds with $lambda$ being continuously deformed into $mu$. ] #remark[ It is useful to represent based homotopy $H$ between $lambda$ and $mu$ on the unit square. Bottom edge corresponds to $lambda$, top edge corresponds to $mu$, right and left edges are mapped entirely to $x_0$. Horizontal line drawn across unit square represents loop in $(X, x_0)$ and homotopy $H$ describes path of loops from $lambda$ to $mu$. Vertical line describes path traced from $lambda(s)$ to $mu(s)$ under $H$. ] #figure(canvas(length: 2cm, { import cetz.draw: * cetz.draw.rect((0, 0), (1, 1), name: "my-rect") set-style(mark: (end: ">")) line((0, 0), (1/2 + 0.1, 0)) line((0, 1), (1/2 + 0.1, 1)) content("my-rect.center", box(fill: white)[$H$], anchor: "center") content("my-rect.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("my-rect.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") content("my-rect.north", padding: -1.2em, box(fill: white)[$lambda$], anchor: "north") content("my-rect.south", padding: -1.2em, box(fill: white)[$mu$], anchor: "south") })) #definition[ *Homotopy class* of loop $lambda$ in $(X, x_0)$ is $ [lambda] := {mu: mu "loop in" (X, x_0), mu tilde.eq lambda} $ *Fundamental group* of $(X, x_0)$ is set of homotopy classes of loops in $(X, x_0)$: $ pi_1 (X, x_0) := {[lambda]: lambda "loop in" (X, x_0)} $ with group operation $*$ defined by $ *: pi_1 (X, x_0) times pi_1 (X, x_0) & -> pi_1 (X, x_0), \ ([lambda_1], [lambda_2]) -> [lambda_1 * lambda_2] $ where *concatenation (product)* of $lambda_1$ and $lambda_2$ is the loop in $(X, x_0)$ given by $ lambda_1 * lambda_2: [0, 1] & -> X, \ s & |-> cases(lambda_1 (2s) & "if" 0 <= s <= 1/2, lambda_2 (2s - 1) & "if" 1/2 <= s <= 1) $ Group identity is $e: [0, 1] -> X$, $e(s) = x_0$, inverse of loop $lambda$ is $overline(lambda): s |-> lambda(1 - s)$, then $[overline(lambda)] = [lambda]^(-1)$ (equivalently, define $[lambda]^(-1) = [lambda compose w]$ where $w: [0, 1] -> [0, 1]$, $w(s) = 1 - s$). ] #remark[ Group operation $*$ is well defined, since if $lambda_1 tilde.eq mu_1$ by homotopy $H_1$, $lambda_2 tilde.eq mu_2$ by homotopy $H_2$, then $lambda_1 * lambda_2 tilde.eq mu_1 * mu_2$ by homotopy $H$ where $ H(s, t) = cases(H_1 (2s, t) & "if" 0 <= s <= 1/2, H_2 (2s - 1, t) & "if" 1/2 <= s <= 1) $ ] #figure(canvas(length: 2cm, { import cetz.draw: * cetz.draw.rect((0, 0), (1, 1), name: "H_1") cetz.draw.rect((2, 0), (3, 1), name: "H_2") cetz.draw.rect((4, 0), (4.5, 1), name: "H") cetz.draw.rect((4.5, 0), (5, 1), name: "I") set-style(mark: (end: ">")) line((0, 0), (1/2 + 0.1, 0)) line((0, 1), (1/2 + 0.1, 1)) line((2, 0), (2 + 1/2 + 0.1, 0)) line((2, 1), (2 + 1/2 + 0.1, 1)) line((4, 0), (4 + 1/4 + 0.1, 0)) line((4, 1), (4 + 1/4 + 0.1, 1)) line((4.5, 0), (4.5 + 1/4 + 0.1, 0)) line((4.5, 1), (4.5 + 1/4 + 0.1, 1)) content("H_1.center", box(fill: white)[$H_1$], anchor: "center") content("H_1.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("H_1.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") content("H_1.north", padding: -1.2em, box(fill: white)[$lambda_1$], anchor: "north") content("H_1.south", padding: -1.2em, box(fill: white)[$mu_1$], anchor: "south") content("H_2.center", box(fill: white)[$H_2$], anchor: "center") content("H_2.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("H_2.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") content("H_2.north", padding: -1.2em, box(fill: white)[$lambda_2$], anchor: "north") content("H_2.south", padding: -1.2em, box(fill: white)[$mu_2$], anchor: "south") content("H.center", box(fill: white)[$H_1$], anchor: "center") content("H.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("H.north", padding: -1.2em, box(fill: white)[$lambda_1$], anchor: "north") content("H.south", padding: -1.2em, box(fill: white)[$mu_1$], anchor: "south") content("I.center", box(fill: white)[$H_2$], anchor: "center") content("I.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") content("I.north", padding: -1.2em, box(fill: white)[$lambda_2$], anchor: "north") content("I.south", padding: -1.2em, box(fill: white)[$mu_2$], anchor: "south") })) Associativity between $(lambda * mu) * kappa$ and $(lambda * (mu * kappa))$ is shown by homotopy diagram with $(lambda * mu) * kappa$ at bottom and $lambda * (mu * kappa)$ at top. At any intermediate time, path traverses $lambda$ at between 2 and 4 times speed, and correspondingly adjusts speed of $kappa$ to finish path at $t = 1$. $mu$ is traversed at 4 times speed at all times. #figure(canvas(length: 3cm, { import cetz.draw: * cetz.draw.rect((0, 0), (1, 1), name: "my-rect") line((1/4, 0), (1/2, 1)) line((1/2, 0), (3/4, 1)) set-style(mark: (end: ">")) line((0, 0), (1/8 + 0.07, 0), name: "l1") line((0, 1), (1/4 + 0.07, 1), name: "l2") line((1/4, 0), (1/4 + 1/8 + 0.07, 0), name: "l3") line((1/2, 1), (1/2 + 1/8 + 0.07, 1), name: "l4") line((1/2, 0), (1/2 + 1/4 + 0.07, 0), name: "l5") line((3/4, 1), (3/4 + 1/8 + 0.07, 1), name: "l6") content("l1.end", padding: 0.4em, box(fill: white)[$lambda$], anchor: "north-east") content("l2.end", padding: 0.4em, box(fill: white)[$lambda$], anchor: "south-east") content("l3.end", padding: 0.4em, box(fill: white)[$mu$], anchor: "north-east") content("l4.end", padding: 0.4em, box(fill: white)[$mu$], anchor: "south-east") content("l5.end", padding: 0.4em, box(fill: white)[$kappa$], anchor: "north-east") content("l6.end", padding: 0.4em, box(fill: white)[$kappa$], anchor: "south-east") content("my-rect.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("my-rect.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") })) Can show identity $e(s) = x_0$ satisfies $[lambda] * [e] = [e] * [lambda] = [lambda]$ with diagrams #figure(canvas(length: 3cm, { import cetz.draw: * rect((0, 0), (1, 1), name: "el") rect((2, 0), (3, 1), name: "le") line((1/2, 0), (1, 1)) line((2 + 1/2, 0), (2, 1)) set-style(mark: (end: ">")) line((0, 0), (1/4 + 0.07, 0), name: "l1") line((0, 0), (3/4 + 0.07, 0), name: "l2") line((0, 1), (1/2 + 0.07, 1)) line((2, 0), (2 + 1/4 + 0.07, 0), name: "l3") line((2, 0), (2 + 3/4 + 0.07, 0), name: "l4") line((2, 1), (2 + 1/2 + 0.07, 1)) content("l1.end", padding: 0.4em, box(fill: white)[$lambda$], anchor: "north-east") content("l2.end", padding: 0.4em, box(fill: white)[$e$], anchor: "north-east") content("l3.end", padding: 0.4em, box(fill: white)[$e$], anchor: "north-east") content("l4.end", padding: 0.4em, box(fill: white)[$lambda$], anchor: "north-east") content("el.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("el.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") content("el.north", padding: -1.2em, box(fill: white)[$lambda$], anchor: "north") content("le.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("le.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") content("le.north", padding: -1.2em, box(fill: white)[$lambda$], anchor: "north") })) Can show that $[lambda] * \[overline(lambda)\] = \[overline(lambda)\] * [lambda] = e$ by #figure(canvas(length: 3cm, { import cetz.draw: * rect((0, 0), (1, 1), name: "el") rect((2, 0), (3, 1), name: "le") line((1/2, 0), (1, 1)) line((1/2, 0), (0, 1)) line((2 + 1/2, 0), (2, 1)) line((2 + 1/2, 0), (3, 1)) set-style(mark: (end: ">")) line((0, 0), (1/4 + 0.07, 0), name: "l1") line((0, 0), (3/4 + 0.07, 0), name: "l2") line((0, 1), (1/2 + 0.07, 1)) line((2, 0), (2 + 1/4 + 0.07, 0), name: "l3") line((2, 0), (2 + 3/4 + 0.07, 0), name: "l4") line((2, 1), (2 + 1/2 + 0.07, 1)) content("l1.end", padding: 0.4em, box(fill: white)[$lambda$], anchor: "north-east") content("l2.end", padding: 0.4em, box(fill: white)[$overline(lambda)$], anchor: "north-east") content("l3.end", padding: 0.4em, box(fill: white)[$overline(lambda)$], anchor: "north-east") content("l4.end", padding: 0.4em, box(fill: white)[$lambda$], anchor: "north-east") content("el.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("el.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") content("el.north", padding: -1.2em, box(fill: white)[$e$], anchor: "north") content("le.west", padding: -1.2em, box(fill: white)[$x_0$], anchor: "west") content("le.east", padding: -1.2em, box(fill: white)[$x_0$], anchor: "east") content("le.north", padding: -1.2em, box(fill: white)[$e$], anchor: "north") })) where, for the first diagram, a horizontal path at fixed $t$ is given by $ s |-> cases(lambda(2s) & "if" 0 <= s <= (1 - t)/2, lambda(1 - t) & "if" (1 - t)/2 <= s <= (1 + t)/2, overline(lambda)(2s - 1) & "if" (1 + t)/2 <= s <= 1) $ #definition[ Let $f: (X, x_0) -> (Y, y_0)$ based map. Define a function $ f_*: pi_1 (X, x_0) -> pi_1 (Y, y_0), quad f_* ([lambda]) := [f compose lambda] $ ] #lemma[ $f_*: pi_1 (X, x_0) -> pi_1 (Y, y_0)$ is well-defined and group homomorphism. ] #proof[ - Well-defined: show that $lambda_1 tilde.eq lambda_2 ==> f compose lambda_1 tilde.eq f compose lambda_2$ (use definition of $lambda_1 tilde.eq lambda_2$). - Homomorphism: use that $f compose (lambda * mu) = (f compose lambda) * (f compose mu)$. ] #lemma[ Let $f, g: (X, x_0) -> (Y, y_0)$ based maps, $f tilde.eq g$ ($f$ and $g$ are based homotopic), then $f_* = g_*$. ] #proof[ For loop $lambda$ in $(X, x_0)$, find based homotopy between $f compose lambda$ and $g compose lambda$ in terms of based homotopy $H$ between $f$ and $g$. ] #lemma[ The operation of passing from based map $f$ to induced homomorphism $f_*$ preserves/respects composition and the identity, i.e. if we have $ (X, x_0) limits(-->)^f (Y, y_0) limits(-->)^g (Z, z_0) $ then $(g compose f)_* = g_* compose f_*$ and $(id_X)_* = id_(pi_1 (X, x_0))$. ]<induced-homo-preserves-composition-identity> #proof[ Straightforward, just use the definition of $f_*$. ] #corollary[ Fundamental group is homotopy-invariant: if $(X, x_0)$, $(Y, y_0)$ are homotopy equivalent, then $ pi_1 (X, x_0) tilde.equiv pi_1 (Y, y_0) $ ] #proof[ Use definition of homotopy equivalent based spaces and above lemma, to show the induced homomorphisms of the homotopy equivalences are inverse to each other. ] #theorem[ Let $X$ path-connected space, $x_0, x_1 in X$. Then $ pi_1 (X, x_0) tilde.equiv pi_1 (X, x_1) $ ] #proof[ - There is path $p$ from $x_0$ to $x_1$. - Let $lambda$ loop in $X$ based at $x_0$. - Define $overline(p)(s) = p(1 - s)$, define loop $lambda_p$ in $X$ based at $x_1$ by $ lambda_p (s) = cases(overline(p(3s)) & "if" s in [0, 1\/3], lambda(3s - 1) & "if" s in [1\/3, 2\/3], p(3s - 2) & "if" s in [2\/3, 1]) $ - Claim: $ Phi_p: pi_1 (X, x_0) -> pi_1 (X, x_1), quad Phi_p ([lambda]) = [lambda_p] $ is isomorphism. - Well-defined: show if $lambda, mu$ loops based at $x_0$, $lambda tilde.eq mu ==> lambda_p tilde.eq mu_p$ by homotopy diagram (merge $overline(p), lambda, p$ on bottom and $overline(p), mu, p$ on top). - Homomorphism: show $(lambda times mu)_p tilde.eq lambda_p * mu_p$ using homotopy diagram (for each $t in [0, 1]$, we want to partially traverse $p$ (until $s = 1/2$) then back along $overline(p)$, before traversing $mu$). - Isomorphism: show that $Phi_(overline(p))$ defined analogously satisfies $Phi_(overline(p)) = \(Phi_p\)^(-1)$, i.e. $\(lambda_p\)_(overline(p)) tilde.eq lambda$ and $\(mu_(overline(p))\)_p tilde.eq mu$ for all loops $lambda$ based at $x_0$, $mu$ based at $x_1$. (As $t -> 1$, want to retract the spurs $p * overline(p)$ of the loop back to $x_0$). ] #notation[ Write $pi_1 (X)$ for fundamental group of path-connected space $X$ (although isomorphism between $pi_1 (X, x_0)$ and $pi_1 (X, x_1)$ is not canonical). ] #proposition[ Let $X$ contractible space, then $pi_1 (X) tilde.equiv bb(1)$, the trivial group with one element. ] #proof[ - Show we can omit based point in notation. - Reason that there is only loop in one point space. - Use definition of contractibility and above corollary. ] #definition[ Topological space $X$ is *simply connected* if path-connected and $pi_1 (X) = bb(1)$ (i.e. its fundamental group is trivial). ] #example[ - $pi_1 (S^1) tilde.equiv ZZ$ where $n in ZZ$ corresponds to homotopy class of *$n$ times* map $phi_n: S^1 -> S^1$, $phi_n (z) = z^n$. - $pi_1 (S^n) tilde.equiv bb(1)$ for all $n >= 2$. - $pi_1 (T) tilde.equiv ZZ^2$. - $pi_1 (PP) tilde.equiv ZZ\/2$. ]<fundamental-group-examples> == Brouwer's fixed point theorem #theorem[ Every map $f: D^2 -> D^2$ has a fixed point: $ exists x in D^2: f(x) = x $ ] #proof[ - Assume no fixed point, so every $x, f(x) in D^2$ defines straight line $L_x$ passing through $D^2$. - Define $g(x)$ as point of intersection of boundary and $L_x$ (the one closer to $x$ than $f(x)$). Note $g(x) = x$ if $x in diff D^2$. - Let $i: S^1 -> D^2$ be inclusion map of boundary circle to disc, then $g compose i = id_(S^1)$, and $g_* compose i_* = (g compose i)_* = id_(pi_1 (S^1))$. - Obtain contradiction using @induced-homo-preserves-composition-identity and @fundamental-group-examples. ] = Computing the fundamental group == Finitely presented groups #definition[ *Free group on $n$ letters* $x_1, ..., x_n$, $F^n = ideal(x_1, ..., x_n)$, is the group whose elements are finite words in the generators $x_1, ..., x_n$ and their formal inverses $x_1^(-1), ..., x_n^(-1)$, where the group operation $*$ is given by concatenation of words: $x_i * x_j = x_i x_j$. Identity element is the empty word $e$. We assume $forall i in [n], thick thick x_i x_i^(-1) = x_i^(-1) x_i = e$. ] #notation[ If $k in ZZ$, then define $ x_j^k = cases(e & "if" k = 0, x_j ... x_j & "if" k > 0, x_j^(-1) ... x_j^(-1) & "if" k < 0) $ ] #note[ $F^n$ is not abelian for all $n >= 2$ since e.g. $x_1 x_2 != x_2 x_1$. $forall n in NN$, $F^n$ is infinite group. ] #example[ - $F^1 = ideal(x) tilde.equiv ZZ$ since every element is of the form $x^k$, $k in ZZ$. There is isomorphism $phi: F^1 -> ZZ$ given by $phi(x) = 1$. - $F^2 = ideal(x, y) tilde.equiv.not ZZ^2 = ZZ xor ZZ$ since $x y != y x$. ] #definition[ *Finitely presented group* is group which isomorphic to a group denoted by the *group presentation* $ ideal(x_1, ..., x_n | r_1, ..., r_m) $ consisting of finite words in *generators* $x_1, ..., x_n$ and their formal inverses $x_1^(-1), ..., x_n^(-1)$, subject to *relations* $r_1, ..., r_m in F^n = ideal(x_1, ..., x_n)$ (i.e. $forall j in [m], thick thick r_j = r_j^(-1) = e$), and group operation is concatenation of words. ] #note[ - A finitely presented group is a quotient of a free group. - Free groups on $n$ letters are finitely presented (with no relations). - Group presentations are *not unique*. ] #example[ - $ideal(x, y | x y^(-1)) tilde.equiv ideal(a) = F^1 tilde.equiv ZZ$ via isomorphism $phi: ideal(x, y | x y^(-1)) -> ideal(a)$ defined by $phi(x) = phi(y) = a$ since $x y^(-1) = e <==> x = y$ so can replace every $y$ in words of $ideal(x, y | x y^(-1))$ with $x$, yielding an element of $ideal(x)$. - $ZZ\/2 tilde.equiv ideal(x | x^2)$ since $x = x^(-1)$ and $forall n in NN$, $x^(-n) = x^n = e$ if $n$ even, $x$ if $n$ odd. - $ideal(x, y | x y x^(-1) y^(-1)) tilde.equiv ZZ^2$ since $x y = y x$ so the group is abelian. Isomorphism given by $phi(x) = (1, 0)$, $phi(y) = (0, 1)$. - $ideal(x, y | x y x^(-1) y^(-1), y^2) tilde.equiv ZZ times ZZ\/2$. ] #definition[ Let $G_1, G_2$ finitely presented groups, $G_1 sect G_2 = emptyset$, given by $ G_1 = ideal(x_1, ..., x_n | r_1, ..., r_m), quad G_2 = ideal(y_1, ..., y_k | s_1, ..., s_ell) $ *Free product* of $G_1$ and $G_2$ is the finitely presented group $ G_1 * G_2 := ideal(x_1, ..., x_n, y_1, ..., y_m | r_1, ..., r_k, s_1, ..., s_ell) $ If $H$ is another group and there exist homomorphisms $i_1: H -> G_1$, $i_2: H -> G_2$, then *amalgamated product* of $G_1$ and $G_2$ with respect to $H$ is $ G_1 *_H G_2 := ideal(x_1, ..., x_n, y_1, ..., y_k | r_1, ..., r_m, s_1, ..., s_ell, i_1 (h) i_2 (h)^(-1) thick forall h in H) $ i.e. we impose the additional relations $i_1 (h) = i_2 (h)$ for all $h in H$, on $G_1 * G_2$. $G_1 *_H G_2$ is finitely presented iff $H$ is finitely generated. ] #example[ - If $H tilde.equiv bb(1)$, then $G_1 *_H G_2 = G_1 * G_2$. - If $F^n$, $F^k$ are free groups, then $F^n * F^k = F^(n + k)$. - $F^n = F^1 * dots.h.c * F^1 tilde.equiv ZZ * dots.h.c * ZZ$ (not this is $tilde.equiv.not ZZ^n$ for $n >= 2$). - If $G_1 tilde.equiv bb(1)$, then $ G_1 *_H G_2 = ideal(y_1, ..., y_k | s_1, ..., s_ell, i_2 (h) thick forall h in H) $ ] == The fundamental group of a triangulated surface #definition[ *Tree* is finite, connected graph with no cycles. ] #definition[ Let $K$ be connected, finite simplicial complex of dimension $<= 2$. - A *maximal tree* in $K$ is tree formed out of the $0$ and $1$-simplices in $K$ which cannot be extended to any larger tree (and necessarily contains all $0$-simplices). - If $L$ is maximal tree in $K$, *maximal simply connected subcomplex* $M$ of $K$ (associated to $L$) is constructed as follows: let $M_0 = L$ and for each $j in NN$, let $M_j$ be subcomplex of $K$ given by $ M_j = M_(j - 1) union {"2-simplices in" K "with two edges contained in" M_(j - 1)} $ Since $K$ is finite simplicial complex, this process must stabilise after finite number of steps. Let $M$ be final subcomplex obtained. ] #algorithm[ Let $K$ be connected, finite simplicial complex of dimension $<= 2$, let $x_0 in K$ be $0$-simplex. To compute $pi_1 (K, x_0)$: + Find a maximal tree $L$ in $K$. + Extend $L$ to maximal simply connected subcomplex $M$ of $K$. + Assign a direction and a label to each $1$-simplex in $K$ which is not contained in $M$. The labels give the generators of a group presentation for $pi_1 (K, x_0)$. + Impose relations on the labels as follows: + For $2$-simplices with exactly one edge in $M$: if the directions of the other two edges, $a$ and $b$, either both point towards or both point away from the edge in $M$, impose the relation $a = b$. If one points towards and the other away, then impose the relation $a = b^(-1)$. + For $2$-simplices with no edges in $M$ and with labels $a, b, c$: (up to permutation of $a, b, c$) if the directions of $b$ and $c$ point towards a common vertex and the directions of $a$ and $c$ point away from a common vertex, then impose the relation $c = a b$, otherwise (in this case, the directions form a cycle), if $a$ has direction pointing away from $c$ and $b$ has direction pointing towards $c$, impose $c = (a b)^(-1)$. + We have $pi_1 (K, x_0) tilde.equiv ideal("labels" | "relations")$. ] #note[ We can use step 4 to more efficiently choose labels and directions in step 3. ] #definition[ Each directed $1$-simplex in $M^c$ gives a *basic loop* (opposite choice of direction yields the inverse loop). ] #proof(name: "Proof of algorithm")[ Let $K$ be connected finite simplicial complex, $v_0$ be $0$-simplex in $K$, $L$ be maximal tree in $K$, $M$ be maximal simply connected subcomplex in $K$ associated to $L$. - Simplices are convex, so every path in $K$ is homotopic to one which passes through only $0$- and $1$-simplices (with no doubling back). In particular, every element of $pi_1 (K, v_0)$ can be represented by a loop based at $v_0$ which passes through only $0$- and $1$-simplices. - If $v$ is $0$-simplex then $v in L subset.eq M$, and $L$ has no cycles, so there exists unique path from $v$ to $v_0$ in $L$ with no doubling back. - For all $0$-simplices $v in K$, there exists unique homotopy class of paths in $M$ from $v$ to $v_0$ and this class can be represented by a unique path in $L$ that doesn't double back on itself. - Trees are contractible and so $L$ is simply connected, hence $M$ is simply connected. - Thus, if there is another path in $M$ from $v$ to $v_0$, there is a loop in $M$, which must be null-homotopic. Hence, the paths must be homotopic in $M$. - If $M^c = K - M != emptyset$, it consists of $1$- and $2$-simplices (minus points on boundaries) and every $1$-simplex in $M^c$ with a choice of direction yields a homotopically non-trivial loop in $(K, v_0)$. Each vertex of a $1$-simplex in $M^c$ can be connected back to $v_0$ by a unique (up to homotopy) path in $L$. So each directed $1$-simplex in $M^c$ gives a *basic loop* (opposite choice of direction yields the inverse loop). - Every non-trivial loop in $K$ is homotopic to a product of basic loops: - If $lambda$ is loop in $(K, v_0)$, we have $lambda tilde.eq mu$, where $mu$ is loop through only $0$- and $1$-simplices (so $mu$ consists of a sequence of directed $1$-simplices, with some in $M$ and others not). - Every time $mu$ enters/exists $M$ (necessarily at a vertex), draw a path through $L$ back to $v_0$. This shows that $mu$ is homotopic to product of basic loops. - Therefore, by assigning labels to directed $1$-simplices in $M^c$, we obtain a list of generators of $pi_1 (K, v_0)$. - Also, $2$-simplices in $M^c$ give relations between the generators of $pi_1 (K, v_0)$. - So we have surjective homomorphism $ ideal("labels of directed 1-simplices in " M^c | "2-simplex relations") --> pi_1 (K, v_0) $ and this can be shown to be injective. ] #example[ Consider $S^1$ triangulated with three $1$-simplices and no $2$-simplices. A maximal tree consists of two edges, the maximal connected subcomplex $M$ is already the maximal tree. There is one $1$-simplex not in $M$ and there are no relations (since no $2$-simplices). Hence $pi_1 (S^1, x_0) tilde.equiv ideal(a) = F^1 tilde.equiv ZZ$. ] == Van Kampen's theorem #theorem(name: "van Kampen's theorem")[ Let $(K, v_0)$ be based, connected finite simplicial complex. Suppose there exists connected simplicial subcomplexes $A, B subset.eq K$ such that: - $K = A union B$ - $A sect B$ is path-connected simplicial subcomplex. - $v_0 in A sect B$. Then $ pi_1 (K, v_0) tilde.equiv pi_1 (A, v_0) *_(pi_1 (A sect B, x_0)) pi_1 (B, x_0) $ where the homomorphisms $(i_A)_*: pi_1 (A sect B, v_0) -> pi_1 (A, v_0)$, $(i_B)_*: pi_1 (A sect B, v_0) -> pi_1 (B, v_0)$ are those induced from the respective inclusion maps $i_A: A sect B -> A$, $i_B: A sect B -> B$. ] #proof[ - Find maximal tree $L_(A sect B)$ in $A sect B$. Extend to maximal trees $L_A$ in $A$, $L_B$ in $B$. Then $L = L_A union L_B$ is maximal tree in $K$. - Extend $L_(A sect B)$, $L_A$, $L_B$ to maximal simply connected subcomplexes to $M_(A sect B)$, $M_A$, $M_B$. Then $M = M_A union M_B$ is maximal simply connected subcomplex in $K$. - By the algorithm, $pi_1 (K, v_0) tilde.equiv ideal("directed 1-simplices in" M^c | "relations from 2-simplices in" M^c)$ where $ {"directed 1-simplices in" M^c} = & D_A union D_B \ := & {"directed 1-simplices in" A - M_A} \ union & {"directed 1-simplices in" B - M_B} $ and $ {"2-simplices in" M^c} = & {"2-simplices in" A - M_A} \ union & {"2-simplices in" B - M_B} $ - However, $D_A sect D_B = {"directed 1-simplices in" (A sect B) - M_(A sect B)}$. So to avoid counting homotopy classes of twice, we identify corresponding generators in thre free product $pi_1 (A, v) * pi_1 (B, v_0)$, which gives the amalgamated product. ] #example[ Let $W_2$ be *figure 8 space* - the one-point union of two copies of $S^1$, i.e. two copies of $S^1$ joined at single point (the base point) $w_0$. So $W_2 = A union B$ where $A = B = S^1$, $A sect B = {p}$, the one-point space, is path-connected. $pi_1 ({p}, w_0) tilde.equiv bb(1)$. So $ pi_1 (W_2, w_0) & tilde.equiv pi_1 (S^1, w_0) *_(bb(1)) pi_1 (S^1, w_0) \ & = pi_1 (S^1, w_0) * pi_1 (S^1, w_0) \ & tilde.equiv ideal(x) * ideal(y) \ & = ideal(x, y) = F^2 $ ] #example[ - Decompose torus as $TT = A union B$ where $A$ is small closed disc in $TT$, $B$ is closure of the remainder (i.e. remainder together with circle boundary of the disc) so $A sect B = S^1$. - $B$ is homotopy equivalent to the figure-eight space so $pi_1 (B) tilde.equiv ideal(x, y)$. $A$ is contractible so $pi_1 (A) tilde.equiv bb(1)$, and $pi_1 (A sect B) tilde.equiv ideal(z)$. But the loop going once around $A sect B$ is homotopy equivalent to the loop going along the boundary of unit square whose quotient gives $TT$, which corresponds to $x y x^(-1) y^(-1)$. - So by van Kampen's theorem, $ pi_1 (TT) & tilde.equiv pi_1 (A) *_(pi_1 (A sect B)) pi_1 (B) \ & tilde.equiv bb(1) *_(ideal(z)) ideal(x, y) \ & = ideal(x, y | z) \ & = ideal(x, y | x y x^(-1) y^(-1)) tilde.equiv ZZ^2 $ since the image of $z$ under the homomorphism $h_1: pi_1 (A sect B) -> A$ must be $e$. ] = Euler characteristics and the classification of closed surfaces == The Euler characteristic of a graph #definition[ Let $G$ be finite graph with $v$ vertices and $e$ edges. *Euler characteristic* of $G$ is $ chi(G) := v - e $ ] #definition[ *Degree* of vertex in graph of number of edge ends with that vertex as endpoint (so degree of vertex with loop is $2$). ] #lemma[ A non-trivial finite tree contains a vertex of degree $1$. ] #lemma[ Let $G$ be finite tree, then $chi(G) = 1$. ] #proof[ Induction of number of vertices. ] #lemma[ If $G$ is finite connected graph, then $chi(G) <= 1$ with equality iff $G$ is tree. ] #proof[ Remove edges from cycles until $G$ is a tree, note what happens to Euler characteristic each time. ] #remark[ $chi(G)$ is a homotopy invariant, i.e. $G_1 tilde.eq G_2$, then $chi(G_1) = chi(G_2)$. ] #theorem(name: "Euler's Theorem")[ Let $G$ be finite, connected graph drawn on $S^2$. Then $S^2 - G$ consists of $f = 2 - chi(G)$ *faces* (connected regions homeomorphic to open discs). ] #proof[ - Assume first that $S^2 - G$ consists of $f$ connected regions homeomorphic to open discs. - If $G$ has cycle, remove edge to obtain new connected graph $G'$. This means two of the $f$ regions are joined into one region, and $chi(G') = chi(G) + 1$. Hence $chi(G') + f' = chi(G) + f$. - Remove edges until resulting graph is tree $T$. Then $S^2 - T tilde.equiv E^2$, a single connected region. Deduce that $chi(G) + f = 2$. - Assumption was correct, since if $T$ is tree then $S^2 - T$ is always homeomorphic to open disc. With reverse of above argument, every edge added to $T$ creates cycle and divides disc into two sub-discs. ] #corollary[ Let $K$ be finite simplicial complex which triangulates $S^2$, with $v$ $0$-simplices, $e$ $1$-simplices and $f$ $2$-simplices. Then $ v - e + f = 2 $ ] #proof[ Let $G = {"0-simplices"} union {"1-simplices"}$, then $G$ is finite connected graph and $S^2 - G = {"interiors of 2-simplices"}$. ] == The Euler characteristic of a surface #definition[ Let $S$ be surface. - Finite connected graph $G subset S$ is *good* if every connected component of $S - G$ is homeomorphic to an open disc. - Let $G subset S$ be a good graph. The *$G$-Euler characteristic* of $S$ is $ chi_G (S) := chi(G) + ("number of components of" S - G) $ ] #note[ - If $diff S != nothing$ and $G subset S$ is a good graph, then $diff S subset G$ as a subgraph. - Not every graph in a surface is good, e.g. if $G$ is single vertex in the torus, then $TT - G$ is homotopy equivalent to the figure $8$ space. ] #lemma[ Let $G$, $G'$ be good graphs on surface $S$, with $G$ subgraph of $G'$ ($G'$ is an *enlargement* of $G$). Then $ chi_G (S) = chi_(G')(S) $ ] #proof[ - $G'$ can be constructed from $G$ by sequence of one or more of the following operations, none of which change $chi_G (S)$: - Add new vertex to interior of existing edge. This adds one vertex, one edge, number of components in complement does not change. - Add new edge between existing vertices. Number of components in complement increases by $1$. - Add new edge and new vertex by attaching new edge at one to existing vertex and at other end to new vertex. Number of components in complement does not change. ] #theorem[ The $G$-Euler characteristic of surface $S$ does not depend on choice of good graph $G$. ] #proof[ - Let $G_1, G_2$ be good graphs on $S$. If $diff S != nothing$, consider $diff S$ as (possibly) disconnected graph with ${"vertices"} = {"all vertices in" (G_1 union G_2) sect diff S}$. - Position $G_1$ such that it crosses $G_2$ in only isolated points in $int(S) = S - diff S$. Add new vertices at these interior intersection points. - Now $G_1 union G_2$ is common enlargment of $G_1$ and $G_2$ and a good graph, so result follows by above lemma. ] #definition[ *Euler characteristic* of surface $S$, is $chi(S) := chi_G (S)$ where $G$ is any good graph on $S$. ] #theorem[ Euler characteristic is homeomorphism-invariant: i.e. if $S_1$, $S_2$ homeomorphic surfaces, then $chi(S_1) = chi(S_2)$. ] #example[ If surface $S$ is triangulated by finite simplicial complex $K$ with $v$ $0$-simplices, $e$ $1$-simplices and $f$ $2$-simplices, then $ chi(S) = v - e + f $ ] #proposition[ Euler characteristic is also homotopy-invariant: $X tilde.eq Y ==> chi(X) = chi(Y)$. ] #proof[ Non-examinable. ] #definition[ For $n$-dimensional finite simplicial complex $K$, Euler characteristic is defined as $ sum_(k = 0)^n (-1)^k ("number of " k #h(0em) "-simplices in" K) $ ] #lemma(name: "Union Lemma")[ Let $K = A union B$ be $2$-dimensional finite simplicial complex with $A$, $B$, $A sect B$ simplicial sub-complexes. Then $ chi(K) = chi(A union B) = chi(A) + chi(B) - chi(A sect B) $ ] #proof[ Express number of vertices, edges and faces of $A union B$ in terms of those of $A$, $B$ and $A sect B$. ] #lemma[ Let $X$, $Y$ surfaces. Then $ chi(X \# Y) = chi(X) + chi(Y) - 2 $ ] #proof[ - For closed surface $X$, $chi(X - "open disc") = chi(X) - 1$ (justify using triangulations). - Use Union lemma with $A = X - "open disc"$, $B = Y - "open disc"$, $A sect B = S^1$. ] #lemma[ Let $S$ be surface, let $S_M$ be $S$ with cross-cap attached. Then $ chi(S_M) = chi(S) - 1 $ ] #proof[ - $S_M = A union B$ where $A = (S - "open disc")$, $B$ is Mobius band. - Use Union lemma. ] #lemma[ Let $S$ surface, let $S_H$ be $S$ with handle added. Then $ chi(S_H) = chi(S) - 2 $ ] #proof[ - $S_H = A union B$, where $A = (S - 2 "open discs")$, $B$ is cylinder. - $A sect B$ is disjoint union of $S^1$ and $S^1$, $S^1 product.co S_1$. - Use Union lemma to show $chi(A sect B) = 0$. - Use Union lemma again to deduce the result. ] == The classification of closed surfaces #theorem(name: "Classification Theorem for Closed Surfaces")[ The complete list of closed surfaces, up to homeomorphism, is - *Orientable*: for $g in NN_0$, $ M_g tilde.equiv S^2 \# underbrace(T \# dots.h.c \# T, g "times") tilde.equiv S^2 "with" g "handles attached" $ - *Non-orientable*: for $g in NN$, $ N_g tilde.equiv underbrace(PP \# dots.h.c \# PP, g "times") tilde.equiv S^2 "with" g "cross caps attached" $ Since $chi(M_g) = 2 - 2g$ and $chi(N_g) = 2 - g$, a closed surface is classified up to homeomorphism (its *homeomorphism type*) by its Euler characteristic and whether it is orientable or not. ] #definition[ Let $K$ be finite simplicial complex that triangulates a closed surface $S$, let $L$ be sub-complex of $K$ of dimension $<= 1$. The *thickening* of $L$, $Theta(L)$, is sub-complex of $K^((2))$ given by the union of all $2$-simplices in $K^((2))$ (including all their faces) which meet $L$. ] #proposition[ Let $L$ be $1$-dimensional sub-complex of $2$-dimensional finite simplicial complex $K$. Then - $Theta(L) tilde.eq L$. - If $L$ is tree, then $Theta(L)$ is homeomorphic to closed disc $D^2$. - If $L$ is simple closed curve (i.e. homeomorphic to $S^1$) then $Theta(L)$ is homeomorphic to either cylinder or Mobius band. ] #lemma[ Let $K$ be finite simplicial complex that triangulates closed surface, let $L$ be $1$-dimensional sub-complex of $K$. Then $ chi(L) = chi(Theta(L)) $ ] #proof[ - Let $diff Theta(L)$ be boundary of $Theta(L)$ in $K$, let $C = Theta(L) - L - diff Theta(L)$ (note $C$ is not simplicial complex). - By definition, $L$, $diff Theta(L)$ and $C$ are pairwise disjoint and $Theta(L) = L union diff Theta(L) union C$. - By Union lemma, $chi(Theta(L)) = chi(L) + chi(diff Theta(L)) + chi(C)$. ] #definition[ Let $K$ finite simplicial complex that triangulates closed surface. - A *maximal tree* in $K$ is tree formed out of the $0$- and $1$-simplices in $K$ which cannot be extended to any larger tree (and necessarily contains all $0$-simplices). - For maximal tree $L$ in $K$, *dual graph* of $L$, $L^* subset K$, is defined as follows: - The vertices of $L^*$ are the barycentres of the $2$-simplices of $K$. - Two vertices of $L^*$ are joined by an edge iff the corresponding two $2$-simplices meet in a $1$-simplex not in $L$. ] #proposition[ Let $L$ be maximal tree in $K$. - $L^*$ is connected. - $Theta(L) union Theta(L^*) = K^((2)) tilde.equiv K$. - $Theta(L) sect Theta(L^*) = "boundary of disc" Theta(L) tilde.equiv S^1$. ] #theorem[ Let $K$ finite simplicial complex that triangulates closed surface. Then $chi(K) = 1 + chi(L^*) <= 2$ (where $L$ is maximal tree in $K$) with equality iff $K tilde.equiv S^2$. ] #proof[ - Let $L$ be maximal tree in $K$ with dual graph $L^*$. Use Union lemma and above two propositions to show $chi(K) <= 2$. - Show if $chi(K) = 2$ then $L^*$ is tree, conclude that $K$ is homeomorphic to union of two closed discs glued along their boundary circles, so is copy of $S^2$. ] #lemma[ Let $S$ be closed surface. Then $(S + "handle") tilde.equiv S \# TT$. ] #proof[ - Up to homeomorphism, we can always arrange that a handle is attached to the interior of a region homeomorphic to a closed disc in $S$. - So $S + "handle" tilde.equiv (S - "open disc") union (TT - "open disc") tilde.equiv S \# TT$. ] #lemma[ Let $S$ be non-orientable closed surface. Then $(S + "handle") tilde.equiv S \# KK tilde.equiv S \# PP \# PP tilde.equiv (S + 2 "cross caps")$. ] #definition[ Let $L$ be maximal tree in finite simplicial complex $K$ with dual graph $L^*$, let $C subset.eq L^*$ be a cycle. Then $C$ is a *non-separating* simple closed curve. ] #definition[ Performing *surgery* along a non-separating simple closed curve $C$ is the following process: - Remove interior of $Theta(C)$ from $K^((2)) tilde.equiv K tilde.equiv S$, giving a simplicial complex $K^((2)) - int(Theta(C))$ which has either two holes (if $Theta(C) tilde.equiv$ cylinder) or one hole (if $Theta(C) tilde.equiv$ Mobius band), with the boundary of each of these holes being a triangulated circle. - Glue triangulated closed discs onto each boundary circle to "cap off" the holes. - This gives a new finite simplicial complex $K'$ which triangulates a closed surface $S'$. So $ S tilde.equiv cases(S' + "handle" & "if" Theta(C) tilde.equiv "cylinder", S' + "cross cap" & "if" Theta(C) tilde.equiv "Mobius band") $ - So $ chi(S') = cases(chi(S) + 2 & "if" Theta(C) tilde.equiv "cylinder", chi(S) + 1 & "if" Theta(C) tilde.equiv "Mobius band") $ ] #theorem[ Up to homeomorphism, any closed surface can be obtained from a sphere by adding a finite number of handles and/or a finite number of cross caps. ] #proof[ - Let $S$ be closed surface, triangulated by a finite simpicial complex $K$. Let $L$ be maximal tree in $K$ with dual graph $L^*$. - Then $chi(S) = chi(K) = 1 + chi(L^*)$. If $L^*$ is tree, then $chi(S) = 2$ so $S tilde.equiv S^2$. - So suppose $L^*$ contains cycle $C$, i.e. a simple closed curve. - We show we can always reduce to the case that the dual graph is a tree by performing "surgeries", and hence, that $S$ can be constructed from $S^2$. - Claim: the cycle $C subset L^*$ is *non-separating*, i.e. $K - C$ is path-connected. - Suppose not. Then each connected component of $K - C$ must contain a $0$-simplex in $K$ (since $C subset L^*$ avoids them all). - Clearly, $0$-simplices in different components cannot be joined by a path in $K - C$. However, $L subset K - C$ contains all $0$-simplices by definition of the dual graph: contradiction. - Since $C tilde.equiv S^1$, $Theta(C) tilde.equiv$ cylinder or Mobius band. - Perform surgery along the non-separating closed curve: - Remove interior of $Theta(C)$ from $K^((2)) tilde.equiv K tilde.equiv S$, giving a simplicial complex $K^((2)) - int(Theta(C))$ which has either two holes (if $Theta(C) tilde.equiv$ cylinder) or one hole (if $Theta(C) tilde.equiv$ Mobius band), with the boundary of each of these holes being a triangulated circle. - Glue triangulated closed discs onto each boundary circle to "cap off" the holes. - This gives a new finite simplicial complex $K'$ which triangulates a closed surface $S'$. So $ S tilde.equiv cases(S' + "handle" & "if" Theta(C) tilde.equiv "cylinder", S' + "cross cap" & "if" Theta(C) tilde.equiv "Mobius band") $ - So $ chi(S') = cases(chi(S) + 2 & "if" Theta(C) tilde.equiv "cylinder", chi(S) + 1 & "if" Theta(C) tilde.equiv "Mobius band") $ - We can repeat this surgery procedure along cycles in "the" dual graph in each such new surface obtained. - This process must terminate after a finite number of surgeries in a closed surface $Z$ for which "the" dual graph (in every triangulation) has no cycles (i.e. the dual graph is a tree, i.e. $Z tilde.equiv S^2$), since each surgery increases the Euler characteristic and $chi(S) <= 2$ for all closed surfaces $S$. ] #corollary[ If $S$ is non-orientable surface, then $S \# T tilde.equiv S \# KK$. ] #corollary[ Up to homeomorphism, every closed surface $S$ is given by precisely one of the closed surfaces - If $S$ is orientable: $M_g = S^2 + g "handles" tilde.equiv S^2 \# T \# dots.c \# T$, $g in NN_0$. - If $S$ is non-orientable: $N_g = S^2 + g "cross caps" tilde.equiv PP \# dots.c \# PP$ where $g in NN$. ] #proof[ - If $S$ orientable, then $S$ can only be obtained by attaching handles to $S^2$ by above theorem. So $S^2 tilde.equiv S^2 + g "handles" = M_g$. But $chi(M_g) = 2 - 2g$ so homeomorphism type is determined by number of handles. - If $S$ non-orientable, then $S tilde.equiv S^2 + k "handles" + ell "cross caps"$, $k >= 0$, $ell >= 1$. But attaching handle to non-orientable surface is same as attaching two cross caps, so $S^2 tilde.equiv S^2 + (2k + ell) "cross caps" = N_(2k + ell)$. But $chi(N_g) = 2 - g$ so homeomorphism type is determined by number of cross caps. ]
https://github.com/mitex-rs/underleaf
https://raw.githubusercontent.com/mitex-rs/underleaf/main/fixtures/underleaf/ieee/styling.typ
typst
#let prefer-theme = "white";
https://github.com/hemmrich/CV_typst
https://raw.githubusercontent.com/hemmrich/CV_typst/master/modules/skills.typ
typst
// Imports #import "../template/template.typ": cvSection, cvSkill, hBar #let metadata = toml("../metadata.toml") #let cvSection = cvSection.with(metadata: metadata) #cvSection("Skills") #cvSkill( type: [Languages], info: [English (native) #hBar() German (native)], ) #cvSkill( type: [Tech Stack], info: [Python (Pandas/Numpy) #hBar() C++ #hBar() Ruby #hBar() Git], ) #cvSkill( type: [Personal Interests], info: [Tennis #hBar() Weightlifting #hBar() Chess #hBar() Investing], )
https://github.com/p4perf4ce/typst-ieee-trans-template
https://raw.githubusercontent.com/p4perf4ce/typst-ieee-trans-template/main/README.md
markdown
Do What The F*ck You Want To Public License
# ieee-trans-template IEEE-Trans template for [Typst](https://github.com/typst/typst). > [!NOTE] > This template is still not 100% replication of `IEEE-trans.cls` due to the lacks of following features > > * Floating footnote > > In LaTeX, a very long footnote will auto-spread into two columns. Typst currently doesn't do that out-of-the-box (yet). > > * Two-column floating figure > > This is currently not possible, but there is a discussion about this. Expected to be supported in the next release cycle. (I think) PR to adjust this template is always welcome, or just [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) it. ## License This template use [Do What The Fuck You Want](LICENSE) license **except** for those Arimo font (Arimo-.*\\.ttf) and logo.png. ## Preview * **First Page** ![Image of the first page](imgs/p1.png) * **Second Page** ![Image of the second page](imgs/p2.png) * **Third Page** ![Image of the third page](imgs/p3.png)
https://github.com/actions-marketplace-validations/HackingGate_typst-out
https://raw.githubusercontent.com/actions-marketplace-validations/HackingGate_typst-out/main/README.md
markdown
MIT License
# Typst Out GitHub Action This GitHub action automatically builds Typst files in your repository using a custom Typst ref and uploads the output files as artifacts. [![Test Action](https://github.com/HackingGate/typst-out/actions/workflows/test.yml/badge.svg)](https://github.com/HackingGate/typst-out/actions/workflows/test.yml) ## Features - Uses a custom Typst ref to build your Typst files - Allows for setting the number of days to retain the PDFs as artifacts - Supports custom naming of the artifacts - Configurable output file extensions - Allows for using a custom template file ## Usage To use the Typst Out action in your GitHub repository, create a new workflow file (e.g., `.github/workflows/typst_out.yml`) and add the following content: ```ymal on: push: paths: - '**.typ' jobs: build_typst: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Build Typst files uses: HackingGate/typst_out@v1 with: typst_ref: main retention_days: 7 artifacts_name: typst_output output_extensions: pdf template_file: template.typ ``` ## Inputs | Name | Description | Required | Default | | --- | --- | --- | --- | | `typst_ref` | The ref of Typst to use for building | No | `main` | | `retention_days` | The number of days to retain the PDFs as artifacts | No | `7` | | `artifacts_name` | The name of the artifacts to upload | No | `typst_output` | | `output_extensions` | The extensions of the output files | No | `pdf` | | `template_file` | The template file to use | No | `template.typ` | ## Caching In this GitHub action, caching is used to store and retrieve the build artifacts and dependencies to speed up the action's runtime. Caching helps avoid rebuilding the Typst binary and reinstalling the Rust dependencies each time the action is run, saving time and resources. There are two caching steps in this action: 1. **Cache Typst build**: This step caches the built Typst binary using the `actions/cache@v3` action. The cache key is created using the Typst commit SHA from the specified `typst_ref`. When the action is run, it checks if there's a cache hit (i.e., if a cached Typst binary exists for the given commit SHA). If there's a cache hit, the action skips the subsequent steps for setting up Rust and building Typst, and directly proceeds to the step for compiling Typst files. ```yaml - name: Cache Typst build uses: actions/cache@v3 id: typst_cache with: path: ~/typst_build key: typst-${{ steps.typst_commit_sha.outputs.sha }} ``` 2. **Cache Rust**: If there's no cache hit for the Typst build, this step caches the Rust dependencies using the `Swatinem/rust-cache@v2` action. By caching the Rust dependencies, the action can significantly reduce the time taken to set up Rust and compile the Typst binary in future runs. ```yaml - name: Cache Rust if: steps.typst_cache.outputs.cache-hit != 'true' uses: Swatinem/rust-cache@v2 ```
https://github.com/protohaven/printed_materials
https://raw.githubusercontent.com/protohaven/printed_materials/main/class-handouts/class-metal_101-shop_basics.typ
typst
#import "/meta-environments/env-templates.typ": * #import "./glossary/glossary_terms.typ": * #show: doc => class_handout( title: "Introduction to Metalworking", category: "Metal", number: "101", clearances: ("Chop Saw (Metal)", "Vertical Band Saw (Metal)", "Drill Press (Metal)", "Metal Grinder Dust Collection", "Bench Grinders", "Disk Grinder", ), instructors: ("Someone",), authors: ("<NAME> <<EMAIL>>",), draft: true, doc ) // Retitle the tools to Chop Saw (Metal) // Content goes here = Welcome Welcome to the Introduction to Metalworking class at Protohaven! #set heading(offset:1) #include "/common-policy/shop_rules.typ" #include "/common-policy/tool_status_tags.typ" #include "/common-policy/filing_a_tool_report.typ" #set heading(offset:0) #pagebreak() = Metalworking Safety Do not work in the metal shop wearing anything that could end up pulling you into a machine. Do not wear: - Long hair - Loose sleeves - Loose clothing - Gloves Do wear: - safety glasses - hearing protection (especially when grinding) If you feel unsure of something, feel free to ask! = Introduction == Learning Objectives == Terminology #swarf_term // = Classroom Activities = Tools #set heading(offset:1) #include "/common-tools/chop_saw_metal.typ" #include "/common-tools/drill_press_metal.typ" #include "/common-tools/band_saw_metal_vertical.typ" #include "/common-tools/metal_grinder_dust_collection.typ" #include "/common-tools/bench_grinders.typ" #include "/common-tools/disk_grinder.typ" #set heading(offset:0) = Resources
https://github.com/mem-courses/calculus
https://raw.githubusercontent.com/mem-courses/calculus/main/homework-1/calculus-homework2.5.typ
typst
#import "../template.typ": * #show: project.with( title: "Calculus Homework #2.5", authors: (( name: "<NAME> (#47)", email: "<EMAIL>", phone: "3230104585" ),), date: "October 8, 2023", ) = 课堂练习 10/7 课前热身 #prob[求:$ lim_(n->oo) (1^2/sqrt(n^6+1^2) + 2^2/sqrt(n^6+2^2) + 3^2/sqrt(n^6+3^2) + dots.c + n^2/sqrt(n^6+n^2)) $] = 课堂练习 10/7 9:08 #prob[ 设 $a>0$,$x_0>0$,$k$ 是正整数,数列 ${x_n}$ 满足: $ x_(n+1)=1/(k+1) (k x_n + a/(x_n^k)) $ 求 $display(lim_(n->oo)) x_n$. ] = 习题1-2 5 #prob[证明:数列 ${a_k}$ 收敛的充要条件是子列 ${a_(2k)}$ 与 ${a_(2k-1)}$ 均收敛且极限相等.] - 必要性: 若 ${a_k}$ 的某一子列发散,则 ${a_k}$ 也发散.故 ${a_k}$ 收敛的必要条件是 ${a_(2k)}$ 和 ${a_(2k-1)}$ 均收敛. 设 ${a_(2k)}$ 的极限为 $A$,${a_(2k-1)}$ 的极限为 $B$.下证 $A!=B$ 时 ${a_k}$ 发散: $forall eps>0$,当 $2k>N_1$ 时,有 $a_(2k)$ $in$ $(A-eps,A+eps)$;当 $2k-1>N_2$ 时,有 $a_(2k-1)$ $in$ $(B-eps,B+eps)$. 不妨认为 $A<B$,取 $0<eps'<display(((B-eps)-(A+eps))/2)$,则对于任意 $n>max{N_1,N_2}$,无法取常数 $C$ 使得 $|a_n-C|<eps'$,故此时 ${a_k}$ 的极限不存在. - 充分性: 设 ${a_(2k)}$ 和 ${a_(2k-1)}$ 的极限都存在且均为 $A$,下证 ${a_k}$ 也收敛且极限为 $A$. 根据极限的定义,$forall eps>0$,存在常数 $N_1,N_2$ 使得当 $2k>N_1$ 时,$|a_(2k)-A|<eps$;当 $2k-1>N_2$ 时,$|a_(2k-1)-A|<eps$. 令 $N=max{N_1,N_2}$,则 $forall n>N$,$|a_n-A|<eps$.故 ${a_k}$ 的极限存在且为 $A$. = 习题1-2 9(1) #prob[利用单调有界定理,判断数列是否收敛.若收敛,则求出极限.$ x_n = (a^n) /n! quad (a>0 "为常数") $] 由于 $a$ 是常数,令常数 $M$ 为大于 $a$ 的最小正整数. $ forall n>M,quad x_n/x_(n-1) < M/n < 1 $ 改变数列的有限项,数列极限不变,可通过修改前 $M$ 项使得 $a_n$ 是单调递减数列. 由于 $a>0$,易得 $x_n>0$ 为下界.根据单调有界定理,数列 ${x_n}$ 收敛. 取 $display(x'_n=x_M (M/(M+1))^(n-M))$.$forall n>M$,$display(M/n<=M/(M+1))$,故 $x_n<=x'_n$. 由于 $display(lim_(n->oo) (M/(M+1)))^n=0$.根据夹逼定理,$display(lim_(n->oo)x_n=0)$. 综上,原数列收敛且极限为 $0$. = 习题1-2 9(3) #prob[ 利用单调有界定理,判断数列是否收敛.若收敛,则求出极限. $ x_n = cases( sqrt(5) quad& (n=1), sqrt(5+x_(n-1)) quad& (n>1), ) $ ] 令 $phi(x) = sqrt(5+x) quad (x>0)$,有 $phi'(x) = display(1/(2 sqrt(5+x)))>0$.可知数列 ${x_n}$ 单增. 若 $x<4$,则 $phi(x)=sqrt(5+x)<sqrt(5+4)=3<4$.由于 $x_1=sqrt(5)<4$,故 $x_n<4$. 根据单调有界定理,数列 ${x_n}$ 必有极限. 设极限为 $a$,取 $n->oo$,应有 $a=sqrt(5+a)$,解得 $a=display((1+sqrt(21))/2)$. 综上,原数列收敛且极限为 $display((1+sqrt(21))/2)$. = 习题1-2 11 #prob[设 $0<=a<b$,$x_1=a$,$y_1=b$ 且 $x_n=display((x_(n-1)+y_(n-1))/2)$,$y_n=sqrt(x_(n-1)y_(n-1))$,试证 ${x_n}$,${y_n}$ 的极限存在且相等.] 根据均值不等式链 $ a<(a+b)/2<sqrt(a b)<b $ 容易得到 $x_n<y_n$ 恒成立.那么, $ x_n-x_(n-1) &= (y_(n-1) - x_(n-1))/2>0 \ y_n/y_(n-1) &= sqrt(x_(n-1) / y_(n-1))<1 $ 所以 ${x_n}$ 单调递增,${y_n}$ 单调递减.那么 ${y_n-x_n}$ 单调递减且存在下界 $y_n-x_n>0$.根据单调有界定理,${y_n-x_n}$ 存在极限 $C$ 且 $C>=0$.故 ${x_n}$ 的上界和 ${y_n}$ 的下界均存在,再根据单调有界定理,${x_n}$ 和 ${y_n}$ 存在极限,分别设为 $A$ 和 $B$. 令 $n->oo$,应有 $display(cases( A = display((A+B)/2), B = sqrt(A B) ))$,解得 $A=B$.故数列 ${x_n}$ 和 ${y_n}$ 的极限都存在且相等. = 习题1-2 13(1) #prob[用单调有界定理判断数列是否收敛:$ x_n=10/1 times 11/3 times dots.c times (n+9)/(2n-1) $] 当 $n>10$ 时,$n+9<2n-1$,此时 $ x_n/x_(n-1) = (n+9)/(2n-1)<1 $ 改变数列有限项,敛散性不变。对于 $n>10$ 的部分,显然 $x_n>0$ 且单调递减。根据单调有界定理,原数列收敛。 = 习题1-2 13(3) #prob[用单调有界定理判断数列是否收敛:$ x_n=1+1/(2^2)+1/(3^2)+dots.c+1/(n^2) $] $ x_n &= 1+1/2^2+1/3^2+dots.c+1/n^2\ &< 1+1/(1times 2)+1/(2times 3)+dots.c+1/((n-1)times n) \ &= 1+1-1/2+1/2-1/3+dots.c+1/(n-1)-1/n\ &= 2-1/n<2 $ 故 ${x_n}$ 存在上界 $2$。另 $x_n-x_(n-1)=display(1/(n^2))>0$,可得 ${x_n}$ 单调递增。根据单调有界原理,原数列收敛。 = 习题1-2 15 #prob[证明:若单调数列的某一个子列收敛,则此单调数列本身也收敛.] 不妨认为数列是单调递增的。设子列 ${a_n_k}$ 的上界为 $A$,下证明原单调数列 ${a_n}$ 的上界也为 $A$. 反证法:若存在 $n in NN_+$ 使得 $a_n>A$。则必存在 $k$ 使得 $n_k>n$。由于 $a_(n_k)<A$,可得 $a_(n_k)<a_n$。与数列是单调递增的矛盾。 根据单调有界定理,单调数列本身也收敛。
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/down/0.1.0/lib.typ
typst
Apache License 2.0
#let _down = ( sum: ( index: state("_sum-index"), lower: state("_sum-lower"), upper: state("_sum-upper"), ), lim: ( x: state("_lim-x"), c: state("_lim-c"), ), integral: ( lower: state("_integral-lower"), upper: state("_integral-upper"), dif: state("_integral-dif"), ), factor: state("_factor"), ) // Contextual summation #let Sum(index, lower, upper) = { let S = _down.sum math.attach( math.sum, b: { if (index != none) { S.index.update(index) } if (lower != none) { S.lower.update(lower) } context S.index.get() math.eq context S.lower.get() }, t: { if (upper != none) { S.upper.update(upper) } context S.upper.get() } ) } #let cSum = Sum(none, none, none) // Contextual limit #let Lim(x, c) = { let L = _down.lim math.attach( math.lim, b: { if (x != none) { L.x.update(x) } if (c != none) { L.c.update(c) } context L.x.get() math.arrow.r context L.c.get() } ) } #let cLim = Lim(none, none) // Contextual integral #let Integral(lower, upper, f, dif: [x]) = { let I = _down.integral math.attach( math.integral, b: { if (lower != none) { I.lower.update(lower) } context I.lower.get() }, t: { if (upper != none) { I.upper.update(upper) } context I.upper.get() } ) f math.dif if (dif != none) { I.dif.update(dif) } context I.dif.get() } #let cIntegral(f) = Integral(none, none, f, dif: none) #let Integrated(f, lower, upper) = { let I = _down.integral math.attach(math.lr({ [\[] f [\]] }), b: { if (lower != none) { I.lower.update(lower) } context I.lower.get() }, t: { if (upper != none) { I.upper.update(upper) } context I.upper.get() } ) } #let cIntegrated(f) = Integrated(f, none, none) // Contextual factor #let Fac(factor) = { if (factor != none) { _down.factor.update(factor) } math.attach(context _down.factor.get()) } #let cFac = Fac(none)
https://github.com/piepert/philodidaktik-hro-phf-ifp
https://raw.githubusercontent.com/piepert/philodidaktik-hro-phf-ifp/main/src/parts/spue/leistungsmessung/main.typ
typst
Other
#import "/src/template.typ": * = Leistungsmessen in der SPÜ #author[<NAME>] #include "formen.typ" #include "beispiele.typ"
https://github.com/xdoardo/co-thesis
https://raw.githubusercontent.com/xdoardo/co-thesis/master/thesis/thanks.typ
typst
#v(20%) #align(right, text(size: 20pt, weight: "bold", [Ringraziamenti])) #v(5%) Ringrazio innanzitutto il mio relatore Alberto: in questi mesi i suoi consigli mi sono stati molto utili. Oltre alla scrittura della tesi, senza le sue lezioni non mi sarei appassionato a questo ambito dell'informatica tanto quanto ora mi accorgo di esserlo. Grazie ai miei genitori, Lidia e Franco. Senza i loro sforzi non sarei mai potuto arrivare a questo importante traguardo. Grazie per avermi sostenuto nei momenti in cui non credevo in me stesso. Grazie ai miei amici Luca, <NAME>., Luca (chi è quale?), <NAME> e, infine, Emma. Il tempo passato con voi e le parole scambiate assieme sono incredibilmente importanti per me, vi voglio bene. #v(5%)
https://github.com/ofurtumi/formleg
https://raw.githubusercontent.com/ofurtumi/formleg/main/h04/H4.typ
typst
#import "@templates/ass:0.1.1": * #show: doc => template( project: "Homework 4", class: "TÖL301G", doc ) #set heading(numbering: "1.a") = $"non-reg" sect "non-reg" = "reg"$ Lets use the following non-regular languages $A$ and $B$: $ A &= {0^n 1^n | n >= 0}\ B &= {2^n 3^n | n >= 0} $ These languages are irregular for the same reason, they are not closed under pumping lemma. #box(stroke: 1pt, inset: 8pt, [ Lets suppose that $A$ is regular, let $P$ denote pumping length and $s = 0^P 1^P$. According to pumping lemma $s$ splits into $X Y^i Z$ so that rules _i-iii)_ of the pumping lemma hold. Now $Y = 0^j | j in {1...P} $ and if we pump down and set $i = 0$ we get $s' = X Z = 0^(P-j) 1^P$ which is not in $A$. ]) Since these languages do not use the same alphabet, they are not equal and the only intersection they have, the empty string, would be regular $ A sect B = {emptyset} $ = File trees Lets define the language $"DIR"$ we have two major rules + Each file, $a$, has a corresponding pair of parenthesis + The root folder does not have a file name Lets show that this language is irregular by applying pumping lemma. #box(stroke: 1pt, inset: 8pt, [ Lets suppose DIR is regular, let $P$ denote pumping length and $s = (a^(P-2)\(\))$. According to pumping lemma $s$ splits into $X Y^i Z$ so that rules _i-iii)_ of the pumping lemma hold. Now $Y = a^j$ where $(j | j in {1...P}) $ and if we pump down and set $i = 0$ we get $s' = X Z = a^(P-j) \(^(P+1) \)^(P+1)$ and since $P+1 != (P-1)+1$ which is not in does not follow the rules of $"DIR"$ therefore $"DIR"$ is not regular. ]) #pagebreak() = CRC codes == The checksum of the empty string would have a draw between all the numbers: ${0,1,2}$ and since $0$ takes precedence, the checksum would be $[0,0]$. == Suppose that the following language is regular: $ A={0^i 1^j 2^k | "file has valid checksum"} $ - Let $P$ denote pumping length - $s = 0^P 1^(P+1)2^(P-1)$ According pumping lemma $s$ splitsi into $X Y Z$ so that rules _i-iii)_ of the pumping lemma hold. According to rules _ii)_ and _iii)_ of the pumping lemma $|x y| <= P$ this means that $ y = 0^j | j in {1...P} $ From rule _i)_, if we pump down and set $i = 0$ we get $s' = X Z = 0^(P-j) 1^(P+1) 2^(P-1)$ Because the checksum takes the lowest number incase of a draw, after pumping the checksum will be invalid and that is a contradiction. Therefore the language is not regular.
https://github.com/li3zhen1/Remove-CCF-Table-from-SF-Fonts
https://raw.githubusercontent.com/li3zhen1/Remove-CCF-Table-from-SF-Fonts/main/Readme.md
markdown
MIT License
# Remove CCF Table from SF Fonts Scripts for convert otf to ttf for specific font (like SF Pro). `RemoveCCFTable` removes CCF table in OpenType files, so that software like typst can export PDF with correctly subsetted glyphs and you don't get a bloated PDF file (which includes all the characters even if you don't use them). The script also modifies all the metadata in the font so your system won't confuse the font with the original one. > [!IMPORTANT] > > **Please do not distribute any modified font files generated by the script.** > > **You are responsible for the usage of this script and the produced font files.** ## Some known issues - Different variation of the same glyph is not subsetted. For example, if you use `a`, all style variations of `a` will be included in the Typst exported PDF. If you want to reduce the PDF size to the minimum possible, use other font subsetting tools on the produced ttf file.
https://github.com/dark-flames/apollo-typst
https://raw.githubusercontent.com/dark-flames/apollo-typst/main/packages/typst-apollo/book.typ
typst
Apache License 2.0
/******************************************************************************** * This file includes code from the shiroa (https://github.com/Myriad-Dreamin/shiroa), * which is licensed under the Apache License, Version 2.0. * * Original code by: * Myriad-Dreamin (https://github.com/Myriad-Dreamin) * * Copyright (c) 2023 shiroa Developers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ********************************************************************************/ #import "@preview/shiroa:0.1.0": * #import "./pages.typ": project, part-style #let _page-project = project #let _resolve-inclusion-state = state("_resolve-inclusion", none) #let resolve-inclusion(inc) = _resolve-inclusion-state.update(it => inc) #let project(title: "", authors: (), spec: "", content) = { // Set document metadata early set document( author: authors, title: title, ) // Inherit from gh-pages show: _page-project if title != "" { heading(title) } locate(loc => { let inc = _resolve-inclusion-state.final(loc) external-book(spec: inc(spec)) let mt = book-meta-state.final(loc) let styles = (inc: inc, part: part-style, chapter: it => it) if mt != none { mt.summary.map(it => visit-summary(it, styles)).sum() } }) content }
https://github.com/tingerrr/subpar
https://raw.githubusercontent.com/tingerrr/subpar/main/test/show-rules/test.typ
typst
MIT License
// Synopsis: // - show-figure poduces the same visual output as a regular figure #import "/test/util.typ": * #import "/src/lib.typ" as subpar #show figure: subpar.default.show-figure #figure([a])
https://github.com/Coekjan/typst-upgrade
https://raw.githubusercontent.com/Coekjan/typst-upgrade/master/tests/exception2/entry.compat.typ
typst
MIT License
#strong[ #import "@preview/pack1:0.2.2": pack here is strong text, #pack. ] #import "@preview/pack3:2.0.0": pack3 #syntax-error-node-here(
https://github.com/gongke6642/tuling
https://raw.githubusercontent.com/gongke6642/tuling/main/Math/cancel.typ
typst
#set text( size:10pt, ) #set page( paper:"a5", margin:(x:1.8cm,y:1.5cm), ) #set par( justify: true, leading: 0.52em, ) = 删除 在公式上显示对角线。 通常用于表示删除元素。 = 例 #image("14.png") = 参数 #image("15.png") = 内容 被删除线覆盖的内容。 = 长度 删除线的长度,相对于被“删除”元素的对角线长度;值为100%时,删除线将恰好穿过元素。 默认:100% + 3pt = 反向 是否沿 y 轴反转删除线(指向左上角而非右上角)。 默认:false = 交叉 是否绘制两条相反的删除线交叉绘制在元素上。会覆盖掉 inverted 参数。 默认:false = 角度 旋转删除线的角度。 - 如果设置为auto,线条将采用默认角度;即,沿着内容框的对角线。 - 如果给定一个角度,则线条将按照该角度顺时针方向绕y轴旋转。 - 如果给定一个函数angle => angle,线条将按照该函数返回的角度旋转。该函数接收默认角度作为输入。 默认:auto = 划线 如何 绘制 描边线,详情请参考 line 文档 。 默认:0.5pt
https://github.com/donghoony/typst_editorial
https://raw.githubusercontent.com/donghoony/typst_editorial/main/details.typ
typst
MIT License
#let textt = text.with(font: "consolas") #let bold = text.with(weight: "bold") #let div3_problems = ( ("A", "Pen Pineapple Apple Pen", "Easy", "b", "string, implementation"), ("B", "증가 배열 만들기", "Easy", "s", "ad_hoc, constructive"), ("C", "카우버거", "Medium", "s", "sorting"), ("D", "두찌 수열", "Medium", "s", "implementation, simulation"), ("E", "서강근육맨", "Hard", "s", "sorting") ) #let div2_problems = ( ("A", "오리", "Easy", "s", "string"), ("B", "부당한 퍼즐", "Medium", "s", "ad_hoc"), ("C", "빛의 돌 옮기기", "Medium", "s", "dp"), ("D", "Gazzzua", "Medium", "s", "greedy"), ("E", "Swap the elements", "Hard", "g", "ad_hoc, constructive") ) #let div1_problems = ( ("A", "내일 할거야", "Medium", "g", "greedy, sorting"), ("B", "넴모넴모 2020", "Medium", "g", "binary_search"), ("C", "무술 연습", "Hard", "g", "graphs, topological_sorting"), ("D", "차이를 최대로 2", "Hard", "g", "greedy, sorting"), ("E", "트리 만들기", "Challenging", "p", "tree, priority_queue") ) #let div3_descriptions = ( ( [Content 안에 작성하면 됩니다. 수학 공식을 사용하고 싶으면 $a+b=c$와 같이 사용합니다], [미리 지정해둔 함수를 사용해 #textt[consolas], #bold[bold]를 사용할 수 있습니다.], lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ) #let div2_descriptions = ( ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ) #let div1_descriptions = ( ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ( lorem(5), lorem(6), lorem(12) ), ( [], ), ( [], ) )
https://github.com/csunibo/reti-di-calcolatori
https://raw.githubusercontent.com/csunibo/reti-di-calcolatori/main/prove/scritto-2024-05-31-testo.typ
typst
#set align(center) = Scritto Reti Di Calcolatori == 2024-30-31 #set align(left) NOTE: _Questa è una copia scritta a mano dell'esame_ #set par( justify: true ) #set enum(numbering: "1.a)") == Domande + [5] Perché si utilizzano gli acknowledgement nella comunicazione di rete? E perché si utilizzano in due dei sette livelli protoccolari ISO/OSI? + [5] Quali tra le tecniche di modulazione digitale (FSK, ASK, PSK, QAM) nelle reti senza fili sono MENO resistenti all'interferenza (cioè a più rischio di erorri)? Giustificare la risposta. + [5] Cosa indica la regola dei 6dB e quale utilità pratica ha? + [15] Alice e Bob devono produrre la fattorizzazione di 4 numeri primi #underline[compresi tra 1 e 100]: $a_1, a_2$ da Alice a Bob, e $b_1, b_2$ da Bob a Alice. Inizia Alice con la spedizione del primo messaggio verso Bob. Ogni ricevitore verifica che il messaggio provenga dal mittente previsto (garanzia del mittente) e che il messaggio sia integro (non modificabilità). Fornire la progettazione #underline[del più efficiente protocollo sicuro] che garantisca che la fattorizzazione finale di $X$ ottenuta sia da Alice che da Bob (dopo i messaggi scabiati) sia il valore esatto $X = a_1 * a_2 * b_1 * b_2$ evitando che Trudy possa modificare tale somma o conoscereil valore di $X$ (privacy). Suggerimento: considerare anche attacchi forza bruta #footnote[Come detto durante l'esame, i numeri primi compresi tra 1 e 1000 sono pochi (circa 100). Quindi forza bruta da parte di trudy non è detto che sia sulla chiave...] e replay da parte di Trudy. + [10] Se il comando *PING flora.cs.unibo.it* produce il seguente risultato quale può essere la causa? e quali protocolli e servizi di rete vengono usati per determinare i risultati sotto indicati? #box( //height: 9pt, stroke: black, inset: 10pt, [ PING flora.cs.unibo.it (192.168.3.11): 56 data bytes \ 64 bytes from 192.168.3.11: icmp_seq=0 ttl=54 time=16.624 ms \ 64 bytes from 192.168.3.11: icmp_seq=1 ttl=54 time=15.590 ms \ ping: sendto: No route to host \ ping: sendto: No route to host \ Request timeout for icmp_seq 2 \ Request timeout for icmp_seq 3 \ 64 bytes from 192.168.3.11: icmp_seq=4 ttl=54 time=15.404 ms \ 64 bytes from 192.168.3.11: icmp_seq=5 ttl=54 time=14.712 ms \ ] ) e se invece il risultato fosse stato questo? #box( //height: 9pt, stroke: black, inset: 10pt, [ PING flora.cs.unibo.it (192.168.3.11): 56 data bytes \ ping: cannot resolve flora.cs.unibo.it: Unknown host ] ) + [10] Un segmento di rete locale dispone di un Web Proxy locale in grado di contenere in media $X%$ delle richieste di pagine web richieste dagli host della rete locale (tutte di dimensione molto limitata). Se la latenza della rete locale è di 9ms e se la latenza del collegamento a internet verso i Web Server esterni è in media 300ms, quale è il #underline[ritardo medio] per il completamento di una richiesta HTTP da parte di un browser su un PC della rete locale? e quale deve essere la percentuale di $X%$ per avere un ritardo medio di $97%$ms + [5] data la matrice dei bit di parità pari che segue cosa possiamo dire su eventuali errori della sequenza di bit? (i bit sottolineati sono i bit di parità pari). Spiegare. #box( stroke: black, inset: 5pt, table( columns: 8, stroke: none, [1], [0], [1], [0], [0], [1], [], [#underline[1]], [1], [1], [1], [0], [0], [0], [], [#underline[0]], [0], [1], [1], [1], [0], [0], [], [#underline[1]], [1], [0], [1], [0], [1], [0], [], [#underline[1]], [1], [1], [1], [1], [0], [1], [], [#underline[1]], [1], [1], [1], [1], [1], [1], [], [#underline[0]], [], [], [], [], [], [], [], [], [#underline[1]], [#underline[1]], [#underline[1]], [#underline[0]], [#underline[1]], [#underline[1]] ) ) + [10] + Quante sottoreti /20 si possono realizzare dalla rete che contiene l'host 192.168.127.12? Numero di sottoreti /20: + Quale è il range di indirizzi (dal numero di rete al broadcast) della quinta di queste sottoreti (ovvero la numero 4)? - IPv4 del numero di rete della quinta sottorete /20: - IPv4 del broadcast della quinta sottorete: + A quale sottorete appartiene l'host 192.168.127.12? + [25] Define gli indirizzi Ipv4 e maschere di rete da assegnare agli host e ai router come da schema indicato. Leggere pagina successiva... #place( center, square( [ #set align(center + horizon) Internet ] ) ) #place( center, dy: 50pt, line( start: (0%, 0%), end: (0%, 5%) ) ) #place( center, dy: 90pt, circle( radius: 25pt, [ #set align(center + horizon) N ] ) ) #place( center, dy: 120pt, line( start: (-8%, 0%), end: (-35%, 4%) ) ) #place( center, dy: 120pt, dx: 80pt, line( start: (8%, 0%), end: (35%, 4%) ) ) #place( left, dy: 130pt, circle( radius: 30pt, [ #set align(center + horizon) Subnet A ] ) ) #place( left, dx: 30pt, dy: 192pt, line( start: (0%, 0%), end: (0%, 5%) ) ) #place( left, dy: 230pt, circle( radius: 30pt, [ #set align(center + horizon) Subnet A1 ] ) ) #place( right, dy: 130pt, circle( radius: 30pt, [ #set align(center + horizon) Subnet B ] ) ) #place( right, dx: -30pt, dy: 192pt, line( start: (0%, 0%), end: (0%, 5%) ) ) #place( right, dy: 230pt, circle( radius: 30pt, [ #set align(center + horizon) Subnet B1 ] ) ) #v(300pt) Limiti di hosts: #table( columns: 2, align: center, table.header([*Subnet*], [*Max numero di hosts*]), [Subnet A], [490], [Subnet A1], [155], [Subnet B], [35], [Subnet B1], [12] ) Per la rete N indicare i seguenti valori: - Network N = 172.16.17.32/22 - Netmask: - First host: - Last host: - Router di N: - Broadcast di N: Per _ciascuna_ le subnet indicare i seguenti valori: - Netmask: - First host: - Last host: - Gateway del router della subnet: - Router della subnet: - Broadcast della subnet: + [10] Una rete locale (LAN) deve essere progettata e realizzata a livello fisico della infrastruttura con i seguenti requisiti: si devono connettere 80 host client con interfaccia ethernet, esistono 4 server (S1, S2, S3, S4) per i servizi ad elevate prestazioni per i quali sono acquistate macchine apposite ognuna dotata di una interfaccia Ethernet, esistono 4 stampanti di rete, esiste un router R dotato di doppia interfaccia Ethernet: interna (LAN) e esterna (WAN/Internet). Disegna qui sotto lo schema dei collegamenti dell'infrastruttura di rete locale (utilizzando solo switch a 24 porte), avendo come obiettivo il corretto funzionamento di Ethernet e il bilanciamento del carico di rete medio, oltre che la potenziale limitazione degli effetti dei guasti, e limitando il budget di spesa al minimo. + Quale sarà il numero minimo di cavi Ethernet di collegamento da acquistare per non avere nessuna partizione di rete? + Quali servizi di rete sono utili indispensabili sui server per il collegamento a internet? + Se l'interfaccia WAN del router avesse l'IPv4 192.168.3.11, rispetterebbe le linee guida per la scelta dell'IP del Router della #underline[rete locale]? + Se ogni host della LAN dovesse essere connesso ad Internet, ma senza disporre dell'intera rete 172.16.58.3/16, avendo acquistato solo l'indirizzo pubblico IPv4 192.168.3.11, quale soluzione potremmo realizzare?
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/028%20-%20Kaladesh/008_In%20This%20Very%20Arena.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "In This Very Arena", set_name: "Kaladesh", story_date: datetime(day: 12, month: 10, year: 2016), author: "<NAME>", doc ) #emph[Chandra and Nissa went looking for Chandra's mother Pia, using Mrs. Pashiri's Kaladesh contacts. But instead of finding Pia, they found themselves trapped] #emph[in an underground Consulate prison facility. Only the timely arrival ] #emph[of the leonin Planeswalker, Ajani, saved them from having to make a deadly choice. Liliana has left without the others, concerned about Tezzeret's presence on Kaladesh, while the rest of the Gatewatch, Jace and Gideon, remain on Ravnica.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) = RAVNICA The carnarium was crowded, loud, and full of minds. Performers swung on long chains tethered to the ceiling, teeth and spikes gleaming. Jace sat in a middle row, out of range of the acrobats and fire-swallowers, but in the center of the laughter and noise. #figure(image("008_In This Very Arena/01.jpg", width: 100%), caption: [Rakdos Ringleader | Art by Jason Felix], supplement: none, numbering: none) The Izzet mage who sat down next to him wore a mizzium gauntlet that arced with streaks of energy. Jace sensed the concern behind Ral Zarek's electric aura. He opened a mental ear to the mage's mind. #emph["The Guildpact is a—] " was the thought front-and-center in Ral's mind, followed by a colorfully vulgar and startlingly visual torrent of phrases. Jace sighed audibly. Ral muffled a laugh. #emph["Just testing if you could really read my thoughts."] #emph["Test successful,"] Jace thought. He faced the stage, eyes on the Rakdos performers. Just a regular audience member, cloaked in noise. "#emph[We could have done this back at the Hall of the Guildpact, you know. Unless you really wanted to take in a show] ." #emph["All your official visitors there are recorded and tracked,"] Ral thought. #emph["Not safe."] So Ral wasn't here as a concerned member of the Izzet guild. He wanted to talk to Jace as a Planeswalker. #emph["What is it, then?"] #emph["An irregular planeswalk." ] Ral's mind paused, either to let that sink in or to come up with how to form the next thought. #emph["Someone planeswalked away from Ravnica in a manner that was...anomalous.] " #emph["What? Who? How do you know this?"] #emph["You've seen the clouds outside, Beleren. Don't make me do all the work."] #emph["] Project Lightning Bug#emph[?"] #emph["There you go."] Jace furrowed his brow. #emph["I thought that was shut down after we sabotaged the results."] #emph["It was, officially." ] Ral's thoughts coiled in on themselves. Images of magically-created lightning storms and sensitive sensor mechanisms swam through his mind, along with memories of conjuring careful half-truths while Niv-Mizzet's hot breath bore down on him. Jace couldn't help tilting his eyes to the side, to see Ral's expression. Worry lined the man's forehead. Ral's mind continued. "#emph[The detectors still trigger when someone planeswalks. I glance over the results from time to time, but mostly I keep them hidden from Niv-Mizzet and most of my guild. I reached out when I saw Vraska's planeswalk."] Jace was deeply un-thrilled to hear the gorgon's name. #emph["She left Ravnica," ] Ral thought, "#emph[with no destination."] #emph["No destination?"] #emph["She didn't planeswalk ] to#emph[ a plane. Only from one."] #emph["That doesn't make sense."] #emph["Exactly."] #emph["A flaw in the detectors?"] Ral gave an impatient flick of his hand. "#emph[The experiment performed perfectly. The pattern of the departure was authentic, but the endpoint recorded as anomalous. Vraska hasn't been seen since. It's like she planeswalked into a void."] Jace saw the electrostatic pattern in Ral's mind, the recorded planeswalk that faded into a distinct patch of nowhere. He felt how much this troubled Ral. No other finding in his experiment had shown this pattern. #figure(image("008_In This Very Arena/02.jpg", width: 100%), caption: [Homing Lightning | Art by Slawomir Maniak], supplement: none, numbering: none) #emph["That's fascinating," ] Jace thought at him. "W#emph[ait. Are you saying you can still see when I leave Ravnica?"] #emph["First to Zendikar, then off to Innistrad, was it?" ] Ral was still watching the performers, but his elevated eyebrows were all for Jace's benefit. "#emph[So, will you be staying long this time? Or should we expect you to leave Ravnica without its Guildpact again soon?"] #emph["That's... Uh... Ral, listen—"] Ral stood up to leave. #emph["Anyway, I thought you'd want to know. Vraska was none too fond of you, last I heard."] #emph["I—Thank you. Ral, wait."] Jace fumbled over annoyed audience members, following Ral as he made his way out of the theater. "Ral…" He followed the Izzet mage out to the street, and caught up to him. "Stop worrying," Ral said, gesturing with his gauntlet. "I won't give away all your secrets. Just remember there are those who'd love to be in the position you've blundered your way into. Maybe consider putting in a little effort while you're still here, all right?" "I will," Jace said. He thought then of Lavinia, who was convinced Jace was still in his office right now, hunched over a sheaf of papers, dutifully doing the grunt work of maintaining the delicate balance between the guilds. Or maybe she had already discovered the studious illusion he left behind, and was in the midst of yelling "GUILDPAAAACT!" at the ceiling in that way that she did. A finger tapped Jace's shoulder. Jace turned, and Liliana stood before them, a faint perfume of another world on her. She glanced at Ral, and looked at Jace, grim as the grave. "You. Kaladesh. Let's go." Ral crossed his arms and raised those judgment-brows as high as they would go. Jace gritted his teeth and said in a low grumble, "This isn't a good time." #figure(image("008_In This Very Arena/03.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) "Don't care," Liliana said. "This takes precedence." She held her shoulders back imperiously, but Jace noticed she was shifting from foot to foot. Her usual, lightly cruel teasing had been replaced by clipped demands. "Did you find Chandra?" "I found someone else," she said. "Tezzeret. Alive and well." Jace suddenly found himself incapable of swallowing saliva, and he choke-coughed. Liliana shot glances at the sky, the cobblestones, and the wheels of a passing vendor's cart, looking everywhere but directly at Jace's face. She spoke in low tones. "I know. I'm as unhappy about asking you as you are. If I had any other choice—look. Come to Kaladesh. Bring the muscle." Before Jace could respond, her form began to shimmer. It wasn't like her to planeswalk in the middle of the street, in front of someone she didn't know. When she was gone, Jace and Ral looked at each other. Jace had a hard time finding words. "Let me guess, Guildpact," Ral said. "You…" Jace shrugged slightly, his hands splayed in utter lack of excuse. "…have to leave." Jace's head sank slightly into his shoulders. Ral jabbed a look at Jace, gave a sharp shake of head, and walked off. Jace's brain conjured up an array of possible explanations, but none of them seemed adequate. Instead he collected himself, took a breath, and dodged down an alleyway to fetch Gideon. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) = KALADESH Nissa scanned for the authorities. It seemed they were safe for the moment, she and Chandra, pausing under a bridge with Mrs. Pashiri and the tall cat-man. No Consulate soldiers, no Dhund agents—just the hum of the city around them. One of those huge, heavy vehicles rattled along the bridge above them, sunlight flickering through the gaps in the tracks. Nissa winced at the tangle of light and sound, but at least they were free of Baral's trap. "That was a very good thing you did, Ajani." Mrs. Pashiri beamed, squinching up her cheeks, supporting herself with a handful of his bicep fur. "Thank you." "You gave me a scare, Grandmother," Ajani rumbled gently. "Thank you, Ajani," Nissa said. She hadn't seen any others like him on Kaladesh, and wondered how to phrase the sticky question. "Have you been...here long?" "Where I'm from, I'm less...unusual," Ajani said, adjusting a cloak around his significant shoulders. "We've been following Tezzeret's movements here for weeks." Mrs. Pashiri patted Ajani's big paw. "Chandra is looking for someone, too. Her dear mother, Pia. Taken by Tezzeret's soldiers." Nissa glanced at Chandra with furtive concern. The pyromancer was pacing like an anxious show horse, kicking at the mosaic patterns of the street. "I'll get Grandmother Pashiri to safety," Ajani said. "And then I think we should fan out, spread our search across the city." "Good," Nissa said. "With everyone working together, I'm sure we'll be able to get some sense of where they—where they might've…. Chandra, what is it?" Chandra had become a pillar of fire. She stood stock-straight, facing the opposite side of the street. Her hair was aflame. They followed her eyes up, up the sides of the towers. The banners unfurled themselves, rolling down the spires via some kind of un-scrolling mechanism. They were huge and identical, printed larger-than-life, imagery drawn in exaggerated lines. A stylized Head Judge Tezzeret stood tall, surrounded by lines of light. Huge letters arced above his head: "INVENTORS! COME WITNESS THE SHOWDOWN OF THE CENTURY." Glowering from the banner's corner, surrounded by ugly jagged lines, was a caricature of Pia Nalaar. The lettering at the bottom shouted: "HEAD JUDGE TEZZERET WILL FACE THE RENEGADE CRIMINAL PIA NALAAR. THE ULTIMATE BATTLE OF INGENUITY. THE GRAND EXHIBITION." Finally it read: "NOON TOMORROW!" "Chandra," Nissa said softly. "He's calling me out," Chandra said. "I have to face him." "He is. But we just got out of one trap..." "My mother is alive. That's all there is." Nissa looked back and forth between Mrs. Pashiri and Ajani. Ajani nodded. "That's all there is. But the four of us won't be enough to..." Three armed soldiers in Consulate uniforms were crossing the street toward them. One of them pointed directly at Nissa: "That's them—over there!" Nissa instinctively reached out to sense the living roots under the road, preparing to feed their growth to entangle the soldiers' legs. She wondered, with a glance upward, whether she could take this whole bridge down to cover an escape. Ajani snarled and reached for the shaft of the huge double axe on his back. Chandra was already ablaze, but her fingers bent as she faced them, readying little comets of fire. Even Mrs. Pashiri took action—she produced a small automaton, which spun a set of interlocking wheels and came to life. But as the soldiers approached, their forms swam and their silhouettes wobbled. Their very bodies seemed to trickle away in rivulets like watercolors, revealing something else in the canvas underneath. As the distortion cleared, their faces became familiar: Jace, Liliana, and Gideon. "It seems this is a matter for the Gatewatch," Jace said. Nissa abandoned her spell and wiped a hand down her face. "Your disguises work a little too well. We were about to injure you very badly." "Just trying to blend in," Jace said. "We heard Tezzeret is here?" "He's here, and he has Chandra's mother," said Ajani. "What's a leonin doing with you?" Liliana asked, sizing up Ajani. "What's a Gatewatch?" Ajani asked, looking down at her. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Unlike the dozen-dozen-dozen thopters patrolling the city, one particular thopter hovered in midair. It was identical to the dozen-dozen-dozen others, with its rotors humming and its lens swiveling within its glass cornea. This one, though, held itself in the air, having paused its route. Its aimed its lens down at several humanoids on the street below, and a tiny brass shutter snapped rapidly. A series of internal gears and prisms pressed the reflected light images into crystallized aether, frozen on little copper plates affixed to a drum within the thopter's chassis. Satisfied, the particular thopter tilted its stabilizers, spun up its auxiliary rotors, and gained altitude. The thopter buzzed past the rooftops and kept going, swinging past a vee of migratory cranes. It angled flaps to evade the flight pattern of an overly curious drake, and soared until it aimed itself at a dark shape on the sky. A small round port opened in the enormous wooden undercarriage of the airship #emph[Skysovereign. ] The #emph[Skysovereign] accepted the thopter and swallowed it whole, and the opening closed smoothly behind it. The thopter landed belly-down on a set of mechanical grippers attached to a conveyor belt, and the rotors buzzed to a halt. The grippers cradled the thopter as the belt carried them up through a lightless mechanical duct in #emph[Skysovereign's] abdomen. The grippers released suddenly, letting the thopter roll into light, and it rode a swifter conveyor through #emph[Skysovereign's] reconnaissance bay. It trundled there, dropping from one conveyor to another until it clicked into an ornate metal carousel. The carousel rotated, delivering the thopter into human hands. <NAME> set the thopter down on a desk. He flicked the cap of a tool, twisted the tool in the thopter's belly, and clicked open a panel. He removed the drum of images and held the plates up to the light. With each plate, he murmured to himself. He selected one in particular, one that showed the target, Nalaar, daughter of Renegade Prime. She and her compatriots had spied the banners. "Where's the courier?" <NAME> snapped. A young woman appeared, hands at the sides of her uniform. "Message, sir?" "Alert Inspector Baan. The bait is set. Prepare the confiscation." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Pia looked down at the links over her wrists and thought of her daughter. Jewel-like manacles bit into Pia's skin just as they had intoChandra's, just like that day when Chandra was eleven. Pia leaned her shoulder against the wall to which she was affixed, in one of the service tunnels behind the arena. "Backstage." #emph[It must have been just like this for her] , she thought. The waiting. Hot humiliation building. Just like that day, a man would smile at the crowd, preparing a metallic arm for a spectacle of violence. This was even the same arena, which Pia guessed was a special insult just for her. This was the place where Chandra had searched the stands for her mother before being torn out of the world. Pia's greatest hope was that she would not see Chandra in the stands today either. #emph[Just stay away, dear daughter,] she thought. #emph[Stay safe. Stay alive. ] The banners claimed this would be a quicksmithing exhibition—an inventor's duel using improvised materials, between the Head Judge and the infamous Renegade Prime. But she knew how lies worked. Tezzeret wouldn't display her just for the Inventors' Fair. She was bait. She could hear the loudspeaker filter through the walls from the arena outside. An announcer was proclaiming that Rashmi had won top prize at the Fair, to an explosion of cheers. The Head Judge's voice was a crackle of showmanship as he described all the benefits of the privilege of working at his side. More cheers, although the sounds were joyless and blunted by the corridors. An officer arrived with the jingle of two sets of keys. Pia didn't look up until the man spoke, because she recognized his voice—full of gravel and malice. "Ready to do your part, Nalaar?" Baral said, lifting off his mask. The pale burn scars on one side of his face pulled at his smile, making his back teeth visible on one side. Pia thrashed against her restraints, but calmed herself. A wave of revulsion swept through her, but she raised her chin and looked past him. "Whatever obsession you have with my family," she said, "whatever ill fragment of your brain tells you that punishing us can somehow make you worthy—it doesn't matter. Because nothing you do can ever harm her." "Oh, but of course you must not have heard," Baral chided her. "They came looking for you. In the entirely wrong place, sadly. A daughter's rescue attempt that sadly went awry." She flashed a look at him in horror, but remembered that his was a liar's face. She stared back out at the arena, and bit words through her teeth one at a time. "If you harmed a #emph[hair..] ." "We'll have to see, won't we?" Baral asked. "#emph[Will] she be here? When Tezzeret humiliates you out there, will she come for you?" #emph[Just stay away, daughter, ] she thought.#emph[ Please, do as your mother says, this once.] "It's time, Renegade Prime," he said. "If you'll come with me?" He took her restraints and pulled, but she yanked her wrists away and walked under her own power. They paused at a short flight of steps leading up to the glare of the noon-lit arena. Consulate guards escorted the elf Rashmi and several other inventors down the stairs past them. They were absorbed in breathless discourse. Excitement floated with them like cologne, to the point that they didn't even notice Baral removing the links of Pia's restraints, nor the guards gently separating them from their prizewinning inventions as they swept past. "And now, friends and citizens," purred the announcer. "We ask that you please remain in your seats for the final act of today's exhibition. The quicksmithing match that will surely be the talk of the Fair. Announcing the first competitor, your honorable director of the Fair, Head Judge Tezzeret!" Pia didn't even hear the cheers now—her mind raced. Through the doorway she scanned across the stands. She could see no renegades in the crowd, no Chandra, no sign of anyone she knew. Tezzeret's people must have maintained tight security on the entrants, weeding out all her allies—maybe she wouldn't be bait after all. Her only hope was to be as entertaining as possible, to win over the crowd—to do what she could to stay out of cells and manacles. "So glad I could be here to see you off," Baral said, his back teeth showing. "I would never miss the chance to say goodbye." #emph[What did ] that#emph[ mean? ] A cold feeling swirled in her gut. The announcer was calling her to the floor. "And now, friends and citizens, his opponent," the voice boomed. "She's the convicted aether criminal who failed to destroy #emph[your] Inventors' Fair...<NAME>!" Baral nudged at her back with a blade, and she stepped up to a chorus of jeers and boos. She walked over to her mark, eyeing Tezzeret. He stood across the arena, not even bothering to egg on the crowd. In front of her was a container covered in an embroidered cloth. An identical container sat before Tezzeret. The announcer's voice began as a hush, and built to a manic pitch. "Now, in this historic arena, we come to the final challenge. Now we decide who the greatest of these two famed inventors shall be. Keep your eyes on this match, citizens of Ghirapur, for it will truly define the future of our city and our world. Let the showdown...begin!" #figure(image("008_In This Very Arena/04.jpg", width: 100%), caption: [Fateful Showdown | Art by <NAME>], supplement: none, numbering: none) Pia whipped the cover from the container and quickly assessed its contents. An assortment of gears and metal plates. A few pieces of blown glass. A basic aether fuel line. Some rudimentary tools. Not much to work with. Not much that would thrill a crowd. She glanced up. Tezzeret was already rooting through his pieces. He had something with legs half-built already. #emph[So fast!] She jammed her hands into the container of supplies, and at the touch of metal parts, her inventing intuitions came to life. She played to her strengths, snapping and fitting and spot-welding. She let the components tell her what they wanted to be, like her old inventing days...and a basic four-winged design began to emerge. She gave it a light chassis for speed and a stinger on the nose. If only Kiran were here, he could bring it some additional maneuverability, maybe to play to the crowd a bit... #emph[Focus. Just get it flying.] She punched the aether line into the pinion assembly and the thopter came to life, to an audible "Ohhh!" from the crowd. She sent it buzzing at Tezzeret, hoping to distract him as she worked on her next design. Tezzeret had already built some silvery crawler of some sort. It unfurled, rising taller than him, displaying an undercarriage of sharp pincers and legs. The crowd clapped furiously. #emph[How did he make that from the provided parts? Is he even ] trying#emph[ not to cheat? ] The thopter orbited Tezzeret, slicing around his head with its stinger. He batted it away effortlessly as he sent the crawler toward her. #figure(image("008_In This Very Arena/05.jpg", width: 100%), caption: [Art by Izzy], supplement: none, numbering: none) She quick-fashioned a rudimentary servo, welding its plates into place even as it scurried away toward the crawler. The crawler scuttled forward and tore into the servo, ripping it apart. But Pia had embedded a surprise—a small detonator. The servo burst in a small sphere of smoke and pieces, and blew the legs off the crawler. A huge reaction from the crowd. #emph[Maybe I can do more than delay the inevitable. Maybe I can win.] Pia jumped forward to salvage parts from Tezzeret's crawler. Sure enough, it was full of parts she didn't have access to—and even metals Pia couldn't identify. She tore through its chassis and began harvesting it for another creation, hoping her thopter would continue to distract her opponent. She battled on, folding components together to create radical new designs. But no matter how clever her devices, Tezzeret threw back something that was impossibly faster, stronger, more durable. She was sure she was out-engineering him, yet his devices began devouring her own, consuming her supply of parts. She turned to dash back to her container, but a pointed metal limb stabbed into the floor beside her, and she fell. She looked up, and saw a newly-created crablike automaton, her thopter skewered on its leg. The thopter fluttered its wings weakly, and went dead. #figure(image("008_In This Very Arena/06.jpg", width: 100%), caption: [Art by Izzy], supplement: none, numbering: none) She glanced over at Tezzeret. He was striding over to her, raising his metallic right hand. Bands of metal curved unnaturally at his will, coiling in on themselves to become a small squad of other sharp-legged automatons. They stood up, a silver-shouldered and faceless army, and began to surround her. The crowd was chanting Tezzeret's name, cheering his victory. "You've lost, <NAME>," Tezzeret said, just loud enough for Pia to hear. "And now, in the very place where your daughter faced justice for her crimes, I will mete out proper justice for yours." He raised his arm, and the army of chrome automatons marched in toward her. The metal of the nearest automaton's chest rearranged itself, forming a sharp slicing limb. Tezzeret held his arm high, looking down at her with a gleam in his eye. #emph[He's not just playing to the crowd] , she thought. #emph[He's going to kill me] . Tezzeret slashed downward with his arm, and his metal creation attacked. Pia tried to roll out of the way, or to deflect the inevitable blow... The automaton dented, then lurched sideways and crashed onto its side, smoking from a glowing-hot wound. The crowd gasped, turning to the origin. The bolt of fire had streaked out of the audience, originating from an angry-looking, fire-haired young woman. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "#emph[Not yet!] " #emph["How many times have I told you, Jace?" ] Chandra thought back. "#emph[Least. Favorite. Words!] " Chandra leaped from the stands onto the floor of the arena. The illusion spell had done its best to conceal her, but fell away into shimmering shreds when she started in with the pyromancy. "#emph[We have to understand what's behind his presence here," ] came Jace's urgent thoughts. "#emph[Keep him occupied!"] Her mother looked surprisingly stern. "Chandra, get out of here right now," she said. "This is a trap!" "Uh, yes, I know?" Chandra said, gathering mana for a fresh fire spell. "And I'm here to bust you out of it." "That's just what he wants!" her mother snapped. "Leave me and go. #emph[Now] , young lady." "I'm not young anymore," Chandra snapped back. "And I'm #emph[not] losing you again!" "Is that you, the smaller Nalaar?" Tezzeret was pressing his asymmetrical hands together. "Joining the competition that your mother just failed? But this is so touching." Chandra could see spectators all around sitting forward in their seats, charmed by the family drama. "I'm not going to build against you, Tezzeret," she said. "But I am going to beat you." "But #emph[here] ?" Tezzeret cooed. "In #emph[this] #emph[very ] arena? Do you dare face me in the #emph[same place] where you were once about to be—" "YES," Chandra insisted. "I get it. Where I was about to be executed. Very poetic. Now can we #emph[please fight] ?" She focused on a spot on her palm, and a ball of fire grew in her hand. Whispers raced through the crowd. Consulate soldiers hurried in to surround Chandra, to arrest her. But Tezzeret raised a hand to halt them. He conferred briefly with one of the soldiers, then dismissed him and turned to face Chandra in a fresh light. His automatons turned along with him in unconscious puppetry. "I will face you, child," Tezzeret announced, now playing to the audience. His automatons took a step forward. "But just you versus me would not be much of a fair fight." Chandra tore the ball of fire in two, and both her fists went ablaze. "Nobody said anything about a fair fight." A host of illusions dissolved behind Chandra, and one by one, a team of Planeswalkers emerged. #figure(image("008_In This Very Arena/07.jpg", width: 100%), caption: [Dramatic Reversal | Art by <NAME>], supplement: none, numbering: none) Her compatriots drew weapons and readied spells. Chandra noticed that Tezzeret, for his part, took a nearly imperceptible step backward. After a moment of silence, the crowd came to their feet with a cacophony of shouts. As far as they knew, Chandra thought, this was part of the show, the dramatic finale of the exhibition. "Take them down, Head Judge!" some yelled. "Kick his ass, renegades!" others fired back. A few voices called out, "Tezzeret cheats!" "#emph[Chandra," ] came Jace's voice in her head. "#emph[I think his automatons are still blocking my telepathy somehow. You've got to get us in closer.] " "#emph[Blow up metal things] ," Chandra thought. "#emph[Got it] ." #figure(image("008_In This Very Arena/08.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) As soon as she saw Ajani and Gideon rush to protect her mother, Chandra unleashed. Fire flew, slamming like fists into Tezzeret's machines, felling one after another. One automaton melted on the spot. One got close enough to slice at her off side, grazing her cheek, but it immediately became the rusty centerpiece of a spontaneously-grown vine garden. At the bidding of Tezzeret's curved metal claw, scrap metal bent and reformed into new mechanisms, crawling under Chandra's blasts of fire and extricating themselves from Nissa's vines. As they advanced, Chandra threw punches that became jets of fire, dimly aware of Gideon and Liliana covering her flank, and Nissa and Ajani crushing a stray automaton that threatened her mother. The audience took a moment to decide exactly how to react. Frank displays of deviceless spellcasting were rare on Kaladesh. But Chandra could hear them opting to cheer on the spectacle. Tezzeret staggered back, and for the first time Chandra thought she saw a hesitation before his next assault. She thought at Jace. "#emph[Have you read him yet?] " "#emph[No," ] Jace thought, his mental state coming through like a swear word. "S#emph[omething's still blocking me] ." "#emph[Hurry up!] " "#emph[He's too closed off] ," Jace responded. "#emph[We've got your mother. I think we should go.] " Chandra looked at her mother, and back at Tezzeret. "#emph[I think I should end this. Right here.] " The flame on her fist extended down her arm, and her vision blurred with fire. Jace's thoughts had a tone of warning. "#emph[Chandra, if he knew to block his mind, it means he was prepared for this. He knew all of us were coming. We've made a mistake...] " Chandra's fist closed, compressing fire into a tiny point of blinding, seething heat. Her teeth clenched, and she trembled. #emph["I could just..."] Liliana's thought carried through the telepathy clear and sharp: "#emph[End him] ." A stark shadow passed over the arena, and Chandra looked up to see the airship #emph[Skysovereign] eclipse the sky. Its majestic bulk spanned the entirety of the arena, hovering with a droning churn of internal engines. An enormous turret swiveled on its underside, crackling with aether, its cannon aiming down—not firing, but threatening to fire. With a broad grin, Tezzeret announced to the entire arena, "And this concludes the Inventors' Fair, everyone. To the brilliant inventors of this world, I say sincerely—thank you." He gave a gracious little bow, and rose from the ground on a column of filigree steel. A panharmonicon played an anthem, and a few celebratory fireworks popped off the towers around the stadium. The sounds were garish and odd against the utter silence of the crowd. Chandra's eyes flicked down to the hot point of fire in her palm, and up to Tezzeret's rising face. He was retreating. After threatening her mother, he was getting away. "It's over," Nissa said quietly, next to her, and Chandra was startled how desperately she wanted someone to tell her that. "Another time. It's over." Chandra nodded to her, holding in a brimming wave of gratitude and relief. The pinpoint of fire compressed in her fist dissipated into nothing, forgotten. As a child of eleven, Chandra had looked across this arena, searching the stands, holding onto the slim hope that she might see her mother's face. She never did. Now, in this moment, she looked across the arena again, and found her simply standing there. Her mother held her arms open. Chandra ran and fell into them. Chandra had indulged in imagining a moment like this a thousand times, while staring out across the smoking volcanic flats of Keral Keep. If she could have just one moment with Mom again—what would it feel like? Would her mother still smell faintly of welding compound and rose petals? What would she say? What grand thing could she ever say that could sum up her affection, her gratitude, her longing to be home and safe with her again? She opened her mouth, and her eyes blurred, and all that spilled out of her was, "Mom…I'm sorry." Her mother murmured something comforting into her hair, pulled her in, and squeezed her close. #figure(image("008_In This Very Arena/09.jpg", width: 100%), caption: [Cathartic Reunion | Art by Howard Lyon], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Above them, Tezzeret rose and rose, the filigree unfolding to stretch him into the air. The #emph[Skysovereign] welcomed him into its hull, and closed up again with him inside. The panharmonicon continued playing in empty celebration. The crowd was silent as #emph[Skysovereign] slowly turned and moved away, and the sky turned bright again. It was only as people started to leave that Chandra heard them start to shout in protest. She moved through the crowd, her arm around her mother, and the others followed them out of the arena. She was starting to notice the new strands of iron gray in her mother's dark hair, and the lines in her face, when the crowd became dense with distressed faces, loud with rising panic. A woman with ornate golden ornamentation around her dress emerged, facing Chandra and her mother directly. "My name is <NAME>," the woman said, "and I must talk with you, and you, ma'am." Her face was deadly serious. "What is it?" Chandra asked. "What is happening?" "The inventions. They're gone." "What?" Pia and Ajani said simultaneously. "I think they took Rashmi and the others," Saheeli went on, "along with every device that was entered into the Fair. The winning inventions. The passion projects. Rashmi's breakthrough. They're all gone. Taken. I saw what you did in the exhibition...Can you help?" Now Chandra could hear what everyone around her was shouting about. They were inventors, competitors in the Fair. "My creation!" "I spent everything on that design!" "How could they just take them?" Consulate soldiers and automatons were out in force. She couldn't remember security being this tight when they entered the arena. "This was Tezzeret's plan," Pia said with a scowl. "This was all one gigantic distraction." "We have to get out of the stadium, and regroup," Jace said. "And then we have to stop him. He's planning something." Ajani snarled low. "He's #emph[building something] ."
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/rivet/0.1.0/src/range.typ
typst
Apache License 2.0
#import "util.typ" #let key(start, end) = { return str(start) + "->" + str(end) } #let bits(range) = { return range.end - range.start + 1 } #let parse-span(span) = { let start-end = span.split("-") if start-end.len() == 1 { start-end.push(start-end.first()) } let start = int(start-end.last()) let end = int(start-end.first()) return (start, end) } #let make( start, end, name, description: "", values: none, depends-on: none ) = { return ( start: start, end: end, name: name, description: description, values: values, depends-on: depends-on, last-value-y: -1 ) } #let load(start, end, data) = { let values = none let bits = end - start + 1 if "values" in data { values = (:) for (val, desc) in data.values { val = util.z-fill(val, bits) values.insert(val, desc) } } let depends-on = data.at("depends-on", default: none) if depends-on != none { depends-on = parse-span(str(depends-on)) } return make( start, end, str(data.name), description: data.at("description", default: ""), values: values, depends-on: depends-on ) }
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/par-justify-cjk_03.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test Variants of Mainland China, Hong Kong, and Japan. // 17 characters a line. #set page(width: 170pt + 10pt, margin: (x: 5pt)) #set text(lang: "zh", font: "Noto Serif CJK SC") #set par(justify: true) 孔雀最早见于《山海经》中的《海内经》:“有孔雀。”东汉杨孚著《异物志》记载,岭南:“孔雀,其大如大雁而足高,毛皆有斑纹彩,捕而蓄之,拍手即舞。” #set text(lang: "zh", region: "hk", font: "Noto Serif CJK TC") 孔雀最早见于《山海经》中的《海内经》:「有孔雀。」东汉杨孚著《异物志》记载,岭南:「孔雀,其大如大雁而足高,毛皆有斑纹彩,捕而蓄之,拍手即舞。」
https://github.com/sergiodrd/analisis_real
https://raw.githubusercontent.com/sergiodrd/analisis_real/main/tarea2/main.typ
typst
#import "template.typ": * #let title = "Tarea 2" #let author = "<NAME>" #let course_id = "MATE 5201" #let instructor = "<NAME>" #let semester = "C41" #let due_time = "20 de septiembre" #set enum(numbering: "a)") #set math.equation(numbering: "(1)", supplement: "la ecuación") #show: assignment_class.with(title, author, course_id, instructor, semester, due_time) #let contradiction = text($refmark$, size: 1.75em) Resultado auxiliar: Note que si $A, B$ son conjuntos, y $f: A -> B$ es inyectiva, entonces podemos hacer a $f$ biyectiva restringiendo su codominio: $f: A -> R_f$. Entonces: $mu(A) = mu(R_f)$. Entonces $ &R_f subset.eq B \ ==> &mu(R_f) lt.eq mu(B) \ ==> &mu(A) lt.eq mu(B) $ Similarmente, si $A, B$ son conjuntos, y $f: A -> B$ es sobreyectiva, entonces existe una función \ $g: B -> A$ inyectiva, pues usando el axioma de la elección puedes asignar a cada $b in B$ un elemento de $f^(-1)(b)$. Ahora: $ mu(B) lt.eq mu(A) ==> mu(A) gt.eq mu(B) $ #prob[ _(5 puntos) -- Demuestre que $ZZ times ZZ$ es contable, de forma explícita; esto es, construya una función biyectiva entre $ZZ times ZZ$ y $NN$._ == Prueba: Sabemos que la función $f: NN -> ZZ$ dada por $ f(n) = cases( n / 2 &" si" 2 divides n \ (1 - n) / 2 &" si" 2 divides.not n ) $ es una biyección por la demostración hecha en clase. Note que la inversa $f^(-1): ZZ -> NN$ dada por $ f^(-1)(n) = cases( 2 n &" si" n gt 0 \ 1 - 2 n &" si" n lt.eq 0 ) $ también es una biyección. Ahora considere $g: ZZ times ZZ -> NN times NN$ dada por $g(m, n) = (f^(-1)(m), f^(-1)(n))$ y suponga, por contradicción, que $g$ no es inyectiva, esto es: $exists m, n, k, j in ZZ$ tal que $g(m, n) = g(k, j)$ y \ $(m, n) eq.not (k, j)$. Ahora: $ &g(m, n) = g(k, j) \ ==> &(f^(-1)(m), f^(-1)(n)) = (f^(-1)(k), f^(-1)(j)) \ ==> &f^(-1)(m) = f^(-1)(k) " y " f^(-1)(n) = f^(-1)(j) \ ==> &m = k " y " n = j \ ==> &(m, n) = (k, j). contradiction $ Por lo tanto, $g$ es inyectiva. Por otro lado: $m, n in NN ==> f^(-1)(m), f^(-1)(n) in ZZ$ existen (por sobreyectividad de $f^(-1)$). Note que $(f^(-1)(m), f^(-1)(n)) = g(m, n)$. Por lo tanto, $g$ es sobreyectiva y una biyección. Sabemos que la función $h: NN times NN -> NN$ dada por $h(m, n) = 2^(m - 1) (2 n - 1)$ es una biyección por la demostración hecha en clase. Entonces, sabemos que $h compose g: ZZ times ZZ -> NN$ es una biyección, porque la composición de biyecciones es una biyección. $therefore ZZ times ZZ$ es contable. *MEP* ] #prob[ _(5 puntos) -- Pruebe que el conjunto $QQ$ de números racionales es contable._ == Prueba: Sea $F: ZZ times ZZ -> NN$ la biyección construida en el ejercicio anterior. Entonces: $ &F(m, n) = h(g(m, n)) = h((f^(-1)(m), f^(-1)(n))) = 2^(f^(-1)(m) - 1) (2 f^(-1)(n) - 1) \ ==> &F(m, n) = cases( 2^(2 m - 1) (4 n - 1) &" si " m", " n gt 0, 2^(2 m - 1) (1 - 4 n) &" si " m gt 0", " n lt.eq 0, 2^(-2 m) (4 n - 1) &" si " m lt.eq 0", " n gt 0, 2^(-2 m) (1 - 4 n) &" si " m", " n lt.eq 0 ) $ Note que, dados $m, n in ZZ$, siempre podemos encontrar biyecciones $phi: ZZ -> NN, psi: ZZ -> ZZ$ con \ $2 divides.not psi(n)$ tal que $g(m, n) = 2^(phi(m)) psi(n)$. Considere la función $f: QQ -> NN$ dada por $f(a / b) = F(a / gcd(a, b), b / gcd(a, b))$. Note que: $ &f(a / b) = f(c / d) \ ==> &F(a / gcd(a, b), b / gcd(a, b)) = F(c / gcd(c, d), d / gcd(c, d)) \ ==> &2^(phi(a / gcd(a, b))) psi(b / gcd(a, b)) = 2^(phi(c / gcd(c, d))) psi(d / gcd(c, d)) $ Sin pérdida de generalidad, suponga que $phi(a / gcd(a, b)) gt.eq phi(c / gcd(c, d))$, entonces: $ &2^(phi(a / gcd(a, b)) - phi(c / gcd(c, d))) psi(b / gcd(a, b)) = psi(d / gcd(c, d)) $ Pero como $2 divides.not psi(d / gcd(c, d))$, tenemos que: $ &phi(a / gcd(a, b)) - phi(c / gcd(c, d)) = 0 \ ==> &phi(a / gcd(a, b)) = phi(c / gcd(c, d)) ==> a / gcd(a, b) = c / gcd(c, d) "(1 a 1)" $ Sustituyendo en (6), tenemos: $ psi(b / gcd(a, b)) = psi(d / gcd(c, d)) ==> b / gcd(a, b) = d / gcd(c, d) "(1 a 1)" $ Multiplicando las ecuaciones (7) y (8), tenemos: $ &(a d) / (gcd(a, b) gcd(c, d)) = (b c) / (gcd(a, b) gcd(c, d)) \ ==> &a d = b c \ ==> &a / b = c / d $ Por lo tanto, $f$ es inyectiva. Entonces, por el teorema de equivalencia demostrado en clase, $QQ$ es contable. *MEP* ] #prob[ _(5 puntos) -- Sea $A$ un conjunto incontable, y sea $B subset.eq A$ contable. Pruebe que $A tilde A without B$._ == Prueba: Sea $C subset.eq A without B$ contable. Como ambos $B$ y $C$ son contables, podemos hablar sobre una biyección $f: B -> C$. Ahora, considere el mapa $phi: A -> A without B$ dado por $phi(a) = cases( f(a) &" si" x in B, a &" si" x in.not B )$ Note que: $ phi(a_1) = phi(a_2) $ Caso $phi(a_1), &phi(a_2) in C$: $ ==> &f(a_1) = f(a_2) \ ==> &a_1 = a_2 $ Caso $phi(a_1), &phi(a_2) in.not C$: $ ==> &a_1 = a_2 $ Por lo tanto, $phi$ es inyectiva. Pero $A without B subset.eq A ==> mu(A without B) lt.eq mu(A)$ y $phi: A -> A without B "inyectiva" ==> mu(A) lt.eq mu(A without B)$. Por lo tanto, $mu(A) = mu(A without B) ==> A tilde A without B$. *MEP* ] #prob[ _(5 puntos) -- Un número $z in CC$ es algebraico, si existen número $a_1, a_2, ... , a_n$ tales que_ $ sum_(k = 0)^n a_k z^(n - k) = 0. $ _Si $S := { z in CC | z "número algebraico" }$, demuestre que $S$ es contable._ == Prueba: Sea ${ p_n }$ la secuencia de los números primos con $p_1 = 2, p_2 = 3, p_3 = 5, ...$ Ahora considere el mapa $f: ZZ [x] -> NN$ dado por $ f(q) = product_(k = 0)^(deg(q)) p_(k + 1)^(g(a_k)) $ donde $g: ZZ -> NN$ es una biyección (sabemos que existe) y $a_k$ es el coeficiente de $x^k$ en $q$. Note que: $ f(q_1) = f(q_2) ==> product_(k = 0)^(deg(q_1)) p_(k + 1)^(g(a_k^((1)))) = product_(k = 0)^(deg(q_2)) p_(k + 1)^(g(a_k^((2)))) $ Por el teorema fundamental de la aritmética, esto implica que $deg(q_1) = deg(q_2)$ y \ $g(a_k^((1))) = g(a_k^((2))) " " forall k in { 1, 2, ..., deg(q_1) }$. Pero como sabemos que $g$ es biyectiva, entonces $a_k^((1)) = a_k^((2)) " " forall k in { 1, 2, ..., deg(q_2) }$, pero esto quiere decir que $q_1 = q_2$. Por lo tanto $f$ es inyectiva. Por el teorema de equivalencia demostrado en clase, $ZZ [x]$ es contable. Considere $B_(p(x)) := { z in CC | p(z) = 0 }, " " p(x) in ZZ [x] without { 0 }$. Note que, por el teorema fundamental del álgebra, $B_(p(x))$ es finito $forall p(x) in ZZ [x] without { 0 }$. Por lo tanto, $ U := union.big_(p(x) in ZZ [x] without { 0 }) B_(p(x)) $ es contable, pues es la unión contable de conjuntos finitos. Pero: $ &z in U ==> exists p(x) in ZZ [x] without { 0 } "tal que" p(z) = 0 \ ==> &z "es algebraico" ==> z in S ==> U subset.eq S $ y $ &z in S ==> z "es algebraico" ==> exists p(x) in ZZ [x] without { 0 } "tal que" p(z) = 0 \ ==> &z in B_(p(x)) ==> z in U ==> S subset.eq U $ $therefore U = S$ $therefore S$ es contable. *MEP* ] #prob[ _(5 puntos) -- Sea $f: RR -> RR$ una función, y definamos:_ $ A := { a in RR | lim_(x -> a) f(x) "existe, y " lim_(x -> a) f(x) eq.not f(a) }. $ _Pruebe que $A$ es a lo más contable._ == Prueba: Si $A = nothing$, $A$ es finito y terminamos. Ahora, para cada $a in A$, sabemos que $lim_(x -> a) f(x)$ existe. Por lo tanto, existe un intervalo $(alpha, beta)_a$ tal que $(alpha, beta)_a sect A = {a}$. Ahora escoja estos $alpha, beta$ tal que cada intervalo sea disjunto. Ahora escoja un $q_a in (alpha, beta)_a sect QQ " " forall a in A$. Entonces $B := { q_i } subset.eq QQ$ es a lo más contable. Note que $f: A -> B$ dado por $f(a) = q_a$ es biyectiva por construcción. $therefore A$ es a lo más contable. *MEP* ] #prob[ _(10 puntos) -- Demuestre que el conjunto $RR$ de números reales es incontable, de la siguiente forma:_ + _(5 puntos) -- Desmuestre que $RR tilde (0, 1)$._ == Prueba: Considere el mapa $f: RR -> (0, 1)$ dado por $f(x) = 2^(-2^x)$. Note que: $ f(x) = f(y) ==> 2^(-2^x) = 2^(-2^y) ==> -2^x = -2^y ==> 2^x = 2^y ==> x = y $ por la unicidad de exponentes reales. Entonces $f$ es inyectiva. Además: $ x in (0, 1) ==> exists 2^x in RR ==> exists -2^x in RR ==> exists 2^(-2^x) in RR ==> exists f(x) in RR $ por la existencia de exponentes reales. *MEP* + _(5 puntos) -- Pruebe que $(0, 1)$ es incontable. Concluya entonces que $RR$ es incontable._ == Prueba: Suponga, por contradicción, que $(0, 1)$ es contable, entonces sea ${x_n} = (0, 1)$. Note que cada $x_i$ tiene una expansión decimal, entonces tenemos: $ &x_1 = 0.a_1^1 a_2^1 ... a_j^1 ... \ &x_2 = 0.a_1^2 a_2^2 ... a_j^2 ... \ &... \ &x_i = 0.a_1^i a_2^i ... a_j^i ... \ &... \ $ donde $x_i eq.not 0.9999... and x_i eq.not 0.0000... forall i in NN$. Ahora construya $y in (0, 1)$ como $y = 0.b_1 b_2 ... b_i ...$ donde $b_i eq.not a_i^i " " forall i in NN$. Note que $y in.not {x_n} = (0, 1). contradiction$ *MEP* ] #prob[ _(5 puntos) -- Sea $S := { f:RR -> RR "función" | D_f = RR }$. Demuestre que $S tilde.not RR$; esto es, demuestre que no existe biyección de $S$ a $RR$._ == Prueba: Usando esto, considere el mapa $phi: S -> P(RR) without nothing$ dado por $phi(f) = R_f$. Ahora, dado $A in P(RR) without nothing, a in A$, podemos construir una función $f: RR -> A$ de la siguiente manera: $ f(x) = cases(x &" si" x in A, a &" si" x in.not A) $ Note que $D_f = RR$ y $A subset.eq RR$, por lo tanto $f in S$, entonces se cumple que $A = phi(f)$. Entonces $phi$ es sobreyectiva. Entonces, $mu(S) gt.eq mu(P(RR)) gt mu(RR) ==> mu(S) gt mu(RR) ==> S tilde.not RR$. *MEP* ]
https://github.com/ChrisEnv/letter-typst
https://raw.githubusercontent.com/ChrisEnv/letter-typst/main/README.md
markdown
## Creating a New Article If you would like to add the clean theme to an existing directory: ``` quarto install extension chrisenv/letter-typst@current ``` or you can use a Quarto template that bundles a .qmd starter file: ``` quarto use template chrisenv/letter-typst@current ``` ## Usage For example: `quarto render vision.qmd --to letter-pdf` or in your document yaml ``` yaml format: letter-pdf: default ```
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/051%20-%20March%20of%20the%20Machine/009_Innistrad%3A%20Family%20Game%20Night.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Innistrad: Family Game Night", set_name: "March of the Machine", story_date: datetime(day: 22, month: 04, year: 2023), author: "<NAME>", doc ) My dearest brother— How I wish you would visit me here in Engelturm! The grounds are lovely, and the angels who once lay claim to this place have left a surprising array of tools geared toward the destruction and dismantling of the dead. In their haste to unmake the workings of your kind, dearest brother, they became expert butchers of skaabs. I think you would benefit from touring their workshops. And of course, the grounds are properly unhallowed, after their long absence and the occupation of so many unsavory things. Really, you would find it most soothing. I certainly do. I know it stings your pride that I have not chosen to settle in Havengul even after leaving my beloved Thraben behind. How it must ache, to have your best-beloved sister so close at hand and yet refusing to enter the gates of your sterile, industrial city! But fear not, darling brother, for I remain close enough for you to visit, if you did not put the needs of your "research" above those of your only surviving family. If you had not already demanded I lay our parents to rest, they would surely be shambling over to scold you now, you unfortunate, uninspired mockery of a ghoulcaller. What you do is no more than a pale imitation of my art and will never rise beyond the level of simple science to that of towering inspiration. Those white branches in the midnight sky were a lovely display, like latticed lightning. Was that your doing, brother? Perhaps you've found your true calling and can finally properly leave the dead to me. I would wish you well, but you have long since walled yourself off from anything more than misery, and so I will only wish you endurance. May you survive long enough to see all that you have built fall to dust and rot to nothing, as your supposed "genius" must one day do. Your adoring sister, Gisa. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gisa— I am #emph[not] regretting the choice to tell you my lab was too small for the both of us, thank you very much, and if you took that as me ordering you out of Havengul entirely, that is on your head, not mine. I never asked you to come here. I never asked you to move in with me. Go bother Jadar. I'm sure that old-fashioned churl is raising something horrible and dull that you could get involved with, if you asked him #emph[very] nicely. I, on the other hand, am busy. Corpses have been washing up in the estuary of late which defy all attempts at stitching. Ludevic has given me the great honor of researching this phenomenon, and I simply don't have time for your antics. Go play with something dead, and leave me alone. White lines in the night? No. Those are a natural phenomenon of some sort, and nothing of mine. If the cosmos wishes to rip itself to pieces, that is its own business, and so long as it remains outside my lab, I will leave it alone. I suggest you do the same. Geralf. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Boredom and <NAME> were not good companions. Oh, they had come together many times over the years, for an afternoon or a weekend getaway, but those encounters inevitably ended with the local population trying to literally #emph[get away] , while Gisa cackled and called their dead relatives from the ground to make things more interesting. Thraben had been boring after all the living people were gone and she was left with no one to keep her company but her beloved dead. Havengul wasn't that much better. Certainly, it had more than its fair share of the living, each of them ripe for the grave, but they were so preoccupied with petty pleasures and silly science that they were barely any fun. Even her own brother, dear, disgusting Geralf, was more interested in his research than in keeping her entertained! Why, she had agreed to a round of his rotten NecroWarfare, rules and all, and still he had stayed at his drafting desk, leaving her to make her own fun. The Engelturm was fun. Watching her darling creations defile the works of angels was delightful, and it became amusing anew with each day's dawn, as the sun struggled to purify what she had dirtied during the night. None of the local vampires bothered her, out of fear of Jeleva, and Jeleva had been unwilling to come anywhere near her since a single chance encounter left the undead wizard with the distinct impression that devouring Gisa's mind would somehow damage her own. As if anything could be other than improved by the influence of <NAME>! She sat on the edge of a crumbling wall, letting an undead snake slither between her fingers, sloughing skin and scale with every motion, and waited for something to happen. Much like a carrion bird, she had found that if she waited long enough, something would #emph[always] happen, and then #emph[she] could happen to whatever it was. Patience was often its own reward. A small group of bipedal figures shambled out of the Silburlind River, their skins glistening silver in the afternoon light. Gisa rose, dropping her snake, and moved to look closer. The silver wasn't an artifact of the river; it was the light shining off patches of hard, serrated metal, like these people belonged to her brother. Gisa brightened. Perhaps her brother was taking her up on the offer of a game after all! But the figures strode, rather than shambling, and as she watched, one of them drew a sword that gleamed with some sort of glistening, oil-like substance, slicing one of her sweet, innocent ghouls cleanly in two. #figure(image("009_Innistrad: Family Game Night/01.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) Gisa's mouth fell open in furious shock. Geralf was the one who insisted they play by stupid #emph[rules] , not her! And his rules included both facing off at a predetermined place and time—a rule she'd been willing to overlook in exchange for the opportunity to play—#emph[and] a prohibition against magical swords! Swords that glistened with toxic rainbows and could cleave a ghoul that easily definitely counted as magical. Gisa scowled, whistling a long, low note. All around her, the dead she had risen for her own amusement turned toward the cluster on the shore. She whistled again and they began their advance. The metallic people—who weren't skaabs after all, judging by the way they bled black oil, not viscus vitae, when her obedient creations ripped them limb from limb—fought brilliantly and hard, but in the end, they were outnumbered by a factor of dozens. Gisa waited until they had stopped so much as twitching when prodded, then slid off her wall and walked slowly, deliberately toward the estuary. "You weren't invited to play with us," she told one of the more intact corpses, glaring at its open, empty eyes. "But now you can join the game, if you'd like." She whistled, more sharply this time, and watched as the corpse pushed itself, swaying, from the ground to join her remaining hoard. "Very good," she said, and turned away. The sound of something falling made her turn back and frown. The ghoul she had just called was sprawled in the mud, motionless. Gisa whistled, reaching for the almost palpable feeling of death that hung in the air around her, and found not a trace of her ghoulcalling's motivating force inside the corpse. It was no ghoul. It was just a body, just meat. She called it again, and again it rose, and again it fell as soon as she allowed her attention to wander. Eyes a little wide and heart beating a little fast, Gisa approached the corpse, prodding it with the toe of her boot. It didn't react. This had never happened to her before. Whistling for her ghouls to follow her, she retreated into the walls of the Engelturm. It was time to call a messenger bird. It was time to talk to her brother. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Dear meat-mangler— Your most recent message was most unwelcome, and I begin to regret moving so close to you. Were you responsible for the ridiculous abominations which shambled from the estuary this afternoon to ruin my lovely day? Whatever you have done to these corpses is vile and inappropriate. They refuse to respond properly to good, honest ghoulcalling, but insist on collapsing into lifeless heaps as soon as I turn my back. You have done something I would have thought impossible, brother dear. You have ruined the undead. Do not do this again. (No) love, Gisa. PS: The sword was a nasty trick. You're the one who said no swords, and now you give your terrible mistakes of science swords covered in oil to attack my creatures with? Bad form, Geralf. Bad form. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Dear Gisa— DO NOT LET THE OIL TOUCH YOU! I know you are clever, my sister, to have lived this long. The oil you saw is a contagion carried by the bodies that have come out of the estuary. An old associate of Ludevic came to visit recently. He was a very strange man, even by local standards, with white hair and a cold manner. The two of them fought, at length, before the man departed. Ludevic told me of these invaders shortly afterward, and said they are properly called "Phyrexians." (Unrelated, he has elected to trust me with the defense of Havengul while he visits a former student in Selhoff.) These creatures are not my creation. They belong to Phyrexia, and they seek to destroy all that makes Innistrad itself. They wish to transform our glorious home into one more outpost along their long road to empire. Now that they have reached Havengul, we will need to find a way to hold them back, or all, even the dead, may yet be lost. One point in our favor: it seems their oil first affects the living mind, and thus cannot infect the risen dead of Innistrad, whether ghoul or skaab. We can safely combat these Phyrexians, when so few others are. I admit I envy you the ability to sway them to your side even briefly; I cannot raise a corpse that has been tainted by their oil, however adroitly I stitch (and I am limited by the need to avoid my own infection). Geralf. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gisa looked between the letter and the estuary, which seethed and pulsed with the bulk of the bodies now emerging from it. These "Phyrexians" came in every shape and size, from humans to transformed werewolves and other such delightful horrors. They would make an excellent opponent. Although their unpredictable numbers meant they couldn't be her opponent on her own. Quickly, she jotted down her response and tied it to the leg of Geralf's messenger~ thing, which he had sent back in place of her good, honest, undead crow. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Brother— If anyone is going to destroy Innistrad, it's going to be us. I propose NecroWarfare, us united against Phyrexia, winner take all. If I win, I can have Havengul. If you win, which you won't, since you have finally admitted my superior power, I will grant you the Engelturm, while I return to Gavony. Let's wreak some havoc. Your sister, Gisa. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gisa— It's on. Geralf. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Geralf's first salvo in the fight was roughly what Gisa would have expected. A wave of terrible creations swarmed over the walls of Havengul to meet the Phyrexians between the river and the city. Many of them had three or more arms; some had three or more #emph[heads] . They were horrors beyond comprehension, and they crashed into the growing wave of Phyrexians without hesitation. Watching from the walls of the Engleturm, Gisa nodded. The Phyrexians were focusing their attentions on the city, by and large, leaving her alone. That would change once the battle began in earnest, she was sure, but for now, she could watch. Her brother was creative, she had to admit that. Craggy-backed turtles soared above the Phyrexians on eagle's wings, only to drop from the sky and explode when they hit the ground, peppering the Phyrexians in shrapnel and slime that ate away at their oil-pitted flesh. Still, his hulks were quickly felled, and while he showed a remarkable amount of creativity—for him—in the amalgamations he threw at the opposing army, he was still too wedded to the idea of the human form. His imagination was his limit, and Geralf had always been deeply limited. Gisa sighed. Time for her to get involved. Well, it wouldn't be a game if she didn't get to play. The air was so thick with residual deaths of thousands across Innistrad that she could taste it on the back of her tongue every time she breathed in, lighting up her mind like a firework exploding in the sky, and so she breathed in deep, pulling as much of that death into herself as she could hold, until she felt like she was on the verge of bursting. Then she whistled. It was a long, low note, and the few living things close enough to hear it shivered, feeling as if their bones wanted to rip themselves free and join the endless harvest of the dead. Their skeletons twitched and then settled, uncompelled, and deep in the estuary mire, well away from the city walls, something stirred. Gisa stopped whistling and cackled in manic glee as the undead moondrake she had called from the muck rose, majestic, into the sky. Its wings were laced with holes, but enough of the leathery membrane remained to let it catch and climb the air, pulling itself ever higher. More ordinary ghouls pulled themselves from the muck and shambled toward the Phyrexian forces, moaning and wailing her challenge. The moondrake soared above them, and as it flew, it roared. Let's see Geralf top #emph[that] . #figure(image("009_Innistrad: Family Game Night/02.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) Gisa sat smugly back to watch the carnage, only to straighten again as another moondrake rose from the Phyrexian mass, this one peppered with tubing and dripping with more of that damnable oil. After Geralf's warning, she had kept herself well clear of the stuff. As he had promised, it didn't bother her deceased darlings, but it still got everywhere and obscured the finer details of the fight. Perhaps more importantly, creatures that showed traces of it no longer cared about self-preservation, being as willing to die for Phyrexia as her ghouls were to die a second time, for her. Maybe that was why she couldn't keep hold of Phyrexian toys. Maybe they were their own form of undead, and like the nasty fluids Geralf and his fellow Stitchers used to reanimate their skaabs, the oil meant that she couldn't bring them back a second time. Whatever they were, it was better than skaabs. A broken skaab was broken for good, and no amount of calling and cajoling would get it to rise again. At least a broken Phyrexian could be of use, even if it took more work than it was worth. The moondrakes slammed into each other as the lines of Phyrexians and ghouls collided. #emph[Their] moondrake had jagged metal teeth and used them to lay open the belly of her creation, dumping its rotten insides out on the fighters below in a wet, sloppy tangle. The sudden loss of mass granted Gisa's moondrake a lift, allowing it to rise several feet above its opponent and lash down from above, jaws clamping onto the neck of the other drake just below the head. The Phyrexian moondrake tried to shake it off, but the superior height of Gisa's moondrake left it with the advantage, and soon enough, both crashed to the ground, where her drake ripped the other's head clean off before wading into the fray on its own four legs, tail lashing. Its wings were shredded beyond repair, but she had forced the Phyrexia forces to expend part of their own air defense; the fact that they hadn't used the moondrake against Geralf's flying turtles probably meant that they'd been planning something around it, and now she'd spoiled that. Smug, Gisa, directed her ghouls deeper into their forces, viewing each one she lost as a reasonable cost for the limbs they were wrenching from their opponents. Headless Phyrexians tended to stay down, she noted, unless they had moved their minds to other parts of their body; some of them had faces imbedded in their chests, implying a much more streamlined arrangement of organs. Those, she whistled her ghouls to aim for where she assumed the controlling nerves would be, aiming to incapacitate as much as kill. The Phyrexians seemed to have as little concern for their fallen as her ghouls; bodies, once they went down, tended to stay that way. That was good. They did, occasionally, try to drag the more intact corpses away so they could construct new Phyrexians from the remains, like they aspired to take her brother's place. That was bad, and naughty, and not to be allowed. And even as all this was going on, still more Phyrexians rose from the estuary. As she scowled at them, one of the risen seakites she was using as sentries around the Engleturm cawed a loud and furious warning, and she turned to look that way. More Phyrexians were approaching overland, and these ones seemed less likely to ignore her stronghold than the ones between the estuary and the city. This second force's current path would take them directly past the Engleturm. "I said three-way, not four-way," she said furiously, standing. "Bad Phyrexians! Cheaters!" And onward marched the invading army. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Inside the walls of Havengul, Geralf stitched as he had never stitched before, slamming bodies onto tables, moving between them with a speed that spoke of assembly rather than artistry. His gloved hands were shaking as he turned over a particularly battered body, searching for the telltale signs of the Phyrexian oil. Here, privately, where she would never know, he could admit that Gisa's art was superior to his in this single, solitary regard: she didn't have to get her hands dirty if she didn't want to. And oh, she frequently wanted to, but this game didn't risk her life as it risked his own. His skaabs were under strict instructions to avoid contaminated corpses, but there was only so much a rotting brain could do to verify the condition of the things they were bringing him. Most of the work was still his own. At least there were plenty of corpses to be found. Even when a Phyrexian soldier killed someone, the body wasn't #emph[always] contaminated, and his skaabs were bringing him raw materials almost faster than he could sew. The corpse cobbling was the longest part of the process, since he couldn't trust the seams to anyone else, and all his living assistants were~ unavailable, at this point. Once the bodies were properly assembled, he could attach the binding plates to the key elements of his creation, keeping the body's individual donors from ripping themselves apart when called back to life, and begin forcing the viscus vitae through the piping he had previously installed to drain the blood and ichor from the existing veins. While that was happening, he was already moving down to the next body or bodies in the line, either reaching for the needle or beginning to chant the vox quietus that would awaken the creature. He didn't have time for the normal instruction and education that would follow; instead, as soon as his reborn skaab rose, still puzzled and innocent of the world around it, it would be armed, equipped with the basic information on what a Phyrexian was and how to destroy it, and sent out to defend the city. What was left of it. The Phyrexians must have broken through the gates by now, and the screams from outside the laboratory were becoming less frequent, making him suspect that the population of Havengul was dropping while he worked. As long as the lab remained secure, his work would continue, and thanks to Ludevic's genius, they had so many secret tunnels and exits to push skaabs through that the Phyrexians would never figure out where he was. Or so he hoped. He was moving on to another table when the doors to the largest of those hidden tunnels swung open and a group of the skaabs he'd set to gathering raw materials entered, half-carrying and half-dragging a massive beast. Geralf blinked. "Put it on the #emph[big] slab," he said. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gisa was directing another group of ghouls to rip the Phyrexians away from the Engleturm walls when a bellowing roar rose from the direction of the city. She turned. So did the Phyrexians. Her ghouls, being far more difficult to distract, kept attacking, making a solid inroad on the enemy. A towering beast stepped over the Havengul wall, its antlers jutting upward from its thick caprine skull like spreading hands filled with moss and leathery flaps of skin, its long, sturdy legs augmented with pistons and what looked like an entire dead bear. No wings this time, but still, it was reasonably impressive, for one of her brother's efforts. Gisa laughed and clapped her hands as the colossal behemoth began trampling Phyrexians. Where had Geralf's skaabs even managed to #emph[find] the thing? It looked like one of the creatures that were sometimes found in the forests where Gavony bordered on the Kessig forest. She had never seen one this close to the sea. He must be running low on raw materials if he was sending his scavenging parties #emph[that] far from the city. Well. She couldn't allow a worthless flesh-fixer to have the biggest toy on the battlefield. Digging her heels into the stone beneath her feet, Gisa reached deep into the energy of a wounded Innistrad, pulling death into her until her veins sang and her blood was fire, until she could feel every dead and dying thing for miles in every direction. Thus, armed against the world of the living, she began to call. Not a whistle this time: a full-throated song, wailing her demands to the space beyond the grave. She reached and reached, looking for the largest target she could find, and her questing power brushed against something terrible, vast and chitinous, buried in the mud at the very bottom of the Silburlind estuary. It had been there for a while, washed up by powerful currents, but it was fresh enough to respond when she sang, stirring below the water. Roaring fury and snapping all nine sets of terrible claws, Gisa's terrible new plaything rose from the bottom of the estuary and began lumbering toward the land on row after row of sharp, serrated legs. It combined the claws of a great crab, the tentacles of a kraken, and the chitinous body of a lobster in a horrible configuration never meant to be seen above the waves. The Phyrexians not already engaged with Geralf's great beast turned toward this new threat, recognizing it as a possible end to the battle if not put down. The survivors who had been trying to breech the Engleturm pulled away from the still-aggressive ghouls and moved to join the rest of their company, forming a greater force between the creature and Havengul. Panting and weary from the effort, Gisa sank back to her seat, laughing as she watched the Phyrexian army crash against her armored colossus. They stabbed and cut and tore, swinging those gleaming swords and striking with claws or scorpion tails that dripped oil from their tips, and her new favorite toy snapped them in two, claws scything like scissors through Phyrexian torsos. It didn't have the precision to aim for the neck every time, but her ghouls were there, going cleanup, decapitating, and dismantling as the creature ambled by. The forces at the city wall were hacking away at the legs of Geralf's behemoth, and with a final, earth-shaking bellow, it fell, crashing to the ground and crushing several Phyrexians in the process. Their fellows tried in vain to free them, then moved to join the assault against Gisa's creature. The terrible sea-beast continued snapping them in two, but its legs, armored as they were, remained its weakest point. They were thin and insufficient for locomotion on land, restricting its speed and opening its joints to attack. The Phyrexians began hacking away at its legs. Gisa stopped laughing. She glared at the Phyrexians chopped the legs out from under her creature. Like the behemoth before it, it fell, and its size was such that the top of its head took out a portion of the city walls. Gisa, although exhausted, whistled up another swarm of more ordinary ghouls, setting them to defending her own stronghold. Maybe Geralf's silly rule about never attacking anyone in their headquarters wasn't so silly after all. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gisa— Beloved sister. This terrible new opponent moves too quickly for our resources unless we bring them together. While my science destroys corpses for your use even as Phyrexia destroys them for mine, we both know well that I can make use of bodies you have already cast aside, but only if you rescind your claim on them. My skaabs are ready to retrieve both our greatest accomplishments from the city walls, and I believe they can do so without taking unacceptable losses, if we both focus our troops on the Phyrexians in that area. Only release your giant lobster into my care, and we can turn the tide of battle in our favor. Geralf. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gisa, who had been sulking over the loss of her beast, decided to rage instead. She raged Geralf's letter right over the edge of the wall, down into the battle below. She raged the skaab he had used to deliver it into several pieces, and when that wasn't enough, she raged a series of rocks after the letter, throwing them as hard as she could. Sadly, and unlike when they had been children, her tantrum accomplished nothing beyond rubbing her throat raw, breaking a perfectly good messenger, and attracting the attention of several Phyrexians. She whistled a group of nearby ghouls into attacking them before they could begin to climb the walls, then grabbed for her letter kit, which she had kept at hand to make a gracious response to Geralf's inevitable surrender. Better to let him repair a broken toy than to run out of corpses with no way to escape the Phyrexian forces. Whatever they were, it was something she had no interest in becoming. When #emph[she] died, she was going to rise from the grave the #emph[right] way, as a Cecani always did. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Dear beloved, gristle-gargling abomination of a brother— My lobster is very broken. I suppose you can't make it any worse. If your creations can drag it back to your lab, I'll let it go. But you'll owe me! Gisa. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Geralf didn't bother to reply before setting his skaabs to recovering the bodies of both monsters. They dragged them over the wall, crushing several houses, and along the streets to a square generally used for marketplaces and civic gatherings. #figure(image("009_Innistrad: Family Game Night/03.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) The trouble with this plan was that the lab would never contain both creatures. It had been a struggle to get the behemoth alone in and then out again. For him to perform this most epic act of science, he would need to expose himself to the possibility of attack. Several of his larger creations had already toted the equipment he would need out of the lab, while a group of hunters cleared out the nearby Phyrexians—which included, he had been sorry to note, a few locals he'd been keeping an eye on for eventual acquisition, once Ludevic approved winnowing the populace. Well, they were ruined now, along with so many others. But none of that would matter once his creation rose. Once he accomplished this, he would officially be recognized as the greatest stitcher who had ever lived. Grabbing the drill he would need to create seams through the beast's chitinous armor, he grinned to himself and set to work. This would be his masterpiece, his greatest and most terrible creation, and when it rose, all of Innistrad would know his name. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Gisa whistled frantically, grabbing control of fallen Phyrexians and using them to beat their former allies to death before letting them go and searching for more honest corpses. They were almost out. The seemingly inexhaustible dead of Nephalia were close to being, well, exhausted. Soon enough, her army would be broken, and while Geralf's creations were doing their best to hold the line, her worthless brother had stopped adding anything to the fight as soon as she'd released her broken beast. Wrapped up in his own little experiment again, no doubt, and too preoccupied to care about #emph[Gisa's] needs, #emph[Gisa's] problems, the fact that #emph[Gisa] was about to be overrun by Phyrexians— A familiar, earth-shaking bellow rose from behind the Havengul walls, underscored with a deep gurgling sound, like it was rising through thick mud. Gisa took her eyes from the fight long enough to turn and see the unspeakable fusion of behemoth and aquatic nightmare as it rose from the city, claws clacking and antlers poised to gore. Its new legs were longer, and it stepped easily over the walls as it charged into the Phyrexian mass, razored claws slicing Phyrexians in two, leaving their bodies to scatter the ground. Its hooves promptly pummeled them into mush, rendering them too broken to get up again even before Gisa whistled her ghouls back into the fray to relieve them of the burden of having heads. The Phyrexians at her walls hurried to try and turn the tide, too late. Gisa whistled and Geralf laughed, watching the last of the attacking forces as they fell, screaming, before the tide of the dead. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The bonfire had been Gisa's idea, of course. Skaabs were notoriously flammable, while her ghouls only burned as fast as living people would. Still, they had to do #emph[something] about the dead Phyrexians, since they were useless for all decent necromantic purposes. The siblings sat on the Havengul city wall, watching their creations feed the fire, enjoying the momentary peace. And then Geralf had to go and ruin it. "I'll miss you, sister." "Miss me? Why would you #emph[miss] me?" Geralf shrugged, eyes on the fire. "Why, because you're returning to Gavony, of course. The terms of our agreement, as you may recall. If I won, you would give me the Engleturm, and go." "You couldn't have won if I hadn't given you my toy! This doesn't count as a victory. I'm not going anywhere." "Your toy, which was so vital that it collapsed as soon as the fight was done? Please." Even with new legs, the great beast had been unequipped to exist outside the water, and had collapsed shortly after the battle, broken beyond even Geralf's ability to repair. "Neither of us won," Gisa snapped. The two continued to bicker as the survivors of Havengul huddled in their homes, armies of the undead squaring up in the wide plain outside the estuary, ready to resume their eternal fight. Some things are beyond even Phyrexia's ability to change.
https://github.com/lucannez64/Notes
https://raw.githubusercontent.com/lucannez64/Notes/master/Directional%20Derivative.typ
typst
#import "template.typ": * // Take a look at the file `template.typ` in the file panel // to customize this template and discover how it works. #show: project.with( title: "Directional Derivative", authors: ( "<NAME>", ), date: "30 Octobre, 2023", ) #set heading(numbering: "1.1.") = Directional Derivative <directional-derivative> == Definition <definition> The directional derivative of a multivariable function at a given point is a measure of the rate of change of the function in a particular direction at that point. It is a generalization of the concept of the derivative of a function of one variable, which measures the rate of change of the function in the direction of the x-axis. The directional derivative of a function $f lr((x comma y))$ at a point $lr((x_0 comma y_0))$ in the direction of a unit vector $bold(u) eq vec(a med b)$ is given by: $ frac(diff f, diff bold(u)) lr((x_0 comma y_0)) eq nabla f lr((x_0 comma y_0)) dot.op bold(u) eq vec(frac(diff f, diff x) lr((x_0 comma y_0)) med frac(diff f, diff y) lr((x_0 comma y_0))) dot.op vec(a med b) $ Where $nabla f lr((x_0 comma y_0))$ is the #link("Gradient Vector.pdf")[gradient vector] of the function at the point $lr((x_0 comma y_0))$, and $frac(diff f, diff x) lr((x_0 comma y_0))$ and $frac(diff f, diff y) lr((x_0 comma y_0))$ are the partial derivatives of the function with respect to $x$ and $y$ respectively. The directional derivative can be thought of as the projection of the gradient vector onto the direction specified by the unit vector $bold(u)$. It tells us the rate of change of the function in the direction of $bold(u)$ at the point $lr((x_0 comma y_0))$. == Example <example> To find the directional derivative of the function $f lr((x comma y)) eq x^2 sin 2 y$ in the direction of the vector $bold(u) eq vec(cos med sin)$, we need to first find the gradient vector of the function at the given point. The partial derivatives of $f$ with respect to $x$ and $y$ are: $ frac(diff f, diff x) eq 2 x sin 2 y $ $ frac(diff f, diff y) eq 2 x^2 cos 2 y $ The gradient vector of the function at a point $lr((x_0 comma y_0))$ is given by: $ nabla f lr((x_0 comma y_0)) eq vec(frac(diff f, diff x) lr((x_0 comma y_0)) med frac(diff f, diff y) lr((x_0 comma y_0))) eq vec(2 x_0 sin 2 y_0 med 2 x_0^2 cos 2 y_0) $ The directional derivative of the function in the direction of $bold(u)$ at the point $lr((x_0 comma y_0))$ is then given by: $ frac(diff f, diff bold(u)) lr((x_0 comma y_0)) eq nabla f lr((x_0 comma y_0)) dot.op bold(u) eq vec(2 x_0 sin 2 y_0 med 2 x_0^2 cos 2 y_0) dot.op vec(cos med sin) $ We can evaluate this expression to find the directional derivative. For example, if $lr((x_0 comma y_0)) eq lr((1 comma 1))$, then the directional derivative is: $ frac(diff f, diff bold(u)) lr((1 comma 1)) eq vec(2 dot.op 1 dot.op sin 2 dot.op 1 med 2 dot.op 1^2 cos 2 dot.op 1) dot.op vec(cos med sin) eq vec(sin 2 med cos 2) dot.op vec(cos med sin) eq sin^2 2 plus cos^2 2 eq 1 $ == Link <link> - #link("Gradient Vector.pdf")[Gradient Vector] - #link("Partial Derivative.pdf")[Partial Derivative]
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/field-09.typ
typst
Other
// Error: 25-28 content does not contain field "fun" and no default value was specified #show heading: it => it.fun = A
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/board-n-pieces/0.1.0/README.md
markdown
Apache License 2.0
# Board & Pieces Display chessboards in Typst. ## Displaying chessboards The main function of this package is `board`. It lets you display a specific position on a board. ```typ #board(starting-position) ``` ![image](examples/example-1.png) `starting-position` is a position that is provided by the package. It represents the initial position of a chess game. You can create a different position using the `position` function. It accepts strings representing each rank. Use upper-case letters for white pieces, and lower-case letters for black pieces. Dots and spaces correspond to empty squares. ```typ #board(position( "....r...", "........", "..p..PPk", ".p.r....", "pP..p.R.", "P.B.....", "..P..K..", "........", )) ``` ![image](examples/example-2.png) Alternatively, you can use the `fen` function to create a position from a [FEN](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) string: ```typ #board(fen("r1bk3r/p2pBpNp/n4n2/1p1NP2P/6P1/3P4/P1P1K3/q5b1 b - - 1 23")) ``` ![image](examples/example-3.png) Note that you can also specify only the first part of the FEN string: ```typ #board(fen("r4rk1/pp2Bpbp/1qp3p1/8/2BP2b1/Q1n2N2/P4PPP/3RK2R")) ``` ![image](examples/example-4.png) ## Customizing a chessboard The `board` function lets you customize the appearance of the board with multiple arguments. They are described below. - `highlighted-squares` is a list of squares to highlight (e.g. `("d3", "d2", "e3")`). - `reverse` is a boolean indicating whether to reverse the board, displaying it from black's point of view. This is `false` by default, meaning the board is displayed from white's point of view. - `display-numbers` is a boolean indicating whether ranks and files should be numbered. This is `false` by default. - `rank-numbering` and `file-numbering` are functions describing how ranks and files should be numbered. By default they are respectively `numbering.with("1")` and `numbering.with("a")`. - `square-size` is a length describing the size of each square. By default, this is `1cm`. - `white-square-color` and `black-square-color` correspond to the background color of squares. - `highlighted-white-square-color` and `highlighted-black-square-color` correspond to the background color of highlighted squares. - `pieces` is a dictionary containing images representing each piece. If specified, the dictionary must contain an entry for every piece kind in the displayed position. Keys are single upper-case letters for white pieces and single lower-case letters for black pieces. The default images are taken from [Wikimedia Commons](https://commons.wikimedia.org/wiki/Category:SVG_chess_pieces), and licensed under the [GNU Free Documentation License](https://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License,_version_1.2). This means you should credit their authors if you use them in your document. ## Chess symbols This package also exports chess-related symbols under `chess-sym.{pawn,knight,bishop,rook,queen,king}.{filled,stroked,white,black}`. `filled` and `black` variants are equivalent, and `stroked` and `white` as well. ## Changelog ### Version 0.1.0 (initial version) - Display a chess position on a chessboard with the `board` function. - Get the starting position with `starting-position`. - Use chess-related symbols with the `chess-sym` module.
https://github.com/faber222/RAW-CODE-TYPST
https://raw.githubusercontent.com/faber222/RAW-CODE-TYPST/main/README.md
markdown
MIT License
# Template para fazer um raw code enumerado dentro do typst Todo o código usado está dentro do main.typ Exemplo do PDF gerado: [PDF](RawCodeTypst.pdf)
https://github.com/goshakowska/Typstdiff
https://raw.githubusercontent.com/goshakowska/Typstdiff/main/tests/test_working_types/emph/emph_inserted.typ
typst
_first emphasis_ _second emphasis_ _inserted emphasis_
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/goto_definition/import_self.typ
typst
Apache License 2.0
// path: base.typ ----- #import "base.typ" #(/* position after */ base);
https://github.com/wade-cheng/typst-mla
https://raw.githubusercontent.com/wade-cheng/typst-mla/main/mla.typ
typst
MIT License
#let mla( title: none, author: none, header: none, instructor: none, class: none, date: none, doc ) = { let SPACING = 1.5em set text( font: "Times New Roman", size: 12pt ) set par( hanging-indent: -0.5in, justify: false, leading: SPACING, ) show par: set block(below: SPACING) set page( paper: "us-letter", margin: ( left: 1.5in, rest: 1in, ), header: align(right, context { header; [ ]; counter(page).display() }) ) set heading(numbering: "1.") show heading: it => [ // #set align(center) #set text( weight: "regular", font: "Times New Roman", size: 12pt, ) #if it.depth == 1 { h(-0.5in) strong(counter(heading).display()) [ ] strong(it.body) } else { h(-0.5in) emph(counter(heading).display()) [ ] emph(it.body) } ] h(-0.5in); author; linebreak() instructor; linebreak() class; linebreak() date; linebreak() { set align(center) set text( weight: "regular", font: "Times New Roman", size: 12pt, ) title } doc }
https://github.com/maucejo/presentation_polylux
https://raw.githubusercontent.com/maucejo/presentation_polylux/main/docs/manual.typ
typst
MIT License
#import "@preview/presentation-template:0.3.0": * #import "./manual-template.typ": * #show: manual-template.with( title: " Modèle de présentation Typst", subtitle: "Présentations de type Beamer en Typst", abstract : [Ce package Typst est une proposition de modèle de présentation de type Beamer en Typst pour les personnels du Laboratoire de Mécanique des Structures et des Systèmes Couplés du Conservatoire National des Arts et Métiers.], version: "Template 0.3.0", typst-version: "Typst 0.11.1" ) = Introduction Dans l'univers #typst, plusieurs package propose des modèles de présentation de type Beamer. Il en existe actuellement 3 que l'on trouver sur #link("https://typst.app/universe/", text("Typst Universe", fill: typst-color)) : - Polylux -- #link("https://typst.app/universe/package/polylux", text("Typst: Universe", fill: typst-color)), #link("https://github.com/andreasKroepelin/polylux", text("dépôt Github", fill: typst-color)) et #link("https://polylux.dev/book/", text("documentation", fill: typst-color)) - Touying -- #link("https://typst.app/universe/package/touying", text("Typst: Universe", fill: typst-color)), #link("https://github.com/touying-typ/touying", text("dépôt Github", fill: typst-color)) et #link("https://touying-typ.github.io/touying/", text("documentation", fill: typst-color)) - Slydst -- #link("https://typst.app/universe/package/slydst", text("Typst: Universe", fill: typst-color)), #link("https://github.com/glambrechts/slydst", text("dépôt Github", fill: typst-color)) et documentation (voir le ReadMe) Pour créer ce modèle de présentation, mon choix s'est porté sur Polylux, car je le trouve plus simple d'utilisation que Touying (syntaxe plus typique de Typst) et permettant une plus grande évolutivité que Slydst. = Utilisation Pour utiliser le modèle, il faut l'importer dans votre fichier principal `typ` en utilisant la commande suivante. #codesnippet[ ```typ #import "../src/presentation-template.typ": * ``` ] == Initilisation du modèle Après avoir importé le modèle, celui doit être initialisé en appliquant une règle d'affichage (`show` rule) avec la commande #cmd("presentation") en passant les options nécessaires avec l'instruction `with` dans votre fichier principal `typ` : #codesnippet( ```typ #show presentation.with( ... ) ``` ) Le modèle #cmd("presentation") possède un certain nombre de paramètres permettant de personnaliser le document. Voici la liste des paramètres disponibles : #command("presentation", ..args( aspect-ratio: "16-9", title: [Title], short-title: "", author: none, laboratory: "", lang: "fr", logo: image("../resources/assets/logo_cnam_lmssc.png"), footer-logo: image("../resources/assets/lecnam.png"), font: "Lato", math-font: "Lete Sans Math", [body]))[ #argument("aspect-ratio", default: "16-9", types: "string")[Rapport d'aspect de la présentation. Autre format disponible : `"4-3"`.] #argument("title", types: ("string", "content"))[Titre de la présentation. #example-box[ ```typ #let title = [Title \ #line(length: 15%, stroke: 0.075em + red) \ #text([Subtitle], size: 0.8em) ] ``` ] ] #colbreak() #argument("author", types: ("string", "content"))[Auteurs de la présentation. #example-box[ ```typ #let author = [#text(fill: colors.red, [Author 1]) #h(1em) Author 2] ``` ]] #argument("laboratory", types: ("string", "content"))[Nom du laboratoire de recherche. #example-box[ ```typ #let laboratory = [Laboratoire de Mécanique des Structures et des Systèmes Couplés \ Conservatoire National des Arts et Métiers ] ``` ] ] #argument("short-title", types: "string")[Titre court de la présentation.] #argument("lang", default: "fr", types: "string")[Langue du document. En fonction de la valeur prise par ce paramètre, la localisation du document sera adaptée. Outre le français, la seule langue prise en compte est l'anglais (`lang: "en"`).] #argument("logo", default: [#image("../resources/assets/logo_cnam_lmssc.png")], types: ("content","array"))[Chemin vers les logos pour la dispositive de titre. #wbox[ #set text(size: 11pt) Il faut que le template soit à la racine du répertoire pour que le chemin soit correctement interprété. Dans le cas contraire, une erreur de compilation sera générée. ] Pour utiliser plusieurs logos, il faut créer une liste de liens vers les images. \ Exemple -- `logo: (image("logo1.png"), image("logo2.png"))`. ] #argument("footer-logo", default: [#image("../resources/assets/lecnam.png")], types: "content")[Chemin vers le logo principal.] #argument("body-font", default: "Lato", types: "string")[Nom de la police de caractère du corps du texte.] #argument("math-font", default: "Lete Sans Math", types: "string")[Nom de la police de caractère des équations mathématiques.] #ibox[ #set text(size: 11pt) Les polices de caractère doivent être préalablement installées sur votre système pour être utilisées dans le document. Pour vérifier la disponibilité de la police choisie, vous pouvez entrer la commande `typst font` dans un terminal. ] ] == Contenu de la présentation D'une manière générale, le fichier contenant votre présentation est structuré de la manière suivante : #codesnippet[ ```typ // Diapositive de titre #title-slide() // Sommaire #content-slide() // Diapositive de section #new-section-slide(...) // Diapositive #slide(...)[ // Contenu de la diapositive ] // Pour réveiller l'auditoire #focus-slide[ // Contenu de la diapositive ] // Annexes #appendix-slide[ // Contenu de la diapositive ] ``` ] Le contenu de la présentation est structuré grâce à six types de diapositves, dont les spécificités sont décritres dans les sections qui suivent. === Diapostive de titre Pour créer une diapositive de titre, il faut insérer la commande #cmd("title-slide") dans votre fichier de présentation `typ`. #figure( image("manual-images/slide-title.png", width: 60%), caption: [Exemple de diapositive de titre] ) === Diapositive de sommaire Pour créer une dipositive de sommaire, il faut insérer la commande #cmd("content-slide") dans votre fichier de présentation `typ`. #figure( image("manual-images/sommaire.png", width: 60%), caption: [Exemple de diapositive de sommaire] ) === Diapositive de section Pour créer une diapositive de section, il faut insérer la commande #cmd("new-section-slide") dans votre fichier de présentation `typ`. Cette commande prend en paramètre le titre de la section sous la forme d'un élément de type #dtype("string") ou #dtype("content"). #figure( image("manual-images/first-sec.png", width: 60%), caption: [Exemple de diapositive de section] ) === Diapositive de contenu Les diapositives de contenu sont les diapositives classiques de votre présentation. Elles sont définies par la fonction #cmd("slide") qui dispose de deux paramètres `title` et `subtitle` permettant de personnaliser la diapositive. Pour appeler la fonction, il suffit d'insérer la commande : #command("slide", ..args( title: none, subtiltle: none, [body]))[] #figure( image("manual-images/contenu.png", width: 60%), caption: [Exemple de diapositive standard] ) === Diapositive d'annexe Pour créer une diapositive d'annexe, il faut insérer la commande #cmd("appendix-slide") dans votre fichier de présentation `typ`. #figure( image("manual-images/annexe.png", width: 60%), caption: [Exemple de diapositive d'annexe] ) #ibox[Par défaut, les diapositives d'annexe ne sont pas numérotées] === Diapositive "focus" Pour créer une diapositive pour attirer l'attention de votre auditoire, il faut insérer la commande #cmd("focus-slide") dans votre fichier de présentation `typ`. #figure( image("manual-images/focus.png", width: 60%), caption: [Exemple de diapositive "focus"] ) === Fonctions complémentaires Le modèle de présentation Typst propose plusieurs fonctions complémentaires permettant d'enrichir le contenu des diapositives. Voici la liste des fonctions disponibles : - #cmd("boxeq") -- Cette fonction permet de créer une boîte autour d'une équation mathématique importante. #example-box[ ```typ #boxeq[$sum_(i=1)^n i = (n(n+1))/2$] ``` #align(center)[#line(stroke: 1pt + typst-color, length: 95%)] #boxeq[$ sum_(i=1)^n i = (n(n+1))/2 $] ] - Boîtes permettant de mettre en avant des informations importantes dans votre présentation. - #cmd("info") -- Boîte d'information - #cmd("tip") -- Boîte de conseil - #cmd("important") -- Boîte pour les remarques importantes - #cmd("question") -- Boîte pour les questions #example-box[ ```typ #info[#lorem(10)] #tip[#lorem(10)] #important[#lorem(10)] #question[#lorem(10)] ``` #align(center)[#line(stroke: 1pt + typst-color, length: 95%)] #let localization = json("../resources/i18n/fr.json") #states.localization.update(localization) #info[#lorem(10)] #tip[#lorem(10)] #important[#lorem(10)] #question[#lorem(10)] ] - #cmd("code") -- Cette fonction permet d'insérer un bloc de code dans votre présentation. Elle prend en paramètre le langage de programmation utilisé pour la coloration syntaxique. #example-box[ ````typ #code(lang:"Julia")[ ```julia # Un commentaire function squared(x) return x^2 end ``` ] ```` #align(center)[#line(stroke: 1pt + typst-color, length: 95%)] #code(lang:"Julia")[ ```julia # Un commentaire function squared(x) return x^2 end ``` ] ] - #cmd("link-box") -- Cette fonction permet de créer une boîte pour faire des liens entre les diapositives. #example-box[ ```typ #slide[ #link-box(<slide2>, "Aller à la diapositive 2") ] <slide1> #slide[ #link-box(<slide1>, "Retour à la diapositive 1") ] <slide2> ``` ] #pagebreak() = Feuille de route Le modèle est en cours de développement. Voici la liste des fonctionnalités qui sont implémentées ou le seront dans une prochaine version. *Types de diapositives* - [x] Diapositive de titre - [x] Diapositive de sommaire - [x] Diapositive de section - [x] Diapositive de contenu - [x] Diapositive d'annexe - [x] Diapositive pour focaliser l'attention de l'auditoire *Éléments de mise en page* - [x] Personnalisation de l'en-tête des diapositives standard avec l'affichage du titre de la diapositive et du nom section courante - [x] Personnalisation du pied de page (logo, titre court de la présentation, numérotation des diapositives) - [x] Numérotation des diapositives d'annexe en lettre + chiffres (A | 1/1) *Éléments de contenu* - [x] Création d'une boîte autour d'une équation mathématique via la fonction `boxeq` - [x] Blocs de code avec coloration syntaxique via le package `codelst` - [x] Boîtes permettant de mettre en avant certains contenus via le package `showybox` - [x] Création de boîte pour faire des liens entre les diapositives = Note de versions - `polylux` -- version 0.3.1 - `codelst` -- version 2.0.1 - `showybox` -- version 2.0.1
https://github.com/QuadnucYard/crossregex-typ
https://raw.githubusercontent.com/QuadnucYard/crossregex-typ/main/examples/mini.typ
typst
MIT License
#import "../src/lib.typ": crossregex-hex #crossregex-hex( 3, constraints: ( `A.*`, `B.*`, `C.*`, `D.*`, `E.*`, `F.*`, `G.*`, `H.*`, `I.*`, `J.*`, `K.*`, `L.*`, `M.*`, `N.*`, `O.*`, ), answer: ( "ABC", "DEFG", "HIJKL", "MNOP", "QRS", ), )
https://github.com/Sparkenstein/resume
https://raw.githubusercontent.com/Sparkenstein/resume/master/starter.typ
typst
/* This copy of the resume formatting template is provided in the template download in case you'd like to make your preferred edits to the template directly. If you'd like to use this copy instead of the package, you'll need to update the #import statement in your resume.typ file to reference this file directly. Have you made edits or bug fixes to this template that you feel would help out others? It would be fantastic if you submitted a pull request to the template repository at https://github.com/chaoticgoodcomputing/typst-resume-starter ! */ /* Core formatting for the template document type. Establishes general document-wide formatting, and creates the header and footer for the resume. */ #let resume( author: "", location: "", contacts: (), body ) = { // Sets document metadata set document(author: author, title: author) // Document-wide formatting, including font and margins set text( font: "New Computer Modern", size: 11pt, lang: "en" ) set page( margin: ( top: 1.25cm, bottom: 0cm, left: 1.5cm, right: 1.5cm ), ) show link: set text( fill: rgb("#0645AD") ) // Header parameters, including author and contact information. show heading: it => [ #pad(top: 0pt, bottom: -15pt, [#smallcaps(it.body)]) #line(length: 100%, stroke: 1pt) ] // Author align(center)[ #block(text(weight: 700, 2.5em, [#smallcaps(author)])) ] // Contact pad( top: 0.25em, align(center)[ #smallcaps[#contacts.join(" | ")] ], ) // Location if location != "" { align(center)[ #smallcaps[#location] ] } // Main body. set par(justify: true) body } /* Allows hiding or showing full resume dynamically using global variable. This can be helpful for creating a single document that can be rendered differently depending on the desired output, for cases where you'd like to simultaneously render both a full copy and a single-page instance of only the most important or vital information. */ #let hide(should-hide, content) = { if not should-hide { content } } /* Education section formatting, allowing enumeration of degrees and GPA */ #let edu( institution: "", date: "", degrees: (), gpa: "", location: "" ) = { pad( bottom: 10%, grid( columns: (auto, 1fr), align(left)[ #strong[#institution] #{ if gpa != "" [ | #emph[GPA: #gpa] ] } \ #{ for degree in degrees [ #strong[#degree.at(0)] | #emph[#degree.at(1)] \ ] } ], align(right)[ #emph[#date] #{ if location != "" [ \ #emph[#location] ] } ] ) ) } /* Skills section formatting, responsible for collapsing individual entries into a single list. */ #let skills(areas) = { for area in areas { strong[#area.at(0): ] area.at(1).join(" | ") linebreak() } } /* Experience section formatting logic. */ #let exp( role: "", project: "", date: "", location: "", summary: "", details: [], ) = { pad( bottom: 15%, grid( columns: (auto, 1fr), align(left)[ #strong[#role] #{ if project != "" [| #emph[#project]] } #{ if summary != "" [ \ #emph[#summary] ] } ], align(right)[ #emph[#date] #{ if location != "" [ \ #emph[#location] ] } ] ) ) details } #show: resume.with( author: "<NAME>", location: "Pune, India", contacts: ( [#link("mailto:prabhan<EMAIL>")[Email]], [#link("https://prabhanjan.dev")[Website]], [#link("https://github.com/fosslife")[GitHub]], [#link("https://linkedin.com/in/Sparkenstein")[LinkedIn]], ), // footer: [#align(center)[#emph[References available on request]]] ) = Summary A full-stack js/ts dev with 7+ years of experience. part time open-source enthusiast, have a big list of open-source projects with large number of stars and recognition on Hackernews too. Consistent growth over the years, looking for a place to own responsibilities. = Skills #skills(( ("Languages", ( [Full-Stack JavaScript], [Full-stack Typescript], [Rust], [Python], )), ("Software", ( [Vim, VS Code], [Git], [Linux, Mac, Windows], [Figma], )), ("Frameworks", ( [React, Solid, NextJS], [Axum, Tokio, etc], [Fastapi, Flask, Telethon] )), ("Tools", ( [AWS, GCP], [Docker, Podman], [Postgres, MongoDB, Dgraph], )) )) = Experience #exp( role: "Front-end Developer", project: "Identity and Access Government", date: "Sept 2016 - Oct 2018", location: "Pune, India", summary: "Junior developer working on dedicated suite of software", details: [ - Owning entire suite of products for a complete lifecycle from scratch - Rewrote the entire thing from AngularJS v1 to React in a matter of 3 months ] ) #exp( role: "Full-Stack Developer", project: "Growerhub, Syngenta", date: "Oct 2018 - Mar 2020", location: "Pune, India", summary: "Syngenta is world leading agro-tech company, worked as pioneer of the tech team", details: [ - Was part of the founding tech team, owned all responsibilities from hiring to finishing projects - Worked on 2 different projects, both full stack, completely owning isolated modules ] ) #exp( role: "Senior Software Developer", project: "MasaiSchool", date: "Mar 2020 - Nov 2022", location: "Bangalore, India", summary: "Part of the founding team, worked on ed-tech", details: [ - Worked on 3 different education related projects - Including on-boarding portal, the dashboard, the learning management - Worked as a curriculum designer for students, mentoring and tutoring ] ) #exp( role: "Senior Software Developer", project: "Bigspring", date: "Nov 2022 - present", summary: "Everboarding sales at the speed of innovation", location: "USA", details: [ - One of my biggest projects, more than 300k LOC - Handling FE, BE and CI. - On-boarded multiple big clients from google to pfizer from all over the place. ] ) = Projects #show: columns.with(2) #exp( role: link("https://github.com/fosslife/devtools-x")[DevTools-X], project: "", details: [ - Cross-platform collection of tools - Written in React and Rust - Has Compressors to Hashers to Generators - Listed on front-page in HN at \#1 ] ) #exp( role: link("https://github.com/fosslife/truthy")[Truthy], project: "", details: [ - MFA/2FA manager with beautiful UI - Written in Rust - Win, Mac, Lin, Android and IOS support ] ) #exp( role: link("https://github.com/fosslife/awesome-ricing")[Awesome-Ricing], project: "", details: [ - Awesome-list of linux specific ricing ] ) #exp( role: link("https://github.com/fosslife/grambot")[Grambot], project: "", details: [ - Automation bot written 5 years ago, before the age of AI - Can scrape, find answers, auto reply, and what not. ] ) #exp( role: link("https://github.com/fosslife/define")[Define], project: "", details: [ - CLI tool for explaining a term on terminal, cross-platform ] ) #exp( role: link("https://github.com/fosslife/delta")[Delta], project: "", details: [ - A modern file uploader + URL shortner ] ) /* #exp( role: link("")[The Delorean], project: "", summary: "", details: [ - ] ) */ /* =============================== ===== ADDITIONAL SECTIONS ===== =============================== In general, the only hard-advised sections of a resume that I've seen consistently recommended are the Education (or equivalent) and Experience sections. The other sections are largely up to you. However, here are some recommendations based on other sections I've seen people use to great effect, or use on my own resume: - Projects, especially if you're in the tech industry where personal projects are encouraged or expected - Volunteering - Charity - Leadership - Awards (which, depending on your preferences, could reasonably use a different entry format) A flavor of section that I see a lot - and would NOT recommend - is something along the lines of "Hobbies" or "Interests". This is occasionally recommended to give "flavor" to your resume or "humanize" you in some way. (I understand that putting quotes around "flavor" and "humanize" make me sound like a boring robot of a person, but bear with me, here.) > If you're tempted to make (or are transferring over from an old resume that has) a Hobbies (or Hobbies-adjacent) section, I would advise you structure your hobbies as Projects and use a Projects section instead. Many hobbies (sports, programming, gaming, knitting(?), graphic design/drawing, writing, woodworking, baking, etc) can be safely structured in the same way Projects would be, and allow you to highlight interesting things about yourself in a way that follows the same design pattern as the rest of your experiences. === Opinion: Making Additional Sections Work === If you're making a resume for the first time or are early in your career, you may feel yourself straining to fill vertical space. If that's the case - or if you're just looking to liven up your resume a bit - I'd recommend doing a "throw it all in the kitchen sink" approach. With this approach, create new entries for anything that you could possibly conceive of as being interesting, taught you skills, or could be an even half-viable answer to somebody asking you "So, what have you done with your life?" A lot of things that don't feel like they'd fit into the hand-shakey, back-pat-y world of business, industry, and academia can be spun into things that feel like they belong on a resume. Some examples of experiences people have put that have been used to great effect, and some general examples of how I've seen them stated, are: - Sports Leagues/Fitness (intramural, professional, etc) - Constructing routines - Designing training plans - Cooperation/collaboration - Gaming (competitively, recreationally, collaboratively (e.g. D&D)) - Competitively (cooperation/team-building/recruiting) - Speedrunning (attention to detail, QA, methodology) - Creating games as a learning experience - Playing/leading D&D as a design experience (homebrewed content, especially), coordinating people, etc. - Woodworking/Construction - Planning projects - Creating designs - Solving problems - Making brownies - This isn't even a bit. The guy's name is Dylan, and his brownies kicked so much ass that they got these-brownies-kicked-ass-type awards. He had it on his CV and got into MIT — probably not *solely* off the brownies, but I'd take an even-money bet that it helped. In general, whatever you throw in the kitchen sink, the key is describing it with the same structure and detail as your experience, trying to fit it into the XYZ bullet structure as well as possible. Even if your experience is really weird, the way you describe it can be the difference between "Why did they even bother mentioning that?" and "Oh, that is pretty impressive!" I would also recommend having the same approach with these entries as you'd take for your Skills section, where you pretty judicially add and remove (comment out!) things from this section for the jobs you're applying for, based on what might fight best with the general "vibe" of the applications you're doing. While your job experience is a pretty binary "Describe the last X jobs you've had over the last Y years", this section is very fluid by comparison. In this section especially, I'd recommend following the guidance for hyperlinking mentioned in the Experience section above. */
https://github.com/kilpkonn/typst-thesis
https://raw.githubusercontent.com/kilpkonn/typst-thesis/main/main.typ
typst
MIT License
#import "template.typ": * #show: project.with( title: "Title in English", title_estonian: "Pealkiri eesti keeles", thesis_type: "Master's thesis", thesis_type_estonian: "Magistritöö", authors: ( ( name: "<NAME>", student_code: "123456IAPM" ), ), supervisors: ( ( name: "Supervisor Supervisor", degree: "MSc", ), ), location: "Tallinn", date: "May 12, 2024", dev: false, ) = Introduction Here is an example footnote#cite-footnote("typst-thesis", "2024-04-06", "https://github.com/kilpkonn/typst-thesis", "http://web.archive.org/web/20241007182045/https://github.com/kilpkonn/typst-thesis"). We can see an example of Rust code in @into-example-1: #figure( sourcecode()[ ```rs enum Option<T> { None, Some(T) } fn wrap(arg: i32) -> Option<i32> { todo!(); } ```], caption: [ Rust function to wrap `i32` in `Option` ], ) <into-example-1> You can also write inline code with syntax highlighting like ```rust Option``` and ```rust todo!()```. For development purposes you can leave #note[Some note text here][notes]. You can also give suggestions to #suggestion[change][improve] things. Or leave todo notes. #todo[Write a good introduction] #todo-supervisor[ Write even better thesis #todo[No can do, not enough time] ] You can also add figures, we can see a random one in @fig. #figure( // placement: auto, image("fig/time.png", width: 60%), caption: [ The execution time of the algorithm is linear in the search depth. $"Slope" = 7.6"ms"/"depth"$, standard deviation = 6.7ms ], ) <fig> Or write tables like so: #figure( table( columns: 4, [t], [1], [2], [3], [y], [0.3s], [0.4s], [0.8s], ), caption: [Timing results], ) You can also do fancy math $ f(x, y) := cases( 1 "if" (x dot y)/2 <= 0, 2 "if" x "is even", 3 "if" x in NN, sum_(k=x)^y k "otherwise", ) $ Here is an example citation to @example-cite that was originally written as a thesis in Typst. = Background <background> #todo[Gotta write this] = Conclusion <conclusion> #todo-supervisor[Write this as well]
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/058%20-%20Duskmourn%3A%20House%20of%20Horror/006_Children%20of%20the%20Carnival%2C%20Part%202%20.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Children of the Carnival, Part 2 ", set_name: "Duskmourn: House of Horror", story_date: datetime(day: 23, month: 08, year: 2024), author: "<NAME>", doc ) Dawn ran, and the carnival that was the only home she had ever known burned behind her, creatures and monsters cavorting in the flames, survivors scattering as they ran for their lives. She had been among the first to run, thanks to meeting City and the others on the way back from their scavenging mission; Duskmourn's monsters had still been getting themselves into position. She fled, and the survivors who ran after her died screaming, picked off by nightmares or entwined by lurking wickerfolk who had been smart enough to let her pass in favor of the richer pickings yet to come. She ran, and every time a scream was cut short behind her, she felt a little worse about running. She should have seen the signs of danger sooner than she did, should have realized something was wrong when they came back early, and by the sometimes-unpredictable rose path, not through the more stable route behind the kiddy wheel. There had been so many signs, and she'd missed them all, and now her home was burning. Lungs aching like she'd been punched in the chest, Dawn stopped and looked back at the fire, at the shapes fleeing before it, and at the larger shapes capering in the destruction. She tried to commit the moment to memory, to write it bold and permanent across her thoughts. She knew the details would fade, but she could at least try. Breath caught, she turned to resume her escape, and screamed as City loomed out of the woods in front of her, face twisted into a rictus of a smile, teeth too white and eyes too bright, hands reaching out to grab her. "The Devouring Father is still hungry," he said, and there was no place left for her to run, nowhere left for her to go— Dawn woke up screaming, kicking off the thin blanket—really a strip of scavenged curtain—that she had been using to shield herself against the attic chill. The guards on duty at the trapdoor down to the next floor turned to look at her with irritated disinterest. "Shh," said one, while the other only shook his head and turned back to his watch. Cringing with embarrassment, Dawn gestured apology and rose, folding her curtain blanket neatly off to the side. Someone else would sleep there now that she was up, and whoever it was would probably appreciate the consideration. There was a certain indefinable comfort in unfolding a blanket to sleep under, as if that small act of destruction made the slumber all the sweeter. This accomplished, she grabbed her single change of clothes and shuffled off toward the changing room. Finding an unguarded tunnel to the attic encampment had been sheer luck, a one in a million chance that should never have panned out. She'd arrived bruised and scraped from her headlong flight into the forest, but otherwise uninjured, and had been able to warn the camp leads of what had happened to the carnival before the monsters started hammering on the attic door. If not for the fact that the attack had come from the opposite side of the room from Dawn's arrival, she would have suspected herself of leading Duskmourn's forces straight to them. As it was, while she had been offered shelter, most of the survivors her own age treated her with suspicion. Her escape from the carnival had been too convenient, especially given the timing of the attack that followed. Almost everyone in the attic had lost someone in one of those two attacks. The House had never been a safe place to live, but it had suddenly turned hostile even by its own horrifying standards. Every settlement and gathering place they still had contact with had been attacked in the last weeks; several had vanished entirely. It was like the House, after years of treating their lives like a resource to be carefully hoarded, had suddenly figured out that they weren't needed after all. And it was terrifying. Living in Duskmourn—not that any of them had a choice in the matter, not that any of them would have chosen to stay if they'd had a choice in the matter—had never been an easy thing. The House was a predatory landscape filled with monsters, and it would slaughter the unwary in the time it took to draw a breath and scream. Still, it had been #emph[their] predatory landscape until recently, and now that it was no longer giving them time to catch their breath between assaults, it was unclear in the extreme how much longer any of them would be able to endure. Dawn stepped into the empty changing room, lighting a lantern, and swinging it around to check the shadows before she began to change clothing. Traditionally, the House hadn't attacked up here. But its nightmares and cellarspawn could come from anywhere, even the attic walls, and "tradition" was a word that was rapidly collapsing under the weight of reality. Nothing lunged out to claim her. Dawn pulled her hair into a rough ponytail and exited the room, back into the dim, largely silent attic. Night and day were concepts she only knew from books and old stories; sometimes rooms were brighter or darker, but there was no grand cycle, no predictable pattern to the House's whims. Still, there were times when the House was active. It was best to scavenge right after a major attack, when the monsters would be satiated and sleeping, and to sleep after that, while guards stood watch against anything that might not have found a big enough meal earlier. Dawn nodded to the guards as she moved past them again, this time heading for a door in the far wall. A quick peek showed that her workshop was still on the other side, not yet shuttled away by the House, and so she slipped through and sat down at the workbench she had scavenged for herself from broken boards and pieces of mismatched furniture, reaching for her current project. It had started as some sort of kitchen implement, boxy and rectangular, with two slots in the top and a heating coil inside. Dawn couldn't imagine what it would have been used for, or how it was supposed to function, but the coil was still an excellent conductor, and by wiring it to a battery, she was sure she could make something that would deliver a nasty shock to anything that it touched. She didn't have friends in the attic encampment, not really. She didn't know their patterns or their traditions, and they didn't trust her enough to let her go on scavenging expeditions. Although they brought back the things she asked for—grudgingly, but reliably enough that she'd been able to resume the one thing that brought her true and genuine joy, the one thing the House couldn't take away, no matter how many times it attacked. She was back to work. Under her tools and clever fingers, bits of scrap and waste were transformed into traps for glitch ghosts, snares that could slow—not stop, but still, a few seconds could be the difference between life and death—a charging razorkin, even fire-spitters that would stop a wickerfolk in their tracks. Her little devices were barely more than toys, and yet. Sometimes toys were all you had. The attic had access to different raw materials than the carnival had, in both good and bad ways. There were fewer nuts and bolts to be had here, but more copper piping; not as many nails, more pieces of unbroken glass. She was adapting. Prying the bottom off her metal rectangle, which she was already beginning to think of as a shock box, she felt around for the slot where she'd be seating the battery. Batteries were rare and getting rarer every season. They were artifacts from the fabled days before Duskmourn became the world, products of the lost city created during that era of impossible peace and plenty. They could be recharged by people with the magical talent to channel energy into metal, or by hanging them in a place frequented by glitch ghosts, although batteries hung in that manner weren't always recovered. The battery slot was up against one side of the box, easy to overlook, but vital. Dawn fumbled for the battery with her free hand, sliding it into place, and pushed it home with a click that seemed to reverberate all the way to her elbow. Replacing the lid, she pressed down the switch that would—she hoped—activate her latest creation. It began to hum, and the small wooden "prod" she'd attached to one end with a rope of braided copper crackled, broadcasting the fact that it was now dangerous to the touch. Dawn grinned to herself, thinking about how #emph[impressed] Rill would be when she saw that one of the shockers had finally come together, that Dawn had given them a new weapon, even if it was one that required being a lot closer to the enemy than most of them preferred. Her smile faded. Rill was never going to see. Rill was dead if she was lucky, and alive but taken if she was not, transformed by the House into one of its many horrors. Sweet, serious Rill. The image of her ripped apart by cellarspawn was almost preferrable to the thought that she might have become trapped inside the woven skin of one of the wickerfolk, silent and unfeeling forever— A loud bang from the other side of the door jerked her attention away from her workbench. Dawn looked around, box still in her hands, before she slowly, deliberately stood. No one spent a lifetime in Duskmourn without learning the signs of danger. No one had screamed, no one was whimpering or wailing. No one was breathing either. There was a certain quality to the absolute silence that descended on a room whose occupants had been killed. Dawn backed away from the door, getting her shoulders up against the wall, and tried to think what she might have that she could use to defend herself. A few half-finished ghost traps, some snares, and her shock wand. That was all. Not nearly enough against something that could take out an entire encampment in one strike. #figure(image("006_Children of the Carnival, Part 2 /01.jpg", width: 100%), caption: [], supplement: none, numbering: none) For a long while, the only sound was the pounding of her heart, the blood rushing in her ears, her breath rasping in her throat. Then, from the other side of the door, she heard footsteps. They moved toward her workshop, but stopped before they reached it. And a familiar, once beloved voice said, calm and serene in a way that he had never been when they were together in the carnival, "He let you go, you know. I asked him for your life, and he granted it to me, our Devouring Father doing a glorious favor for his most beloved new acolyte. But I don't have any more favors to call in until I earn them, in blood and bone and terror. I don't have a way to save you again. Come to us in the Valley of Serenity. Come with open hands and a willing heart, and we'll lead you past the threshold into his peace, forever. Or stay as you are, unprotected and unchaperoned, and know that you'll die like all the others. The choice is yours, Dawn. I only pray you choose rightly." City's footsteps moved away after that, and the silence returned. Dawn slowly sank to the floor, her back remaining pressed against the wall the entire way, and looked at the device in her hands, willing it to remake itself into something that could change the world, that could make it so, when she opened the door, the attic encampment wouldn't be lost. Nothing changed. Eventually, she stood on shaking legs and moved to open the attic door. The scene on the other side was as she had expected, and not, all at once. There were very few bodies. The ones that remained were missing pieces, skins mostly, but limbs as well; the razorkin had been here. Dawn stopped to pluck a machete from one of the slain as she walked to the trapdoor, shock wand still in hand. She climbed down the stairs, and nothing attacked her. The shadows, for once, were entirely empty and stayed that way as she walked down the hall, moving from the uneasy echoes of the Mutemoors into the dripping cool of the Floodpits. She had heard rumors the Benefactors would be found there. She had nowhere else to go. She was walking along a portrait hall when a glitching, shuddering shape pulled itself out of a shard of glass and reached for her, a terrible void of color and eternal nothingness. She aimed her shock wand at it and pressed the button that should increase the voltage, and instead of a spark, a shimmering beam of shattered light burst out, wrapping the glitch ghost in a lightning haze. Dawn staggered back, keeping the button pressed firmly down, and hoped the ghost would break before her battery died. The two things happened at the same time, the ghost shattering into a million specks of light even as the battery crackled and expired. Suddenly defenseless except for her stolen machete, she blinked at the place where the ghost had been, then at the wand in her hand, like she had forgotten what it was. Hands grasped her from behind, and she was yanked through a doorway before she could scream, into a dusty, disused theater, where a circle of survivors in meticulously patched clothes turned to look at her. "Welcome to the Benefactors," said the one who had pulled her into the dubious safety of their company. "We heard you'd been looking for us." Dawn laughed, starting to cry at the same time. The circle closed around her, and then hands were taking her shock wand, two people studying it before saying they had fresh batteries and asking whether she would mind if they installed them. She was safe here. #emph[They] were safe here, or as safe as anyone could be with the House changing around them for no reason she could see. And still City's words echoed in her ears. The choice was hers. The deaths were, too.
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/shaping_03.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test that RTL safe-to-break doesn't panic even though newline // doesn't exist in shaping output. #set text(dir: rtl, font: "Noto Serif Hebrew") \ ט
https://github.com/catppuccin/typst
https://raw.githubusercontent.com/catppuccin/typst/main/src/utils.typ
typst
MIT License
#let dict-at(dict, ..keys, default: (:)) = { if dict == none { assert(default != none, message: "dict is none and default is none") return default } assert(keys.pos().len() > 0, message: "no keys provided") let items = keys.pos() let result = items .slice(0, -1) .fold( dict, (acc, key) => acc.at(key, default: ())) .at(items.last(), default: default) assert.ne(result, (:), message: "color not found in palette and no default was provided") result }
https://github.com/wjakethompson/wjt-quarto-ext
https://raw.githubusercontent.com/wjakethompson/wjt-quarto-ext/main/wjt-letter/_extensions/wjt-letter/typst-template.typ
typst
Creative Commons Zero v1.0 Universal
// This function gets your whole document as its `body` // and formats it as a simple letter. #let letter( // The logo for the header logo: none, // The letter's sender, which is display at the top of the page. sender: none, // The letter's recipient, which is displayed close to the top. recipient: none, // The date, displayed to the right. date: none, // The subject line. subject: none, // The short title for the header shorttitle: none, // The report type for the header reporttype: none, // The name with which the letter closes. name: none, // The letter's content. body ) = { // Configure page and text properties. set text(font: "Source Sans Pro", 11pt) set page( paper: "us-letter", margin: 1in, header-ascent: 10%, footer: [ #set align(right) #counter(page).display( "1 / 1", both: true ) ] ) set page(header: locate(loc => { if counter(page).at(loc).first() <= 1 [ #style(styles => { if logo == none { return } let img = image(logo, width: 2in) let img-size = measure(img, styles) grid( columns: (1fr, img-size.width), rows: 1, none, img ) }) ] else [ #style(styles => { if logo == none { return } let img = image(logo, width: 1.5in) let img-size = measure(img, styles) let header-text = text( [ #if shorttitle == none {none} else {shorttitle} #if shorttitle != none [ \ ] #if reporttype == none {none} else {reporttype} ] ) grid( columns: (img-size.width, 1fr), rows: (img-size.height, 10pt), img, text(pad(top: 5pt, align(top + right, header-text))), none, none ) }) ] })) // Display sender at top of page. If there's no sender // add some hidden text to keep the same spacing. text(9pt, if sender == none { hide("a") } else { align(right, sender) }) v(0.5cm) // Display recipient. recipient v(0.5cm) // Display date. If there's no date add some hidden // text to keep the same spacing. align(right, if date != none { date } else { hide("a") }) v(0.5cm) // Add the subject line, if any. if subject != none { pad(right: 10%, left: 10%, align(center, strong(subject))) } if reporttype != none { pad(right: 10%, left: 10%, align(center, strong(reporttype))) } // Add body and name. body v(1.25cm) name }
https://github.com/oliver-ni/resume
https://raw.githubusercontent.com/oliver-ni/resume/main/template.typ
typst
MIT License
#let project(body) = { set document(title: "<NAME>", author: ("<NAME>")) set page(paper: "us-letter", margin: 0.25in) set text(font: "EB Garamond", lang: "en", size: 11pt, weight: 400) show par: set block(above: 0.8em, below: 0.8em) show strong: it => text(weight: "semibold", it.body) show heading.where(level: 1): it => [ #set text(12pt, weight: "regular") #block( width: 100%, stroke: (bottom: 0.5pt), inset: (bottom: 0.5em), above: 1.3em, below: 0.8em, smallcaps(it.body) ) ] show heading.where(level: 2): it => { text(size: 12pt, it.body) h(0.3em) } set list(indent: 1em) body } #let fab(name) = text(font: "Font Awesome 6 Brands", name) #let fas(name) = text(font: "Font Awesome 6 Free Solid", name) #let far(name) = text(font: "Font Awesome 6 Free", name) #let entry(l, r, below: 0.8em) = block( below: below, grid( columns: (1fr, auto), align(left, l), align(right, r), ) )
https://github.com/domoritz/tvcg-journal-typst
https://raw.githubusercontent.com/domoritz/tvcg-journal-typst/main/README.md
markdown
MIT No Attribution
# tvcg-journal-typst A [Typst](https://typst.app) template for TVCG journals. This is work in progress and not yet ready. This project was started by <NAME> at https://typst.app/project/pdh8Qj4vO7tfB1oiWoHuez. Please help us finish it to look as close as possible to the [LaTeX template](https://github.com/ieeevgtc/tvcg-journal-latex). ## Development First, link the current directory as a [Typst local package](https://github.com/typst/packages#local-packages) so that the template can be used in a local project. - **Linux:** use `link.sh`. - **Windows (10+):** use `link.ps1`. Make sure you have the *Developer mode* in Windows set up, otherwise the symlink won't work. Then run `typst compile template/main.typ --root template/` to compile the template against the development version of the package. If you want to use the released version of the tvcg-journal package, delete the local symlink. ### Fonts **Linux:** Install the required fonts locally with `brew install font-liberation`. **Windows:** Install the fonts `Liberation Serif` and `Liberation Sans`. You can find them in the `./assets/fonts` directory.
https://github.com/LugsoIn2/typst-htwg-thesis-template
https://raw.githubusercontent.com/LugsoIn2/typst-htwg-thesis-template/main/lib/declarationOfHonour.typ
typst
MIT License
#import "textTemplate.typ": * #let declarationOfHonour( lang: "", title: "", degree: "", author: "", submissionDate: datetime, birthdate: datetime, birthplace: "", companySentence: "", supervisor: "", declarationOfHonour-font: "Arial", location: "", physicalPrint: true, ) = { { set page( margin: (left: 30mm, right: 30mm, top: 40mm, bottom: 40mm), numbering: "i", number-align: center, ) set par(justify: true,) let languageText = textTemplate( pagetype: "declarationOfHonour" , lang: lang, textblocks: (author, birthdate.display("[day].[month].[year]"), birthplace, degree, title, companySentence, supervisor ) ) set text( font: declarationOfHonour-font, size: 12pt, lang: lang ) // --- -------------- ---- // --- -------------- ---- // - declarationOfHonour - text(languageText.at(0)) v(40pt) text(languageText.at(1)) v(5pt) text(weight: 800, languageText.at(2)) v(5pt) text(languageText.at(3)) v(40pt) text(languageText.at(4)) v(40pt) text(languageText.at(5)) v(30pt) text(languageText.at(6)) v(40mm) grid( columns: 2, gutter: 1fr, location + ", " + submissionDate.display("[day].[month].[year]"), "______________________" ) } if physicalPrint { pagebreak() } { set page( margin: (left: 20mm, right: 20mm, top: 40mm, bottom: 40mm), numbering: "i", number-align: center, ) } }
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/list_05.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // This works because tabs are used consistently. - A with 1 tab - B with 2 tabs
https://github.com/mattyoung101/uqthesis_eecs_hons
https://raw.githubusercontent.com/mattyoung101/uqthesis_eecs_hons/master/pages/dedication.typ
typst
ISC License
#align(center + horizon, [ _ To my icon and inspiration, <NAME>. _ ]) // FIXME: This makes the page number italics for some reason?
https://github.com/gmax9803/nd-assignment-templates
https://raw.githubusercontent.com/gmax9803/nd-assignment-templates/master/general/utils.typ
typst
MIT License
#let ddata = ( hw_num: "##", // int, insert HW number (i.e. for HW1 -> 01) due_date: datetime(year: 2024, month: 4, day: 5), // Due Date author: "<NAME>", // Author fullname net_id: "netid", // Your netid (i.e. mgraves4) outline: false, // Print table of contents? (true | false) slug: "toc", // Class slug, toc = theory of computing cname: "Theory of Computing", // Full class name atype: "hw" // assignment type: hw, ps (problem set), etc ) #let misc_settings = { } #let season = { if ddata.due_date.month() >= 8 [fa] if ddata.due_date.month() <= 5 [sp] } #let yy = ddata.due_date.display("[year repr:last_two]") #let nid = smallcaps(ddata.net_id) #let qed = [#align(right)[*QED*]] #let probnum = counter("problem") // counter for problem number #set heading(numbering: (it) => [ #smallcaps(it) ]) #let problem(t: none) = { probnum.step(level: 1) locate(loc => { if probnum.at(loc).at(0) != 1 { pagebreak() } }) // pagebreak if not first problem heading(level: 1, bookmarked: false, numbering: (i) => [ #smallcaps("problem " + [#i]) ], t) } #let subprob(s: "", t: none) = { if s != "" [(#probnum.display()#s)] else { probnum.step(level: 2) heading(level: 2, bookmarked: false, numbering: "(1a)", t) } } #let hdr = [#smallcaps(align(right)[ nd#yy#season\-#ddata.slug\-#ddata.atype#ddata.hw_num])] #let ftr = [ #align(right)[#nid - page #counter(page).display("1/1", both: true) ] ] #let init_header = [ #ddata.author (#nid)\ Due: #ddata.at("due_date").display("[month]/[day]/[year]") \ ] #let oline(p) = { line(length: 100%, stroke: .5pt) if ddata.outline { outline(title: [Outline], depth: 2, target: heading, indent: auto ) line(length: 100%, stroke: .5pt) [\ ] } } #let cbox(content, b: false) = align(center, box( stroke: { if b {.5pt} else {0pt} }, width: 97%, inset: 8pt, { align(left, content) } )) /**** #proof() ****/ #let proof(content, b: false) = { cbox(b: b, { [*_proof:_*\ ] [#content] qed }) }
https://github.com/konradroesler/edym-skript
https://raw.githubusercontent.com/konradroesler/edym-skript/main/README.md
markdown
# Theoretische Physik II: Elektrodynamik Mitschriften aus der Elektrodynamik Vorlesung mit typst. ## Disclaimer Das Skript enthält ziemlich genau das, was an die Tafel geschrieben wird, also nicht viel. Für ausführliche Erklärungen verweise ich auf die im moodle Kurs verwiesene Literatur. z.B. Elektrodynamik, <NAME>, erhältlich als pdf über Springer Link und der hu ## Änderungen Verbesserungen sind explizit erwünscht. Wer sich mit github auskennt kann das repo forken und einen pull request erstellen oder ein issue auf github erstellen. Sonst bin ich über meine hu mail, whatsapp oder discord erreichbar.
https://github.com/ngyngcphu/tick3d-docs
https://raw.githubusercontent.com/ngyngcphu/tick3d-docs/main/contents/06_Implementation/index.typ
typst
Apache License 2.0
= Implementation and Guide == Implementation Link source code FE: https://github.com/ngyngcphu/tick3d-fe\ Link source code BE: https://github.com/ngyngcphu/tick3d-be\ Link deploy website: https://tick3d.tickflow.net/\ == Hướng dẫn cài đặt Dùng git hoặc các phần mềm quản lý mã nguồn khác để clone 2 source code nói trên. \ Cách chạy source FE: #figure(caption: "Source code FE", image("../images/imple/fe.png", fit: "cover")) Cài đặt yarn - công cụ quản lý gói phần mềm mở để tiếp tục. Cách chạy source FE: #block(inset: (left:1cm))[ 1. Cài đặt các dependencies và devDependencies bằng lệnh:\n *yarn install* 2. Chạy source code bằng lệnh:\n *yarn start* ] #pagebreak() Cách chạy source BE: #figure(caption: "Source code BE", image("../images/imple/be.png", fit: "cover")) Cài đặt yarn - công cụ quản lý gói phần mềm mở để tiếp tục. Cách chạy source BE: #block(inset: (left:1cm))[ 1. Run Bootstrap Command:\n *yarn bootstrap* 2. Start the application:\n *yarn start* ] Để tương tác với ứng dung web, người dùng truy cập trực tiếp vào đường dẫn sau: https://tick3d.tickflow.net/ == Guide Người dùng truy cập vào trang web với đường dẫn: https://tick3d.tickflow.net/ \ === Desktop *Giao diện trang Homepage* Sau khi truy cập vào trang web, người dùng sẽ thấy giao diện Homepage như sau: #figure(caption: "Giao diện trang Homepage trên màn hình desktop", image("../images/imple/D_homepage.png", fit: "cover")) Trang Homepage bao gồm các thành phần sau: #block(inset: (left:1cm))[ 1. Header: bao gồm logo, thanh tìm kiếm, thanh menu, thanh tài khoản 2. Banner: bao gồm các banner quảng cáo 3. Information: bao gồm các thông tin về website, nhóm bán sản phẩm 4. Product: bao gồm các sản phẩm 5. Footer: bao gồm các thông tin liên hệ, thông tin website ] #figure(caption: "Hiển thị thông tin của shop tại trang Homepage trên màn hình desktop", image("../images/imple/D_homepage2.png", fit: "cover")) #figure(caption: "Hiển thị các sản phẩm mô hình 3D tại trang Homepage trên màn hình desktop", image("../images/imple/D_homepage3.png", fit: "cover")) #figure(caption: "Hiển thị các sản phẩm mô hình 3D tại trang Homepage trên màn hình desktop", image("../images/imple/D_homepage4.png", fit: "cover")) #figure(caption: "Hiển thị các sản phẩm mô hình 3D tại trang Homepage trên màn hình desktop", image("../images/imple/D_homepage5.png", fit: "cover")) Tại trang Homepage, hệ thống sẽ cung cấp cho người dùng những mô hình 3D được mua nhiều tại cửa hàng. Người dùng có thể click vào mô hình để xem thông tin chi tiết của mô hình đó. #figure(caption: "Giao diện hiển thị thông tin chi tiết của mô hình 3D trên màn hình desktop", image("../images/imple/D_info.png", fit: "cover")) Tại đây người dùng có thể click chọn *Thêm vào giỏ hàng* để thêm mô hình vào giỏ hàng. Hoặc click chọn *Mua ngay* để mua mô hình đó. Ngoài việc xem chi tiết mô hình 3D tại trang Homepage, người dùng có thể trực tiếp thêm mô hình vào giỏ hàng bằng cách click chọn *Thêm vào giỏ hàng* tại trang Homepage. #figure(caption: "Giao diện hiển thị thông báo giỏ hàng vừa thêm mô hình 3D trên màn hình desktop", image("../images/imple/D_homepageadd.png", fit: "cover")) Người dùng có thể click chọn các sản phẩm mô hình 3D khác vào giỏ hàng hoặc người dùng có thể đi đến xem giỏ hàng. #figure(caption: "Giao diện hiển thị chi tiết giỏ hàng trên màn hình desktop", image("../images/imple/D_homepagecart.png", fit: "cover")) #pagebreak() *Giao diện trang Category*\ Trang Category là trang hiển thị các sản phẩm theo danh mục, người dungf có thể truy cập trang Category bằng cách click chọn vào các danh mục tại thanh menu. #figure(caption: "Danh mục phân loại sản phẩm trên thanh menu", image("../images/imple/D_categories.png", fit: "cover")) Tại trang Category, hệ thống cung cấp cho người dùng các sản phẩm mô hình 3D theo theo từng danh mục như là: *All thing*, *Fashion*, *Hobby*, *Learning*, *Tools*, *Toys and Games*, *Art* và *Household*.\ Ngoài ra hệ thống còn cung cấp bộ *Filter* để người dùng có thể lọc sản phẩm mô hình 3D theo danh mục *Category*, theo đánh giá *Star* và theo thời gian *Upload time* của hệ thống. Bên cạnh đó hệ thống, còn giúp người dùng lọc sản phẩm theo các thứ tự như là: *Lastest*, *Most bought*, *Most star*, *Lowest price* và *Name*. #figure(caption: "Giao diện hiển thị sản phẩm mô hình 3D theo danh mục trên màn hình desktop", image("../images/imple/D_categories2.png", fit: "cover")) #figure(caption: "Giao diện hiển thị sản phẩm mô hình 3D theo danh mục trên màn hình desktop", image("../images/imple/D_categories3.png", fit: "cover")) Sau khi lọc cái sản phẩm, người dùng có thể click chọn *Clear filter* để xóa các bộ lọc đã chọn và hiển thị lại tất cả các sản phẩm mô hình 3D. #figure(caption: "Giao diện trang Category trước khi người dùng click chọn Clear filter", image("../images/imple/D_cateclear.png", fit: "cover")) Đây là giao diện trang Category sau khi người dùng click chọn *Clear filter*. #figure(caption: "Giao diện trang Category sau khi người dùng click chọn Clear filter", image("../images/imple/D_cateclear2.png", fit: "cover")) Ngoài ra, người dùng còn có thể tìm kiếm sản phẩm mô hình 3D theo tên sản phẩm tại trang Category bằng thanh *Search* tại thanh menu. #figure(caption: "Tìm kiếm sản phẩm mô hình 3D theo tên sản phẩm tại trang Category bằng thanh Search", image("../images/imple/D_morden.png", fit: "cover")) *Giao diện trang Add cart* Khách hàng sau khi tìm kiếm sản phẩm mô hình 3D mong muốn tại trang Category, khách hàng có thể thêm sản phẩm đó vào giỏ hàng bằng cách click chọn *Thêm vào giỏ hàng*.\ #figure(caption: "Giao diện thêm sản phẩm mô hình 3D vào giỏ hàng tại trang homepage", image("../images/imple/D_addcart.png", fit: "cover")) Hoặc khách hàng có thể click chọn *Thêm vào giỏ hàng* tại trang chi tiết sản phẩm mô hình 3D. #figure(caption: "Giao diện thêm sản phẩm mô hình 3D vào giỏ hàng tại trang chi tiết sản phẩm mô hình 3D", image("../images/imple/D_addcart2.png", fit: "cover")) Sau khi click chọn *Thêm vào giỏ hàng*, hệ thống sẽ hiển thị số lượng sản phẩm mô hình 3D đã thêm vào giỏ hàng tại thanh menu.\ Khách hàng có thể xem giỏ hàng bằng cách click chọn biểu tượng *Giỏ hàng* tại thanh menu. #figure(caption: "Giao diện hiển thị giỏ hàng trên màn hình desktop", image("../images/imple/D_cart.png", fit: "cover")) #figure(caption: "Giao diện hiển thị giỏ hàng trên màn hình desktop", image("../images/imple/D_cart2.png", fit: "cover")) Khách hàng có thể xóa sản phẩm mô hình 3D khỏi giỏ hàng bằng cách click biểu tượng thùng rác tại sản phẩm mô hình 3D muốn xóa. Khách hàng cũng có thể tăng hoặc giảm số lượng sản phẩm mô hình 3D muốn mua bằng cách click chọn biểu tượng *+* hoặc *-* tại sản phẩm mô hình 3D muốn thay đổi số lượng.\ #figure(caption: "Giao diện hiển thị việc thay đổi số lượng sản phẩm mô hình 3D trong giỏ hàng trên màn hình desktop", image("../images/imple/D_cart.png", fit: "cover")) #pagebreak() *Giao diện trang Payment* Sau khi khách hàng đã chọn những sản phẩm muốn mua tại trang web, tại trang giỏ hàng khách hàng click chọn *Thanh toán* để tiến hành thanh toán đơn hàng. #figure(caption: "Nút thanh toán tại trang giỏ hàng", image("../images/imple/D_cart2.png", fit: "cover")) Sau khi click chọn *Thanh toán*, hệ thống sẽ chuyển khách hàng đến trang Payment để khách hàng tiến hành thanh toán đơn hàng. #figure(caption: "Giao diện hiển thị việc thanh toán đơn hàng trên màn hình desktop", image("../images/imple/D_payment.png", fit: "cover")) Người dùng điền đầy đủ địa chỉ giao hàng như: quận, phường, số nhà, ghi chú và ấn nút *PayPal* để tiến hành thanh toán đơn hàng. Lúc này, hệ thống sẽ chuyển hướng người dùng đến trang PayPal để tiến hành thanh toán đơn hàng. #figure(caption: "Giao diện chuyển hướng đến trang PayPal để thanh toán đơn hàng trên màn hình desktop", image("../images/imple/D_payment2.png", fit: "cover")) Người dùng ấn nút *Complete Purchase* để hoàn tất thanh toán đơn hàng. #figure(caption: "Giao diện hiển thị thoogn báo thanh toán đơn hàng thành công trên màn hình desktop", image("../images/imple/D_payment3.png", fit: "cover")) Bên cạnh đó, người dùng có thể click chọn *Debit or Credit Card* để thanh toán đơn hàng bằng thẻ ngân hàng. #figure(caption: "Giao diện hiển thị việc thanh toán đơn hàng bằng thẻ ngân hàng trên màn hình desktop", image("../images/imple/D_payment1.png", fit: "cover")) #pagebreak() *Giao diện trang Register* Khi tiến hành thanh toán đơn hàng, hệ thống sẽ yêu cầu người dùng đăng nhập hoặc đăng ký tài khoản để tiếp tục thanh toán. Đây lầ giao diện trang đăng ký tài khoản. #figure(caption: "Giao diện trang đăng ký tài khoản trên màn hình desktop", image("../images/imple/D_signup.png", fit: "cover")) Người dùng đăng ký tài khoản bằng cách điền đầy đủ thông tin như: Họ, Tên, Số điện thoại, Email và Mật khẩu.\ Sau khi điền đầy đủ thông tin, người dùng click chọn *Gửi* để hoàn tất xác nhận đăng ký tài khoản. #figure(caption: "Giao diện nhập otp để xác nhận đăng ký tài khoản trên màn hình desktop", image("../images/imple/D_otp.png", fit: "cover")) #figure(caption: "Giao diện email của người dùng nhận được mã OTP để xác nhận đăng ký tài khoản trên màn hình desktop", image("../images/imple/D_otpgmail.png", fit: "cover")) Sau khi click chọn *Gửi*, hệ thống sẽ gửi mã OTP đến email của người dùng để xác nhận đăng ký tài khoản. Người dùng điền mã OTP vào ô *OTP* và click chọn *Xác nhận* để hoàn tất đăng ký tài khoản. Sau khi hoàn tất đăng ký tài khoản, hệ thống sẽ chuyển người dùng về trang Login để người dùng đăng nhập tài khoản. #figure(caption: "Giao diện trang đăng nhập sau khi đăng ký tài khoản thành công trên màn hình desktop", image("../images/imple/login.png", fit: "cover")) *Giao diện trang Login* Khi tiến hành thanh toán đơn hàng, hệ thống sẽ yêu cầu người dùng đăng nhập hoặc đăng ký tài khoản để tiếp tục thanh toán. Đây là giao diện trang đăng nhập tài khoản. #figure(caption: "Giao diện trang đăng nhập tài khoản trên màn hình desktop", image("../images/imple/login.png", fit: "cover")) Khách hàng đăng nhập tài khoản bằng cách điền đầy đủ thông tin như: Email và Mật khẩu.\ Sau khi điền đầy đủ thông tin, khách hàng click chọn *Đăng nhập* để hoàn tất đăng nhập tài khoản.\ Nếu khách hàng nhập đúng thông tin tài khoản, hệ thống sẽ chuyển khách hàng về trang Homepage và hiển thị thông báo đăng nhập thành công.\ #figure(caption: "Hiển thị thông báo đăng nhập thành công trên màn hình desktop", image("../images/imple/loginsuccess.png", fit: "cover")) Nếu khách hàng nhập sai thông tin tài khoản, hệ thống sẽ hiển thị thông báo lỗi và yêu cầu khách hàng nhập lại thông tin tài khoản. #figure(caption: "Hiển thị thông báo đăng nhập thất bại trên màn hình desktop", image("../images/imple/loginfail.png", fit: "cover")) === Mobile *Giao diện trang Homepage* Sau khi dùng Mobile phone truy cập vào trang web, người dùng sẽ thấy giao diện Homepage như sau: #figure(caption: "Giao diện trang Homepage trên màn hình mobile", image("../images/imple/M_hompage.jpg", fit: "cover", height: 50%)) Trang Homepage bao gồm các thành phần sau: #block(inset: (left:1cm))[ 1. Header: bao gồm logo, thanh tìm kiếm, thanh menu, thanh tài khoản 2. Banner: bao gồm các banner quảng cáo 3. Information: bao gồm các thông tin về website, nhóm bán sản phẩm 4. Product: bao gồm các sản phẩm 5. Footer: bao gồm các thông tin liên hệ, thông tin website ] Đây là giao diện thanh Menu tại trang Homepage, khi người dùng click chọn vào biểu tượng Menu góc trên bên trái màn hình.\ #figure(caption: "Giao diện sidebar tại trang Homepage", image("../images/imple/M_homepage1.jpg", fit: "cover", height: 45%)) #figure(caption: "Hiển thị thông tin của shop tại trang Homepage trên màn hình mobile", image("../images/imple/M_homepage2.jpg", fit: "cover", height: 45%)) #figure(caption: "Hiển thị các sản phẩm mô hình 3D tại trang Homepage trên màn hình mobile", image("../images/imple/M_homepage3.jpg", fit: "cover", height: 45%)) #figure(caption: "Hiển thị các sản phẩm mô hình 3D tại trang Homepage trên màn hình mobile", image("../images/imple/M_homepage4.jpg", fit: "cover", height: 45%)) Tại trang Homepage, hệ thống sẽ cung cấp cho người dùng những mô hình 3D được mua nhiều tại cửa hàng. Người dùng có thể click vào mô hình để xem thông tin chi tiết của mô hình đó.\ #figure(caption: "Giao diện hiển thị thông tin chi tiết của mô hình 3D trên màn hình mobile", image("../images/imple/M_info.jpg", fit: "cover", height: 45%)) #pagebreak() *Giao diện trang Category* Trang Category là trang hiển thị các sản phẩm theo danh mục, người dungf có thể truy cập trang Category bằng cách click chọn vào các danh mục tại thanh menu. #figure(caption: "Giao diện sidebar tại trang Category", image("../images/imple/M_cate.jpg", fit: "cover", height: 45%)) Tại trang Category, hệ thống cung cấp cho người dùng các sản phẩm mô hình 3D theo theo từng danh mục như là: *All thing*, *Fashion*, *Hobby*, *Learning*, *Tools*, *Toys and Games*, *Art* và *Household*.\ Ngoài ra hệ thống còn cung cấp bộ *Filter* để người dùng có thể lọc sản phẩm mô hình 3D theo danh mục *Category*, theo đánh giá *Star* và theo thời gian *Upload time* của hệ thống. Bên cạnh đó hệ thống, còn giúp người dùng lọc sản phẩm theo các thứ tự như là: *Lastest*, *Most bought*, *Most star*, *Lowest price* và *Name*.\ #figure(caption: "Giao diện hiển thị sản phẩm mô hình 3D theo danh mục trên màn hình mobile", image("../images/imple/M.cate2.jpg", fit: "cover", height: 45%)) #figure(caption: "Giao diện hiển thị sản phẩm mô hình 3D theo danh mục trên màn hình mobile", image("../images/imple/M_cate3.jpg", fit: "cover", height: 45%)) Sau khi lọc cái sản phẩm, người dùng có thể click chọn *Clear filter* để xóa các bộ lọc đã chọn và hiển thị lại tất cả các sản phẩm mô hình 3D.\ #figure(caption: "Giao diện hiển thị sản phẩm mô hình 3D theo danh mục trên màn hình mobile", image("../images/imple/M.cate2.jpg", fit: "cover", height: 45%)) Đây là giao diện trang Category sau khi người dùng click chọn *Clear filter*.\ #figure(caption: "Giao diện hiển thị sản phẩm mô hình 3D theo danh mục trên màn hình mobile", image("../images/imple/M.cate2.jpg", fit: "cover", height: 45%)) Ngoài ra, người dùng còn có thể tìm kiếm sản phẩm mô hình 3D theo tên sản phẩm tại trang Category bằng thanh *Search* tại thanh menu.\ *Giao diện trang Add cart* Khách hàng sau khi tìm kiếm sản phẩm mô hình 3D mong muốn tại trang Category, khách hàng có thể thêm sản phẩm đó vào giỏ hàng bằng cách click chọn *Thêm vào giỏ hàng*.\ #figure(caption: "Giao diện thêm sản phẩm mô hình 3D vào giỏ hàng tại trang homepage trên màn hình mobile", image("../images/imple/M_addcart.jpg", fit: "cover", height: 50%)) Hoặc khách hàng có thể click chọn *Thêm vào giỏ hàng* tại trang chi tiết sản phẩm mô hình 3D. #figure(caption: "Giao diện thêm sản phẩm mô hình 3D vào giỏ hàng tại trang chi tiết sản phẩm mô hình 3D trên màn hình mobile", image("../images/imple/M_addcart2.jpg", fit: "cover", height: 50%)) Sau khi click chọn *Thêm vào giỏ hàng*, hệ thống sẽ hiển thị số lượng sản phẩm mô hình 3D đã thêm vào giỏ hàng tại thanh menu.\ Khách hàng có thể xem giỏ hàng bằng cách click chọn biểu tượng *Giỏ hàng* tại thanh menu. #figure(caption: "Giao diện hiển thị giỏ hàng trên màn hình mobile", image("../images/imple/M_cart.png", fit: "cover", height: 50%)) Khách hàng có thể xóa sản phẩm mô hình 3D khỏi giỏ hàng bằng cách click biểu tượng thùng rác tại sản phẩm mô hình 3D muốn xóa. Khách hàng cũng có thể tăng hoặc giảm số lượng sản phẩm mô hình 3D muốn mua bằng cách click chọn biểu tượng *+* hoặc *-* tại sản phẩm mô hình 3D muốn thay đổi số lượng.\ #figure(caption: "Giao diện hiển thị việc thay đổi số lượng sản phẩm mô hình 3D trong giỏ hàng trên màn hình mobile", image("../images/imple/M_cart.png", fit: "cover", height: 50%)) #pagebreak() *Giao diện trang Payment* Sau khi khách hàng đã chọn những sản phẩm muốn mua tại trang web, tại trang giỏ hàng khách hàng click chọn *Thanh toán* để tiến hành thanh toán đơn hàng. #figure(caption: "Giao diện hiển thị việc thanh toán đơn hàng trên màn hình mobile", image("../images/imple/M_cart.png", fit: "cover", height: 50%)) Sau khi click chọn *Thanh toán*, hệ thống sẽ chuyển khách hàng đến trang Payment để khách hàng tiến hành thanh toán đơn hàng. #figure(caption: "Giao diện hiển thị việc thanh toán đơn hàng trên màn hình mobile", image("../images/imple/M_payment.png", fit: "cover", height: 45%)) Người dùng điền đầy đủ địa chỉ giao hàng như: quận, phường, số nhà, ghi chú và ấn nút *PayPal* để tiến hành thanh toán đơn hàng. Lúc này, hệ thống sẽ chuyển hướng người dùng đến trang PayPal để tiến hành thanh toán đơn hàng. #figure(caption: "Giao diện chuyển hướng đến trang PayPal để thanh toán đơn hàng trên màn hình mobile", image("../images/imple/M_payment2.png", fit: "cover", height: 45%)) Người dùng ấn nút *Complete Purchase* để hoàn tất thanh toán đơn hàng. #figure(caption: "Giao diện hiển thị thông báo thanh toán đơn hàng thành công trên màn hình mobile", image("../images/imple/M_payment3.png", fit: "cover", height: 45%)) Bên cạnh đó, người dùng có thể click chọn *Debit or Credit Card* để thanh toán đơn hàng bằng thẻ ngân hàng. #figure(caption: "Giao diện hiển thị việc thanh toán đơn hàng bằng thẻ ngân hàng trên màn hình mobile", image("../images/imple/M_payment4.png", fit: "cover", height: 45%)) #pagebreak() *Giao diện trang Register* Khi tiến hành thanh toán đơn hàng, hệ thống sẽ yêu cầu người dùng đăng nhập hoặc đăng ký tài khoản để tiếp tục thanh toán. Đây lầ giao diện trang đăng ký tài khoản. #figure(caption: "Giao diện trang đăng ký tài khoản trên màn hình mobile", image("../images/imple/M_signup.jpg", fit: "cover", height: 45%)) Người dùng đăng ký tài khoản bằng cách điền đầy đủ thông tin như: Họ, Tên, Số điện thoại, Email và Mật khẩu.\ Sau khi điền đầy đủ thông tin, người dùng click chọn *Gửi* để hoàn tất xác nhận đăng ký tài khoản. #figure(caption: "Giao diện nhập otp để xác nhận đăng ký tài khoản trên màn hình mobile", image("../images/imple/M_otp.jpg", fit: "cover", height: 45%)) #figure(caption: "Giao diện email của người dùng nhận được mã OTP để xác nhận đăng ký tài khoản trên màn hình mobile", image("../images/imple/M_otp2.jpg", fit: "cover", height: 45%)) Sau khi click chọn *Gửi*, hệ thống sẽ gửi mã OTP đến email của người dùng để xác nhận đăng ký tài khoản. Người dùng điền mã OTP vào ô *OTP* và click chọn *Xác nhận* để hoàn tất đăng ký tài khoản. Sau khi hoàn tất đăng ký tài khoản, hệ thống sẽ chuyển người dùng về trang Login để người dùng đăng nhập tài khoản. #figure(caption: "Giao diện trang đăng nhập sau khi đăng ký tài khoản thành công trên màn hình mobile", image("../images/imple/M_signupsuccess.jpg", fit: "cover", height: 45%)) *Giao diện trang Login* Khi tiến hành thanh toán đơn hàng, hệ thống sẽ yêu cầu người dùng đăng nhập hoặc đăng ký tài khoản để tiếp tục thanh toán. Đây là giao diện trang đăng nhập tài khoản. #figure(caption: "Giao diện trang đăng nhập tài khoản trên màn hình mobile", image("../images/imple/M_login.jpg", fit: "cover", height: 45%)) Khách hàng đăng nhập tài khoản bằng cách điền đầy đủ thông tin như: Email và Mật khẩu.\ Sau khi điền đầy đủ thông tin, khách hàng click chọn *Đăng nhập* để hoàn tất đăng nhập tài khoản.\ Nếu khách hàng nhập đúng thông tin tài khoản, hệ thống sẽ chuyển khách hàng về trang Homepage và hiển thị thông báo đăng nhập thành công.\ #figure(caption: "Hiển thị thông báo đăng nhập thành công trên màn hình mobile", image("../images/imple/M_signin.jpg", fit: "cover", height: 45%)) #pagebreak() === *Portfolio management* Quản trị viên truy cập vào trang web với đường dẫn: https://tick3d.tickflow.net/ và đăng nhập với tài khoản quản trị viên: \ Quản trị viên có thể xem lại tổng quát các thông tin thống kê của cửa hàng tại trang Dashboard. Tại đây, quản trị viên có thể xem: - Thống kê số lượng mô hình 3D theo danh mục: Quản trị viên có thể xem tổng số mô hình theo danh mục và tỉ lệ phần trăm của từng danh mục mô hình. - Thống kê số lượng mô hình 3D được upload theo từng giai đoạn của từng danh mục mô hình: Quản trị viên có thể xem tổng số mô hình được upload theo từng giai đoạn của từng danh mục mô hình. - Thống kê mô hình 3D được mua nhiều nhất theo từng danh mục: Quản trị viên có thể xem mô hình 3D được mua nhiều nhất theo từng danh mục. - Thống kê người dùng theo từng giai đoạn: Quản trị viên có thể xem tổng số người dùng theo từng giai đoạn. - Thống kê doanh thu của cửa hàng theo từng giai đoạn của từng danh mục mô hình: Quản trị viên có thể xem tổng doanh thu của cửa hàng theo từng giai đoạn. #figure(caption: "Giao diện trang Dashboard trên màn hình desktop", image("../images/imple/M_overview.png", fit: "cover")) #figure(caption: "Giao diện trang Dashboard trên màn hình desktop", image("../images/imple/M_overview2.png", fit: "cover")) #pagebreak() === *Model management* Tại mục *Category*, quản trị viên có thể xem danh sách các danh mục mô hình hiện có của cửa hàng. Quản trị viên có thể thêm, sửa hoặc xóa danh mục mô hình thông qua các nút *Thêm danh mục*, *Chỉnh sửa* và *Xóa*. #figure(caption: "Giao diện trang quản lý danh mục mô hình trên màn hình desktop", image("../images/imple/M_addmodel.png", fit: "cover")) Khi click vào nút *Thêm mô hình*, hệ thống sẽ hiển thị giao diện thêm mô hình. Tại đây, quản trị viên có thể thêm mô hình mới bằng cách điền đầy đủ thông tin của mô hình và click chọn *Thêm mô hình*. #figure(caption: "Giao diện trang thêm mô hình trên màn hình desktop", image("../images/imple/M_addmodel2.png", fit: "cover")) Nếu một trong các trường thông tin bị bỏ trống, hệ thống sẽ hiển thị thông báo lỗi và yêu cầu quản trị viên nhập đầy đủ thông tin của mô hình. #figure(caption: "Giao diện thông báo lỗi khi thêm mô hình trên màn hình desktop", image("../images/imple/M_addmodel3.png", fit: "cover")) Khi chọn vào một mô hình, quản trị viên có thể xem chi tiết các số liệu thống kê của mô hình đó. Tại đây, quản trị viên có thể xem: - Thông tin chi tiết của mô hình: Quản trị viên có thể xem toàn bộ thông tin của mô hình cũng như thay đổi hoặc xóa mô hình thông qua các nút *Chỉnh sửa* và *Xóa*. #figure(caption: "Giao diện chỉnh sửa thông tin mô hình trên màn hình desktop", image("../images/imple/M_editmodel.png", fit: "cover")) - Thông tin chi tiết về doanh thu của mô hình: Quản trị viên có thể xem số lượng người mua mô hình, số lượng mô hình đã bán được, doanh thu của mô hình, thống kê số lượng mô hình được mua theo từng thời điểm và phần trăm doanh thu của mô hình so với tổng doanh thu của cửa hàng. #figure(caption: "Giao diện trang quản lý mô hình trên màn hình desktop", image("../images/imple/M_adddetail.png", fit: "cover")) #figure(caption: "Giao diện trang quản lý sản phẩm trên màn hình desktop", image("../images/imple/M_adddetail2.png", fit: "cover")) #pagebreak() === *Order management* Tại mục *Order management*, quản trị viên có thể xem danh sách các đơn hàng của cửa hàng. Quản trị viên sẽ xem được các thông tin của đơn hàng như là: *Mã đơn hàng*, *Ngày đặt hàng*, *Tên khách hàng*, *Tổng tiền* và hai nút *Chấp nhận* và *Từ chối* để quản trị viên có thể chấp nhận hoặc từ chối đơn hàng. Bên cạnh đó còn có một thanh trạng thái để quản trị viên có thể lọc đơn hàng theo trạng thái của đơn hàng. #figure(caption: "Giao diện trang quản lý đơn hàng trên màn hình desktop", image("../images/imple/tracking.png", fit: "cover")) Khi click chọn vào một đơn hàng, quản trị viên có thể xem chi tiết đơn hàng đó. #figure(caption: "Giao diện trang chi tiết đơn hàng trên màn hình desktop", image("../images/imple/tracking2.png", fit: "cover")) #pagebreak()
https://github.com/pascal-huber/typst-letter-template
https://raw.githubusercontent.com/pascal-huber/typst-letter-template/master/examples/DIN-5008-A.typ
typst
MIT License
#import "@local/lttr:0.1.0": * #show: lttr-init.with( debug: true, format: "DIN-5008-A", title: "Writing Letters in Typst is Easy", settings: ( min_content-spacing: 10cm, ), opening: "Dear Peter,", closing: "Peace, I'm out", signature: "Hans", date-place: ( date: "20.04.2023", place: "Weitfortistan", ), horizontal-table: ( ("Ihr Zeichen", "Bananalover149"), ("Ihre Nachricht vom", "12.12.2022"), ("Unser Zeichen", "BananaFactory"), ("Datum", "06.08.2023"), ), return-to: "Bananas Ltd · Fruitstreet 15 · 1234 Monkey City · Gorillaland", remark-zone: ( "Why would anyone write a remark?", "...hideous...", ), receiver: ( "<NAME>", "Bahnhofsstrasse 16", "1234 Fruchtstadt", "Weitfortistan", ), sender: ([ #image("logo.png", width: 60%) Bananas Ltd.\ Fruitstreet 15\ 1234 Monkey City\ Gorillaland ]), ) #show: lttr-preamble #lorem(50) #lorem(20) #show: lttr-closing
https://github.com/505000677/2024SpringNote
https://raw.githubusercontent.com/505000677/2024SpringNote/main/2710/note-1.typ
typst
#import "../tizart.typ": * #show: project.with( title: "笔记", authors: (yuanxiang,), date: datetime.today() ) #show link: underline #outline() #set heading(numbering: "1.1.") = Day1 = Day2 Problem solving by searching #example(name:"Search example:")[ Find a path from one city to anthor city ] #figure( image("Day2-1E.jpeg", width: 60%) ) #definition(name:"Search")[ - Search( process) - The process of exploration of - The efficiency of the seach depends on:(each has a graph) - The search space and its size - Method used to explore (traverse) the search space - COndition to test the satisfaction of the search objective ( what it takes to determine I found the desired goal object) ] #definition(name:"Graph search algorithm")[ - General-search (problem, strategy) - initialize the search tree with the initial state of problem -loop - if there are no candidate states to explore next return failure choose a leaf node of the tree to expand next according to strategy - if the node satisfies the goal condition return the solution expand the node and add all of its successors to the tree -end loop ] #definition(name:"Properities of the breadth-first search")[ - For complexity use: - b = maximum branching factor - d = depth of the optimal solution - m = maximum depth of the search tree - Completeness: Yes. If the solution exists, it will be found. - Optimality: Yes. The solution found is the shortest path. - Time complexity: $O(b^d)$ - Space complexity: $O(b^d)$ nodes are kept in the memory #figure( image("bfs.png", width: 60%) ) ] #definition(name:"Properities of the depth-first search")[ - Completeness: No. It may not find the solution even if it exists. If infinite loops can ocour. - Solution1: Limit(m) the depth of the search tree - Solution2: Avoid repeated states - Optimality: No. It may not find the shortest path. Solution found first may not be the shortest possible. - Time complexity: $O(b^m)$ exponential in the maximum depth of the search tree m - Space complexity: $O(b*m)$ nodes are kept in the memory #figure( image("dfsSpace.png", width: 60%) ) #figure( image("eosp.png", width: 60%) ) ] = Day 4 Uninformaed Method #definition(name:"Uninformed search")[ - Uninformed search is a search strategy that uses no problem-specific knowledge - Uninformed search methods use only information available in the problem definition - Breadth-first search - Depth-first search - Iterative deepening search(IDA) - Bidirectional search - Minimum cost path search - Uniform-cost search ] #definition(name:"Iterative deepening (IDA)")[ - check tetxbook figure 3.8 b #figure( image("ida1.png", width: 60%) ) #figure( image("ida2.png", width: 60%) ) ] #clarification(name:"Properties of IDA")[ - Completeness: Yes. The solution is reached if it exists.( Same as BFS) - Optimality: Yes. The solution found is the shortest path.( Same as BFS) - Time complexity: $O(b^d)$ exponential in the depth of the solution d worse than BFS, but asymptotically the same - Space complexity: $O(b*d)$ nodes are kept in the memory. much better than BFS ] #definition(name:"Bi-directional search")[ - In some seach problems we want to find the path from the initial state to the unique goal state (e.g. Traveler problem) - Use inverse operators for the goal-initiated search. - Cuts the depth of the search tree by half - The time complexity is $O(b^{d/2})$ - The space complexity is $O(b^{d/2})$ #figure( image("bds.png", width: 60%) ) ] #definition(name:" Minimum cost path search")[ - Implement: - Path cost functionor for node n : - length of the path represented by the search tree branch starting at the root of the tree (initial state) to n - Search strategy: - Expand the leaf node with the minimum g(n) first - Can be implemented by a priority queue - Dijkstra's shortest path. In AI, the strategy goes under the name - Uniform cost search ] #clarification(name:"Properties Uniform cost search")[ - Completeness: Yes, assuming that operator costs are non- negative (the cost of path never decreases) - g(n)<=g(successors(n)) - Optimality: Yes. Returns the least-cost path. - Time complexity: number of nodes with the cost g(n) smaller than the optimal cost - Memory (space) complexity: number of nodes with the cost g(n) smaller than the optimal cost #figure( image("ucs.png", width: 60%) ) #figure( image("usc1.png", width: 60%) ) ] #definition(name:"Informed(Heuristic) search")[ - Informed search is a search strategy that uses problem-specific knowledge - Informed search methods use problem-specific knowledge to find solutions more efficiently - Best first search with a heuristic function ] #definition(name:"Best-First Search")[ - Expand the node with the lowest heuristic value - The heuristic function h(n) estimates the cost of the cheapest path from the state at node n to a goal state - The search strategy is greedy f(n)=h(n). the node that seems to be the closest to the goal is expanded first - $A*$ algorithm f(n)=g(n)+h(n) - iterative deepening A* (IDA*) ] #definition(name:"Properties of the greedy search")[ - Completeness: - No. It may not find the solution even if it exists.We can loop forever. Nodes that seem to be the best choices can lead to cycles. - Yes. Elimination of state repeats can solve the problem. - Optimality: No. It may not find the shortest path. - Even if we reach the goal, we may be biased by a bad heuristic estimate. Evaluation function disregards the cost of the path built so far. - Time complexity: $O(b^m)$ exponential in the maximum depth of the search tree m - Worst case !!! But often better! - Space complexity: $O(b*m)$ nodes are kept in the memory - Often better! #figure( image("gs1.png", width: 60%) ) #figure( image("greedy.png", width: 60%) ) ] == Day 5 #definition(name:"A* Saerch")[ - $f(n)=g(n)+h(n)$ - g(n) - cost of reaching the state - h(n) - estimate of the cost from the current state to a goal - f(n) - estimate of the path length #figure( image("astar.png", width: 60%) ) ] #clarification(name:"Properties of the A* search")[ - Completeness: Yes. The solution is reached if it exists. With positive costs on links, the algorithm is complete even without repeat checks. - Optimality: Yes. The solution found is the shortest path. - Admissible heuristic condition: h(n) <= $"h*(n)"$ #figure( image("OPTASTAR.png", width: 60%) ) - Time complexity: $O(b^d)$ exponential in the depth of the solution d - Better than BFS and $"IDA*"$ Order roughly the number of nodes with f(n) smaller than the cost of the optimal path $"g*"$ - Space complexity: $O(b^d)$ nodes are kept in the memory - Better than BFS and $"IDA*"$ ] #definition(name:"Iterative deepening A* (IDA*)")[ - IDA* is a combination of iterative deepening and A* search - The algorithm is complete and optimal - The time complexity is $O(b^d)$ - The space complexity is $O(b*d)$ - Progressively increases the evaluation function limit (instead of the depth limit) - Performs limited-cost depth-first search for the current evaluation function limit - Keeps expanding nodes in the depth first manner up to the evaluation function limit - Problem: it is unclear what is the amount by which the evaluation limit should be progressively increased #figure( image("IDAS1.png", width: 60%) ) #figure( image("IDAS2.png", width: 60%) ) ] == Day 6 #definition(name:" Constraint satisfaction problem(CSP)")[ - Two types of search: - path search: We seek a path from the initial state to a state satisfying the goal condition (Puzzle8, Route finding) - configuration search: We seek a state (configuration ) satisfying the goal condition (n-queens problem) - Constraint satisfaction problem (CSP)= a configuration search problem where: - A state is defined by a set of variables and their values - Goal condition is represented by a set constraints on possible variable values - Special properties of the CSP lead to special search procedures we can design to solve them ] #definition(name:" Constraint propagation")[ - The process of inferring the legal and illegal values of unassigned variables is referred to as constraint propagation - the process of inferring of new equations and disequations from existing equations and disequations - Node propagation: equations (valid assignments) or disequations (invalid assignments) for an individual variable by applying a unary constraint - Forward checking: - disequations from equations defining the partial assignment, and a constraint - Equations through the exhaustion of alternatives - Restricted forward checking: - uses only active constraints (active constraint - only one variable unassigned in the constraint) - Arc consistency: - disequations from the set of equations and disequations defining the partial assignment, and a constraint - equations through the exhaustion of alternatives ] == Day10.10 #example(name:"Example:")[ Jack is loved by somebody: $ exists x "loves"(x, "Jack") $ Assume for sake of controidition: $ not "T2": not "love(y, Jack)" $ Unify: R1a: $not "T2" "with" {x|"Jack",y|G("Jack")}$ ] 123 $ integral^a_b f(x)d x $
https://github.com/lluchs/evince-typst
https://raw.githubusercontent.com/lluchs/evince-typst/master/tests/rects.typ
typst
Apache License 2.0
#set document(title: "Rectangles (and a circle)") #set page( width: 10cm, height: 15cm, ) #rect(width: 5cm, height: 3cm, fill: red) #rect(width: 2cm, height: 4cm, fill: yellow) #circle(radius: 2cm, fill: green)
https://github.com/KireinaHoro/research-plan
https://raw.githubusercontent.com/KireinaHoro/research-plan/master/README.md
markdown
# Doctoral Plan [Latest version](https://gitlab.inf.ethz.ch/OU-ROSCOE/phd-thesis-research-proposals/doctoral-plan-pengxu/-/jobs/artifacts/master/raw/main.pdf?job=build) built by CI Written in Typst; a crash course on how to write in the language is [here](https://typst.app/docs/tutorial/writing-in-typst/). Install [the compiler](https://github.com/typst/typst) by downloading a [binary release](https://github.com/typst/typst/releases/), or with `cargo`: ```console $ cargo install --locked typst-cli ``` Launch the interactive watch session to automatically compile based on file change: ```console $ typst watch main.typ watching main.typ writing to main.pdf [15:31:57] compiled successfully in 96.83ms ```
https://github.com/luiswirth/numpde-slides
https://raw.githubusercontent.com/luiswirth/numpde-slides/main/src/layout.typ
typst
#let finishline = line(stroke: red + 0.3pt, length: 100%) #let myblock(color: red.darken(40%), width: 100%, title, content) = block( fill: color, stroke: white, inset: 0.3em, radius: 0.3em, breakable: false, [ #block(inset: 0.2em)[#pad(x: 1.0em)[*#title*]] #block( fill: black.lighten(10%), inset: 1.2em, above: 0.3em, width: width, [ #content ] ) ] ) #let circletext(content) = box( baseline: 0.2em, stroke: white, inset: 0.2em, radius: 0.3em, content, )