Skip to content

Instantly share code, notes, and snippets.

@kbuzzard
kbuzzard / imo2019q1.lean
Last active February 24, 2023 18:22
IMO 2019 Q1 solution formalised in Lean
-- this was compiling with mathlib in June 2020
import tactic
theorem imo2019Q1 (f : ℤ → ℤ) :
(∀ a b : ℤ, f (2 * a) + 2 * (f b) = f (f (a + b))) ↔
(∀ x, f x = 0) ∨ ∃ c, ∀ x, f x = 2 * x + c :=
begin
split, swap,
{ -- easy way: f(x)=0 and f(x)=2x+c work.
intro h,