# Verify: The Invisible Golden Snitch

This guide gives a written recipe for each check, so that you can check the results with a few lines of code of your own. Each recipe states the numbers to start from, the formula, the expected answer, and what a pass shows and does not show. No program of ours is needed; the numbers below are enough to reproduce each result with a few lines of your own code. Each recipe also comes as a [step-by-step page](https://gocheckyourself.org/data/recipes/golden-snitch-REPLICATE.md) with commands for Windows, macOS and Linux and the exact output to expect.

## What is claimed

| Question | Claim | Range |
|---|---|---|
| How long does the classical spiral take? | $T = \frac{\alpha d}{v(\alpha-1)}e^{2\pi/\sqrt{\alpha^2-1}} - d/v$ equals a direct integration of the turn | 6 speed ratios |
| Is the closed form of a Snitch's path right? | It matches direct numerical integration of the motion | 25 start angles and speed ratios |
| Is the corner as stated? | At a start angle of $10^{-6}$, $\cos\theta = -1/\alpha$ and the two power laws hold to better than $2 \times 10^{-7}$ | 5 speed ratios |
| Is the curve shorter than the circle? | Yes at the three ratios measured | 3 speed ratios |
| Does the chase of sample Snitches finish? | Yes at $\alpha = 2, 3, 5, 7$. No at $\alpha = 1.25, 1.5$ | 4 sample sizes, two layouts |
| Can Harry catch the Snitch exactly, at every speed ratio above 1? | Not shown here (status OPEN) | the whole question |

The statements, with their conditions, are in the statement file and in [THEOREMS.md](THEOREMS.md).

## Status

Computed within this project; not yet refereed. An independent replay of the formulas and of the chases agreed with the numbers below. Nobody outside this project has reviewed any of this.

- **Closed form and corner:** proved on paper (Theorems 2 and 3) and checked numerically (recipes 2 and 3).
- **Tip law and length balance:** proved under stated conditions (Theorems 5 and 6). The conditions are not shown for the real chase. Recipe 6 checks only the stretching identity.
- **Chases:** computed (recipe 5). They are samples, not the whole curve.

## Commands

### Step 0: fingerprints

Run inside the certificates folder. Every line must report OK. Any program that computes SHA-256 will do; on Windows use the second command for one file at a time.

```
sha256sum -c SHA256SUMS.txt  # Linux
shasum -a 256 -c SHA256SUMS.txt   # macOS
CertUtil -hashfile results.json SHA256
```

The folder holds one results file with every number quoted in the book. The recipes below let you reproduce each number without it.

### Recipe 1: the spiral time

Take $d = v = 1$ and $V = \alpha$. Harry's turn starts at the distance $\alpha/(\alpha - 1)$ at time $1/(\alpha - 1)$. Along the turn his distance from the start is $1 + t$ and his angle grows at the rate $\sqrt{\alpha^2 - 1}/(1 + t)$. Find the time $T$ at which the angle reaches $2\pi$, by integrating or by solving $\sqrt{\alpha^2-1}\,\ln\!\big((1+T)/(1 + 1/(\alpha-1))\big) = 2\pi$. Compare with the formula.

Expected: $T = 21741.3733$, $826.5455$, $74.2447$, $12.8309$, $3.5073$, $1.8894$ for $\alpha = 1.25, 1.5, 2, 3, 5, 7$. The two ways agree to 15 digits. A pass shows the formula is the right integral of the turn. It does not show that the spiral is an answer to the riddle, whose Snitch flees from Harry's current position.

### Recipe 2: the closed form against direct integration

Take $d = v = 1$, $V = \alpha = 2$, and a Snitch starting at $(\cos 1, \sin 1)$. Harry is at $(Vt, 0)$. Integrate $\dot S = (S - H)/\lVert S - H\rVert$ numerically up to $t_1 = 1/(\alpha - 1) = 1$ with a tight tolerance (relative $10^{-13}$). Separately, use Theorem 2: put $\theta_0 = 1$, $r_0 = 1$, $y_0 = \sin 1$, $u_0 = \tan(1/2)$, solve the time formula for $u$ so that $V(t_1 - 0)$ is matched (the time grows with $u$, so bisection works), compute $r$ and $\theta$, and place the Snitch at $H(t_1) + r(\cos\theta, \sin\theta)$.

Expected: both give $(0.33617353, 1.74108756)$, with $r = 2.4082576$ and $\theta = 2.3335073$. Over the 25 cases of the claims table the largest difference is $9.9 \times 10^{-14}$. A pass shows the formula solves the motion. It does not show anything about the chase.

### Recipe 3: the corner

With $d = v = 1$ and $t_1 = 1/(\alpha - 1)$, use the recipe 2 formulas at the start angle $\varphi = 10^{-6}$. Compute $\cos\theta$, the distance $r_1$ from Harry, and $\sigma$ as the distance between the positions for $\varphi(1 \pm 10^{-4})$ divided by $2\varphi \cdot 10^{-4}$. Compare with $-1/\alpha$, with $C\varphi^{1 - 1/\alpha}$ and with $(1 - 1/\alpha)C\varphi^{-1/\alpha}$, where $u_* = \sqrt{(\alpha+1)/(\alpha-1)}$ and $C = 2^{1/\alpha - 1}(u_*^{1/\alpha - 1} + u_*^{1/\alpha + 1})$.

Expected, at $\alpha = 2$: $C = 2.14913986$, $\cos\theta = -0.50000000023$, and both ratios equal 1 to within $10^{-8}$. The arms leave at $\arccos(1/\alpha)$ from straight behind: $36.87$, $48.19$, $60.00$, $70.53$ and $78.46$ degrees for $\alpha = 1.25, 1.5, 2, 3, 5$. A pass shows the limits are right to the precision tested. It does not show them for other ratios.

### Recipe 4: the length of the curve

At $\alpha = 2$, $d = v = 1$, $t_1 = 1$: compute the positions at $t_1$ for $\varphi_i = \pi(i/2000)^4$, $i = 1, \dots, 1999$, and for $\varphi = \pi - 10^{-9}$, by recipe 2. Put the tip $(\alpha t_1, 0)$ in front. Add up the straight distances between neighbouring points, and double the sum (the curve is symmetric about the $x$-axis).

Expected: $11.7249$, against the circle's $2\pi(1 + t_1) = 12.5664$. At $\alpha = 1.25$: $26.8575$ against $31.4159$. At $\alpha = 5$: $7.6817$ against $7.8540$. A pass shows the curve is shorter than the circle at these three ratios. It does not show it for other ratios.

### Recipe 5: the chase of sample Snitches

Take $d = v = 1$, $V = \alpha$, and $N$ samples at the angles $\varphi_k = 2\pi k/N$, $k = 0, \dots, N-1$.

1. Harry flies along $+x$ for $t_1 = 1/(\alpha - 1)$. Move samples $1, \dots, N - 1$ by "the move" below, which is recipe 2 applied to a sample. Harry is at $(\alpha t_1, 0)$ and sample 0 is caught.
2. For $k = 1, \dots, N - 1$: let $R = S_k - H$, $\ell = \lVert R\rVert$, $\hat{u} = R/\ell$, $\Delta t = \ell/(V - v)$. Move samples $k + 1, \dots, N - 1$ for the time $\Delta t$ while Harry flies along $\hat{u}$. Set $H \leftarrow H + V\Delta t\,\hat{u}$, $S_k \leftarrow H$ and $t \leftarrow t + \Delta t$.
3. The answer is the final $t$, which started at $t_1$. If any distance exceeds $10^{15}$, the chase does not finish.

The move, for one sample while Harry flies straight along $\hat{u}$ for the time $\Delta t$: write the sample as $(x, y)$ in the frame whose $x$-axis is $\hat{u}$, with Harry at the origin. If $y \neq 0$, use Theorem 2 with $\theta_0 = \operatorname{atan2}(|y|, x)$ and $y_0 = |y|$, find $u$ at the later time, and keep the sign of $y$. If $y = 0$ and $x \ge 0$ the sample is dead ahead and the gap closes at $V - v$; if $x < 0$ it recedes at $V + v$.

Expected for $N = 180$: $22.5334$, $7.0694$, $2.6143$, $1.5549$ at $\alpha = 2, 3, 5, 7$, and no finish at $\alpha = 1.25, 1.5$. For $N = 1440$: $23.4303$, $7.2067$, $2.6410$, $1.5671$. The largest total turn of the directions from Harry to the remaining samples is $2.92$, $3.02$, $3.07$ and $3.08$ at $N = 1440$. A pass shows these times for these sample sets. It does not show a limit as $N$ grows, and it does not show that every Snitch is caught.

### Recipe 6: the stretching identity

Take a smooth arc $S(\varphi)$ and a point $H$ off it, and let each point flee from $H$ at speed $v$ for a short time $h$ (use $h = 10^{-6}$, with a second-order step for the flow). Compute $\sigma = \lVert \partial_\varphi S\rVert$ by finite differences before and after, in both time directions, and take $(\sigma_{+h} - \sigma_{-h})/(2h)$. Compare $\sigma^{-1}\partial_t\sigma$ with $v\sin^2\beta/\rho$, where $\rho = \lVert S - H\rVert$ and $\beta$ is the angle between $\partial_\varphi S$ and $S - H$.

Expected: relative error at most $3.7 \times 10^{-5}$ on five random arcs, which is the level of the finite differences. A pass shows the identity of Theorem 5, part 2. It does not show that the conditions (T) hold for the real chase.

## Expected output

Step 0 prints the line below. Recipes 1 to 6 give the numbers above. The results file lists the same numbers under these entry names.

```
results.json: OK

spiral_time
closed_form_vs_integration
corner
length_at_t1
stretching_identity
sawtooth_algebra
chase_uniform_start
chase_graded_start
```

## Time and memory

Recipes 1 to 4 and 6 take seconds on one core. Recipe 5 at $N = 1440$ takes under a minute per speed ratio, and memory use is a few megabytes.

## What the checks do not show

- A catch of the whole curve: sample chases leave Snitches between samples.
- Conditions (T) and (A) for the real chase.
- Any capture result at $\alpha \le 1.5$.
- The video's claim of disk capture for $\alpha > 2\pi$.

## What is not shipped, and why

The programs that produced the results file are not shipped. The recipes above are enough to reproduce every number.

## Our own programs and methods

The programs are not part of this book.

## Where to go next

Which number would you check? Run recipe 2, then see [the theorem list](THEOREMS.md) for what it proves, and [the open question](chapters/05-the-open-question.md) for what is left.
