Skip to content

Instantly share code, notes, and snippets.

View alok's full-sized avatar

Alok Singh alok

View GitHub Profile

Shabbos is one of the strangest ideas human beings ever took seriously.

Not feast. Not conquest. Not even prayer, at least not first.

First: stop.

I dont care if this is ai slop, its based on my notes.

Your writing is strong. It is also too private to spread.

Your problem is not that you are too dark. It is not that you are too intelligent. It is not that you are too stylistic. Your problem is that you are writing from too far inside your own completed perception.

You see the shape of the thing quickly. You reach the pattern early. You compress hard. You trust the reader to make the same climb because, to you, the climb now feels obvious. But almost nobody reads that way. Most people do not start where you start. They do not begin with the largest pattern, the furthest consequence, or the most distilled emotional residue. They begin with a person, a room, a body, a choice, a threat they can touch.

That is the gap.

People love comeback stories because most people suspect they’ve been reduced.

That’s the real thing here. Not “resilience.” Not “hope.” Not whatever sanitized word people use when they want to gesture at something without touching it.

They worry life has made them smaller than they were supposed to be, and they want proof that this is not final.

That’s why these stories work.

A general becomes a slave. A king is wandering around in the dirt. A talented person wastes years. Someone gets old. Someone gets humiliated. Someone with obvious force spends a long time beneath himself. These plots hit because they take a private fear and make it visible.

@alok
alok / Post.md
Created April 9, 2026 06:54
Post

I’m getting 404s pls don’t throw me out here’s words

A lot of disagreement happens before the disagreement. Two people hear the same sentence. They do not hear the same thing. In Dredd, the exchange is a little different from the way I first remembered it. Dredd offers “life in an iso-cube without parole” if the hostage is released unharmed, and the man replies, “Life without parole? That’s the deal you’re offering?” What matters there is not the movie. It’s the split. One person hears an inducement. The other hears a joke. Or an insult. Or a death sentence with paperwork.

inductive Transcendental where
| sin
| cos
| tan
| exp
| log
deriving Repr
/-- A simple vector type with a proof that the size is the same as the length of the array-/
structure Vector (a : Type) (n : Nat) where
@alok
alok / GTXParser.lean
Last active November 15, 2024 07:10
A parser for Gwern's GTX format in Lean 4, to play with the syntax
import Lean.Parser
import Std.Internal.Parsec
import Std.Data.HashMap
open Lean.Parser
open Std.Internal.Parsec
/-!
{- GTX: custom document format for Gwern.net, for lightweight writing of annotations.
author Alok Singh
comments true
layout post
mathjax true
slug noncommutative-3d-rotations
title Exploring Non-Commutative 3D Rotations with Grassmann Algebra

People find rotation hard because when we try to visualize something, often we project it onto a 2D plane. But for rotations, this loses the plot because 2D rotations DO commute. In this post, we will (symbolically) explore this non-commutative nature of 3D rotations using Grassmann algebra in Julia. We'll use the Grassmann package to define rotors and demonstrate how the order of rotations matters in three-dimensional space.

import Mathlib
import Lean.Data.Parsec
import Batteries.Lean.HashMap
import Lean.Data.HashMap
import Lean.Util.Path
import Lean.Data.Rat
import LeanInf.Basic
-- set_option diagnostics true
theorem two_plus_two : 2 + 2 = 4 := rfl
@alok
alok / Lisp.lean
Created July 13, 2024 07:28
lisp parser in lean 4
import Lean
import Lean.Parser
import Mathlib
open Lean.Parsec
namespace Lisp
-- Lisp data types
inductive LispVal where
| Atom (name : String)
| List (elements : List LispVal)
@alok
alok / seventeen_dim.jl
Created May 4, 2024 08:39
5 and 17 dimensional rotations
# Reorganized code to focus on rotating a random 17-dimensional multivector and projecting it to 3D for visualization
using Grassmann
# Define the basis for 3D and 17D spaces
basis_3,basis_5,basis_17 = Λ(3), Λ(5), Λ(17)
# Define submanifolds for 3D and 17D spaces
V_3, V_5, V_17 = Submanifold(3), Submanifold(5), Submanifold(17)