Skip to content

Instantly share code, notes, and snippets.

View alreadydone's full-sized avatar

Junyan Xu alreadydone

View GitHub Profile
@FaffyWaffles
FaffyWaffles / RobinsStirlingBound.lean
Created October 30, 2025 14:11
This file proves the sharp Robbins bound for successive differences in the logarithm of the Stirling sequence: |log(stirlingSeq(k+1)) - log(stirlingSeq(k))| ≤ 1/(12*k*(k+1))
import Mathlib
open scoped BigOperators
open Filter
open scoped Nat
namespace Real
/-
============================================================
@llllvvuu
llllvvuu / nesterov.lean
Last active October 28, 2025 12:31
Cleaned up to target Mathlib v4.24.0. @Aristotle-Harmonic proof following https://x.com/ErnestRyu/status/1980759528984686715
import Mathlib
set_option linter.style.longLine false
open Set Filter Topology RealInnerProductSpace Gradient
variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] (f : V → ℝ) (X : ℝ → V) (r : ℝ)
def minimizers : Set V := {x | IsMinOn f Set.univ x}
@vgel
vgel / r1.py
Last active August 14, 2025 13:13
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(
@yoavg
yoavg / multi-llm-agents.md
Last active November 21, 2025 19:14
What makes multi-agent LLM systems multi-agent?

Are multi-LLM-agent systems a thing? Yes they are. But.

Yoav Goldberg, Nov 24, 2024

This piece started with a pair of twitter and bluesky posts:

let's talk about "agents" (in the LLM sense). there's a lot of buzz around "multi-agent" systems where agents collaborate but... i don't really get how it differs from a thinking of a single agent with multiple modes of operation. what are the benefits of modeling as multi-agent?

— (((ل()(ل() 'yoav))))👾 (@yoavgo) November 23, 2024
@seewoo5
seewoo5 / sage-lecture-beamer.pdf
Last active October 11, 2024 20:08
Number theory tutorial with Sage
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chrisflav
chrisflav / demo.lean
Last active June 25, 2024 17:48
Demo of Ringhom Properties to Scheme Morphism Properties
import Mathlib.RingTheory.RingHom.FinitePresentation
import Mathlib.RingTheory.Flat.Algebra
import Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation
/-!
Authors: Judith Ludwig, Christian Merten
Note: This only works on the mathlib branch chrisflav/finpres.2
-/
@swyxio
swyxio / DAY_1_devin_train_gpt2.c
Last active April 16, 2024 19:52
Devin-coded version of @karpathy's train_gpt.py ported to C, per his challenge https://x.com/swyx/status/1777496494448488541 this is where Devin stopped about 6 hours in, however it is not complete and I can prompt it to keep going.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// Constants for model dimensions, learning rate, etc.
@thesamesam
thesamesam / xz-backdoor.md
Last active December 9, 2025 03:22
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@xennygrimmato
xennygrimmato / localization_eval.py
Created March 16, 2024 01:54
Devin SWE-Bench Analysis
import collections
from fractions import Fraction
import os
import re
from typing import Dict, List, Set, Tuple, Union
from datasets import load_dataset
import pandas as pd
import Mathlib.Tactic
inductive E
| lit : Bool → E
| var : Nat → E
| ite : E → E → E → E
deriving DecidableEq
def E.hasNestedIf : E → Bool
| lit _ => false