Patrick Lei

Algebraic geometer at the Shanghai Center for Mathematical Sciences.

中文
about meseminarsnotestravelusesarXivnowCVabout meseminarsnotestravelusesarXivnowCV
Figure 1. A stable map f:(C,x1,x2,x3)→X of genus 2, with insertions α1,α2,α3∈A*(X).

Uses

Things I use and like.

live-TeXing

I think the most important things are typing speed (empirically, you only need to type around 75 wpm), muscle memory, a good set of LaTeX macros and shortcuts, and a good snippets engine in the editor. I type all commutative diagrams directly in tikzcd environments during the lecture, but more complex figures are post-processed.

  • laptop

    14 inch MacBook Pro (M4 Pro)

    I didn’t realize it would take so much effort to get macOS to behave like my old Linux setup. I used to use a System76 Lemur Pro (running either Arch Linux or NixOS), which I liked a lot. Before that, I used a 2015-era MacBook Air, but I hate its keyboard.

  • editor

    neovim, VS Code

    Almost all of the notes were taken in neovim (including all of the notes taken as a student), with a small number done in VS Code. Most modern code editors have good performance, so the most important thing is to have a good snippets engine (I currently use LuaSnip in neovim and HyperSnips in VS Code).

  • window manager

    none (macOS), hyprland (Linux)

    Ideally, Linux would have a Wayland version of XMonad which plays well with a status bar better than xmobar (which sucks). With hyprland now being configured in Lua, we might actually have something like that. I also used i3, awesome, dwm, bspwm, sway, and river on Linux, but screen tearing on X makes it not usable for me and I found hyprland to be the best experience on Wayland for me (but Sway’s tabbed layout implementation was better). I’ve tried Yabai, AeroSpace, and Paneru on macOS, but using them is like fighting the OS, so I switched to a single virtual desktop and just using Command+Tab to switch windows and Raycast to lay them out.

  • AI tools

    Codex, Claude Code

    Pure TikZ for images is a complete mystery to me, so what used to be painstaking hand-written reproduction of images post-lectures is now a prompt to a coding agent. Some models used to be terrible at this (looking at you, GPT-5.6 Sol), but tikz-bench indicates that TikZ is largely saturated at the US frontier. In terms of value for money, see below. (tl;dr: use the US subscriptions if possible.) I have also wanted HTML versions of my notes since I was an undergrad, and let’s just say that agents made this happen in a few hours. However, LaTeX is so janky that the build pipeline for the html versions involves compiling diagrams with LaTeX into SVGs, compiling text via tex4ht, compiling equations into MathML via MathJax, and then post-processing the MathML because MathJax comes with an outdated version of MathML.

    How much inference do these subscriptions buy?

    Last updated November 18, 2026

    What my AI subscriptions buy

    Someone I know (if you are reading this, you know who you are) complained about how little usage they got with their AI subscription (which cost about $100/month), so I decided to try to estimate the value of various AI subscriptions from both US and Chinese providers. All assumptions and choices are based on the nature of the aforementioned conversation.

    Every reasoning setting as a table
    Plan / modelReasoningAA scoreAA cost / taskQuota / taskTasks / month
    Codex Pro 100GPT-6.2 Astralow45.7$0.660.023%4,282
    Codex Pro 100GPT-6.2 Astramedium57.0$1.620.057%1,751
    Codex Pro 100GPT-6.2 Astrahigh60.1$2.070.073%1,366
    Codex Pro 100GPT-6.2 Astraxhigh61.6$2.520.089%1,124
    Codex Pro 100GPT-6.2 Astramax62.1$4.000.14%709
    Codex Pro 100GPT-6.2 Sollow40.6$0.180.0065%15,433
    Codex Pro 100GPT-6.2 Solmedium52.7$0.410.014%6,977
    Codex Pro 100GPT-6.2 Solhigh54.9$0.560.02%5,027
    Codex Pro 100GPT-6.2 Solxhigh55.7$0.650.023%4,372
    Codex Pro 100GPT-6.2 Solmax57.3$1.010.036%2,793
    Codex Pro 100GPT-6 Astralow43.3$1.420.05%1,990
    Codex Pro 100GPT-6 Astramedium51.6$2.730.096%1,037
    Codex Pro 100GPT-6 Astrahigh54.8$3.240.11%875
    Codex Pro 100GPT-6 Astraxhigh55.3$3.660.13%774
    Codex Pro 100GPT-6 Astramax56.9$6.250.22%454
    Codex Pro 100GPT-6.1 Sollow34.8$0.160.0057%17,543
    Codex Pro 100GPT-6.1 Solmedium46.3$0.360.013%7,883
    Codex Pro 100GPT-6.1 Solhigh50.3$0.590.021%4,794
    Codex Pro 100GPT-6.1 Solxhigh52.5$0.760.027%3,708
    Codex Pro 100GPT-6.1 Solmax54.6$1.270.045%2,227
    Codex Pro 100GPT-6.1 Terranone30.5$0.230.008%12,542
    Codex Pro 100GPT-6.1 Terralow29.4$0.0710.0025%39,714
    Codex Pro 100GPT-6.1 Terramedium38.2$0.170.006%16,784
    Codex Pro 100GPT-6.1 Terrahigh42.4$0.260.0092%10,926
    Codex Pro 100GPT-6.1 Terraxhigh45.3$0.400.014%7,071
    Codex Pro 100GPT-6.1 Terramax51.3$0.960.034%2,948
    Claude Max 5xClaude Opus 5.5low34.8$0.980.021%4,721
    Claude Max 5xClaude Opus 5.5medium48.2$2.450.053%1,879
    Claude Max 5xClaude Opus 5.5high51.8$3.470.075%1,329
    Claude Max 5xClaude Opus 5.5xhigh57.4$6.050.13%762
    Claude Max 5xClaude Opus 5.5max59.1$10.040.22%459
    Claude Max 5xClaude Sonnet 5.5low25.6$0.510.011%9,007
    Claude Max 5xClaude Sonnet 5.5medium30.8$0.780.017%5,899
    Claude Max 5xClaude Sonnet 5.5high41.5$1.640.036%2,815
    Claude Max 5xClaude Sonnet 5.5xhigh49.9$4.090.089%1,125
    Claude Max 5xClaude Sonnet 5.5max54.5$10.020.22%460
    Claude Max 5xClaude Haiku 5.5low18.6$0.0440.00095%105,241
    Claude Max 5xClaude Haiku 5.5medium24.6$0.0920.002%50,189
    Claude Max 5xClaude Haiku 5.5high29.9$0.160.0034%29,037
    Claude Max 5xClaude Haiku 5.5xhigh34.6$0.250.0054%18,540
    Claude Max 5xClaude Haiku 5.5max36.5$0.410.0089%11,205
    Claude Max 5xClaude Fable 5.250% weekly caplow53.9$3.100.19%540
    Claude Max 5xClaude Fable 5.250% weekly capmedium56.4$3.800.23%440
    Claude Max 5xClaude Fable 5.250% weekly caphigh61.8$9.080.54%184
    Claude Max 5xClaude Fable 5.250% weekly capxhigh62.2$14.830.89%113
    Claude Max 5xClaude Fable 5.250% weekly capmax64.6$26.541.6%63
    Google AI Ultra (Antigravity)Gemini 4 Carbonlow54.2$7.190.44%228
    Google AI Ultra (Antigravity)Gemini 4 Carbonmedium58.3$6.590.4%249
    Google AI Ultra (Antigravity)Gemini 4 Carbonhigh60.0$7.760.47%211
    Kimi Code (mainland China)Kimi K3.1 Pro—46.5$3.681.1%93
    MiMo MaxMiMo-V2.6-Pro—29.9$0.260.22%462
    GLM Coding ProGLM-5.3low23.1$1.580.28%357
    GLM Coding ProGLM-5.3max31.7$5.010.89%112
    GLM Coding ProGLM-5.3-Flash—27.8$0.580.3%332
    Tencent Token Plan MaxHy4—34.6$1.031%99

    Scroll for more columns →

    Plan / modelPrice / monthAA scoreAPI value / monthAA cost / taskAA time / taskTasks / monthTasks / $100
    Codex Pro 100GPT-6.2 Astra (max)$10062$2,833.22$4.0012.9 min709709
    Codex Pro 100GPT-6.2 Astra (xhigh)$10062$2,833.22$2.526.8 min1,1241,124
    Codex Pro 100GPT-6.2 Sol (max)$10057$2,833.22$1.018.0 min2,7932,793
    Codex Pro 100GPT-6.2 Sol (xhigh)$10056$2,833.22$0.655.0 min4,3724,372
    Codex Pro 100GPT-6 Astra (max)$10057$2,833.22$6.2520.8 min454454
    Codex Pro 100GPT-6 Astra (xhigh)$10055$2,833.22$3.6610.3 min774774
    Codex Pro 100GPT-6.1 Sol (max)$10055$2,833.22$1.2721.9 min2,2272,227
    Codex Pro 100GPT-6.1 Sol (xhigh)$10053$2,833.22$0.7610.1 min3,7083,708
    Codex Pro 100GPT-6.1 Terra (max)$10051$2,833.22$0.9613.7 min2,9482,948
    Claude Max 5xClaude Fable 5.2 (high)50% weekly cap$10062$1,672.61$9.0817.9 min184184
    Claude Max 5xClaude Fable 5.2 (xhigh)50% weekly cap$10062$1,672.61$14.8326.4 min113113
    Claude Max 5xClaude Opus 5.5 (max)$10059$4,605.34$10.0426.7 min459459
    Claude Max 5xClaude Opus 5.5 (xhigh)$10057$4,605.34$6.0516.1 min762762
    Claude Max 5xClaude Sonnet 5.5 (max)$10055$4,605.34$10.0231.5 min460460
    Claude Max 5xClaude Sonnet 5.5 (xhigh)$10050$4,605.34$4.0914.9 min1,1251,125
    Google AI Ultra (Antigravity)Gemini 4 Carbon (high)$10060$1,637.35$7.7627.4 min211211
    Kimi Code (mainland China)Kimi K3.1 Pro$10047$343.18$3.6836.6 min9393
    MiMo MaxMiMo-V2.6-Pro$10030$118.79$0.2645.0 min462462
    GLM Coding ProGLM-5.3 (max)$8032$561.62$5.0131.3 min112140
    GLM Coding ProGLM-5.3-Flash$8028$193.73$0.5840.3 min332415
    Tencent Token Plan MaxHy4$10335$101.76$1.0313.9 min9996

    “Tasks” means a task on one of the benchmarks used in the Artificial Analysis (AA) Intelligence Index. We are assuming for now that cost/task as measured by Artificial Analysis is close to proportional to the cost/task in the real world. The index measures overall model capabilities, whereas you may find different levels of performance in your own usage. If you would like to measure model performance for your usage, consider making your own benchmark.

    These estimates are based on my actual usage and the subscription rules (for example session limits, weekly limits, etc).

  • PDF viewer

    Zathura (Linux), Skim (macOS)

    Just look at the different file formats supported by Zathura. I wish every other PDF viewer had this kind of file format coverage, and the vim motions make everything quite convenient, especially when jumping from a neovim window. Skim has synctex support, but otherwise it is not very good.

