Skip to content

Instantly share code, notes, and snippets.

View Vilin97's full-sized avatar

Vasily Ilin Vilin97

View GitHub Profile
@Vilin97
Vilin97 / gist:51eb28c7ea2e750968b30039bf6bca3e
Created February 28, 2026 01:01
Dyadic <-> Dyadic equivalance
import Mathlib
namespace dyadic
-- k/2^n
inductive Dyadic where
| zero : Dyadic
| add_one : Dyadic → Dyadic -- x ↦ x + 1
| half : Dyadic → Dyadic -- x ↦ x / 2
| neg : Dyadic → Dyadic -- x ↦ -x
import Mathlib
namespace HW_III_6
universe u
inductive MyEq {α : Sort u} : α → α → Prop where
| refl a : MyEq a a
#check MyEq 1 2
#!/usr/bin/env python3
"""
Reconstruct the true PutnamBench SOTA timeline by combining:
1. Git commit history of results.json (for models added in real time)
2. Manual corrections for models whose paper/announcement dates differ
from when they were added to the leaderboard.
Saves CSV and generates a plot.
"""
@Vilin97
Vilin97 / gist:7eca0f4c08790898ee49b233b8aa1ae2
Created February 15, 2026 19:07
History explorer javascript
import { useState, useRef, useCallback, useEffect } from "react";
/* ─── constants ─── */
const LOADING_PHRASES = [
"Digging through the archives…",
"Unearthing forgotten scandals…",
"Consulting dusty manuscripts…",
"Interviewing ghosts…",
"Decoding secret diaries…",
];
@Vilin97
Vilin97 / gist:da82998d8241b195fd3d65d42a96ca17
Created February 5, 2026 18:04
visualize arxiv papers using lean
#%% Imports and setup
import json
import re
DATA_PATH = "arxiv-metadata-oai-snapshot 2.json"
#%% Load all papers that contain the word "lean" (case-insensitive) anywhere in title/abstract/comments
papers_with_lean = []
with open(DATA_PATH, "r") as f:
@Vilin97
Vilin97 / gist:d8e9aaf703d062f44b05e7800f09eeb6
Created February 1, 2026 17:17
Get arXiv papers using Lean
#%% Imports and setup
import json
import re
DATA_PATH = "arxiv-metadata-oai-snapshot.json"
#%% Load all papers that contain the word "lean" (case-insensitive) anywhere in title/abstract/comments
papers_with_lean = []
with open(DATA_PATH, "r") as f:
@Vilin97
Vilin97 / reset.jl
Created October 11, 2023 19:23
`reset` optimiser state in `Flux`
"reset a leaf"
function reset!(leaf::Leaf{A, S}) where {A <: Optimisers.Adam, S}
leaf.state[1] .= 0
leaf.state[2] .= 0
leaf.state = (leaf.state[1], leaf.state[2], leaf.rule.beta)
nothing
end
"reset optimiser state"
function reset!(state::NamedTuple{(:layers,), L}) where {L}
for layer in state.layers
@Vilin97
Vilin97 / structs.jl
Created August 21, 2021 17:04
Benchmarking code for new `PriorityTable`
using DiffEqJump, Random, BenchmarkTools, DataStructures
const MINJUMPRATE = 2.0^exponent(1e-12)
function pq_setup(rates)
pqdata = randexp(length(rates))./rates
MutableBinaryMinHeap(pqdata)
end
function pt_setup!(pt, rates)
DiffEqJump.reset!(pt)
\DeclarePairedDelimiter{\norm}{||}{||_1}
\providecommand{\floor}[1]{\left \lfloor #1 \right \rfloor }
\newcommand{\shortexactseq}[5]{#1\to #2 \hookrightarrow #3 \twoheadrightarrow #4 \to #5}
\newcommand{\rad}[1]{\sqrt{#1}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\gen}[1]{\langle #1 \rangle}
\newcommand{\restr}[1]{|_{#1}}
\newcommand{\sepdeg}[2]{[{#1}:{#2}]_{\rm sep}}
\renewcommand{\Pr}{\mathbb{P}}