Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""Illustrate sin, shrinking bumps h, and their joint values at infinity."""
import argparse
import math
import matplotlib
matplotlib.use("Agg") # Save files without needing a graphical desktop.
import matplotlib.pyplot as plt
from matplotlib.patches import ConnectionPatch

Exercise

Let $\beta\mathbb{R}$ be the Stone-Čech compactification of the real line (with its usual topology). Let $\sin^\beta\colon\beta\mathbb{R}\to[-1,1]$ be the unique continuous extension of $\sin\colon\mathbb{R}\to[-1,1]$ to $\beta\mathbb{R}$. Explain why the closed set ${\sin^\beta = 0}$ of $\beta\mathbb{R}$ is strictly larger than the closure in $\beta\mathbb{R}$ of the subset ${\sin = 0}$ (which is just $\pi\mathbb{Z}$) of $\mathbb{R}$.


Solution 1

The key idea is to choose points that escape to infinity while their sine values tend to zero, but which can still be distinguished from the actual zeros by a bounded continuous function. That distinguishing function also extends to the Stone–Čech compactification, and will keep the new point outside the closure of the zero set.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
set terminal pngcairo size 1024,768
set output "/tmp/temps.png"
stats "time_era5_t2m_France_metropolitan_mon12_ave3_dump0.txt" using ($3+$4/12-2000):($2) name "st0"
w0(x)=st0_intercept+st0_slope*x
res0_stddev=sqrt(1-st0_correlation**2)*st0_stddev_y
title0=sprintf("hiver (régr. %.2f° + %.2f×(Y−2000)/100 ; σ=%.2f)", st0_intercept, st0_slope*100, res0_stddev)
stats "time_era5_t2m_France_metropolitan_mon3_ave3_dump0.txt" using ($3+$4/12-2000):($2) name "st1"
w1(x)=st1_intercept+st1_slope*x
res1_stddev=sqrt(1-st1_correlation**2)*st1_stddev_y
title1=sprintf("printemps (régr. %.2f° + %.2f×(Y−2000)/100 ; σ=%.2f)", st1_intercept, st1_slope*100, res1_stddev)
@Gro-Tsen
Gro-Tsen / cmdlines
Last active January 10, 2026 18:21
Fourier transform of a decagon and related images
gcc -o d10fourier d10fourier.c -O6 -Wall -std=c99 -pedantic -Wextra -lm -DTEN=10 -DPIC_WIDTH=1920 -DPIC_HEIGHT=1080 -DFRAME_COUNT=1440
parallel -j 8 ./d10fourier {} ::: $(seq 0 719)
ffmpeg -framerate 24 -i d10fourier-%04d.png -video_size 1920x1080 -c:v libx265 -preset slower -crf 27 -pix_fmt yuv420p d10fourier.mp4
gcc -o d14fourier d10fourier.c -O6 -Wall -std=c99 -pedantic -Wextra -lm -DTEN=14 -DPIC_WIDTH=1920 -DPIC_HEIGHT=1080 -DFRAME_COUNT=1440
parallel -j 8 ./d14fourier {} ::: $(seq 0 719)
ffmpeg -framerate 24 -i d14fourier-%04d.png -video_size 1920x1080 -c:v libx265 -preset slower -crf 27 -pix_fmt yuv420p d14fourier.mp4
@Gro-Tsen
Gro-Tsen / y-combinator-1-ocaml.txt
Created November 23, 2025 11:00
How to define recursive function calls in functional programming languages using Quine's trick (aka the ‘Y’ and ‘Z’ combinators): the same demo in OCaml (with recursive types), Python, and Scheme
$ ocaml -rectypes
OCaml version 4.13.1
# (* Initial version, with language recursion *)
let rec fib = fun n -> if n<=1 then n else fib(n-1)+fib(n-2) ;;
val fib : int -> int = <fun>
# (* Testing *)
List.map fib [0;1;2;3;4;5;6] ;;
- : int list = [0; 1; 1; 2; 3; 5; 8]
# (* Quine's trick: call this with itself as argument *)
@Gro-Tsen
Gro-Tsen / moebius-function-fourier.sage
Created November 17, 2025 08:15
Plot the Fourier transform of μ(n)/n
destdir = "."
nbsamp = 403200
fft = FastFourierTransform(nbsamp)
for i in range(nbsamp):
fft[i] = N(moebius(i)/i) if i>0 else 0
fft.forward_transform()
plot = list_plot([(N(i/nbsamp-1), N(fft[i][1])) for i in range(nbsamp)]+[(N(i/nbsamp), N(fft[i][1])) for i in range(nbsamp)], plotjoined=True, thickness=0.5, color="red") + list_plot([(N(i/nbsamp-1), N(fft[i][0])) for i in range(nbsamp)]+[(N(i/nbsamp), N(fft[i][0])) for i in range(nbsamp)], plotjoined=True, thickness=0.5)
plot.save(filename=(destdir+"/moebius.png"), dpi=192, aspect_ratio=0.4)
diff -r 62b30a28e7a4 dom/serializers/nsPlainTextSerializer.cpp
--- a/dom/serializers/nsPlainTextSerializer.cpp Mon Sep 08 11:49:04 2025 -0400
+++ b/dom/serializers/nsPlainTextSerializer.cpp Thu Oct 23 16:09:22 2025 +0200
@@ -108,11 +108,6 @@
void nsPlainTextSerializer::CurrentLine::MaybeReplaceNbspsInContent(
const int32_t aFlags) {
- if (!(aFlags & nsIDocumentEncoder::OutputPersistNBSP)) {
- // First, replace all nbsp characters with spaces,
- // which the unicode encoder won't do for us.
@Gro-Tsen
Gro-Tsen / age-difference-mortality.pl
Last active August 20, 2025 16:15
Compute probability that one person survives another
#! /usr/local/bin/perl -w
use strict;
use warnings;
# Get data from <URL: https://www.insee.fr/fr/statistiques/3311422?sommaire=3311425 >
# Typical plotting command (assuming output of this program is in "morta-hh.dat"):
# (echo 'set terminal pngcairo size 1000,800' ; echo 'set output "morta-hh.png"' ; echo 'set xrange [0:100]' ; echo 'set yrange [0:100]' ; echo 'set size square' ; echo 'set cbrange [0:1]' ; echo 'set palette defined ( 0 "black", 0.2 "#00FFFF", 0.4 "red", 0.5 "blue", 0.6 "green", 0.8 "#FF00FF", 1 "white" )' ; echo 'set title "Probabilité de survie ♂/♂"' ; echo 'set xlabel "Âge personne 1"' ; echo 'set ylabel "Âge personne 2"' ; echo 'set key title "Proba"' ; echo 'plot "morta-hh.dat" using ($1+0.5):($2+0.5):3 with image, [x=0:100] x lt rgb "black" notitle, [x=5:100] x-5 lt rgb "black" dashtype 2 notitle, [x=0:95] x+5 lt rgb "black" dashtype 2 notitle') | gnuplot
@Gro-Tsen
Gro-Tsen / fat-cantor-staircase.sage
Created June 11, 2025 14:46
Plot the staircase function (cumulative graph) of a fat Cantor set.
# Compute the cumulative measure function of a "fat" Cantor set (aka
# Smith-Volterra-Cantor set) with parameter alpha (meaning that
# 2^(k-1) intervals of length alpha^k are removed at the k-th stage of
# the construction.
alpha = 1/4
# Total measure of the fat Cantor set:
totmeas = N((1-3*alpha)/(1-2*alpha))