Running

I swear by RunRepeat, in particular the tests for shock absorption, energy return, breathability, and weight. I also go to physical stores and try on the shoes, so shoes need to have good numbers (I generally use fast shoes as daily trainers) and fit my feet and running mechanics. I have no scientific testing of gels, so my opinion is literally just based on vibes.

There is a lot of misinformation in running shoe reviews (for example this article claims the Lightstrike Pro foam in the Evo SL differs from race shoes, but RunRepeat cut foam from both the Evo SL and the Adios Pro 3 (note: not the Adios Pro Evo 3) and found them to be the same under a microscope), so be careful about what you read online.

  • daily trainer

    Saucony Endorphin Pro 4

    Both the numbers and actual use suggest this shoe is a carbon-plated trainer rather than a race shoe. This might be the slowest shoe I own currently.

  • speed work

    Saucony Endorphin Speed 5

    This is possibly the favorite model of running shoe I have ever worn, is extremely durable, and has grown on me with time. The only flaw is that it isn’t so cushioned for longer runs. With 78% energy return in the forefoot and a low stack height, it works very well for things that resemble track sessions.

  • long runs

    Adidas Adizero Evo SL

    Another nearly perfect shoe. The only flaw with this shoe is that the foam is only responsive for something like 300 miles. It’s also completely fine for extremely cold weather despite the breathability, is already very comfortable, and grips well in wet conditions, so I don’t get why Adidas introduced the ATR or woven versions.

  • race day

    Asics Metaspeed Edge Tokyo

    I went to Marathon Sports, tried on a bunch of race shoes, and this one felt best. Weight is unfortunately not so competitive with the Adios Pro Evo 3 (but which non-Adidas shoe is?) and even with Asics is not so competitive with the Metaspeed Ray, but that shoe didn’t exist when I bought this one. I did break 3 in it, so I am quite happy with the shoe.

  • gels

    Maurten Gel 100

    Goes down easily in situations where water is limited, doesn’t upset the stomach, and no weird taste.

  • watch

    Garmin Forerunner 970

    Yes, I paid for the flashlight and navigation features...

What is this?