💎 Reusable layer
← all 82R0043

Bruck–Ryser–Chowla theorem

showcase

Use this theorem

  1. Create a project

    Shell
    lake +leanprover/lean4:v4.35.0 new myproject std.toml
    cd myproject

    Standard template, not math: the math template adds its own Mathlib requirement pinned to the Lean release tag, not to the Mathlib commit this package is built and tested with, so you would get a second, different Mathlib. Mathlib comes in through this package. Skip this step in an existing project with the same Lean and Mathlib.

  2. Add the dependency to lakefile.toml

    TOML
    [[require]]
    name = "formalizations"
    git = "https://github.com/karlesmarin/formalizations"
    rev = "v0.15.0"
  3. Import the minimal module

    Lean 4
    import Formalizations.Reusable.Combinatorics

    In a file of the project, e.g. Example.lean.

  4. Paste the example

    Lean 4
    open Formalizations.Reusable Filter Topology Classical
    
    /-- Bruck–Ryser–Chowla: no finite projective plane has order `6` (`6 ≡ 2 mod 4`, `6` is not a sum of two
    squares). -/
    example (P L : Type*) [Membership P L] [Configuration.ProjectivePlane P L] [Finite P] [Finite L] :
        Configuration.ProjectivePlane.order P L ≠ 6 := by
      intro h6
      obtain ⟨a, b, hab⟩ := bruck_ryser_chowla P L (Or.inr (by rw [h6]))
      rw [h6] at hab
      have ha : a ≤ 2 := by nlinarith
      have hb : b ≤ 2 := by nlinarith
      interval_cases a <;> interval_cases b <;> omega

    Steps 3 and 4 together are a complete Lean file:FormalizationsTest/ReusableCombinatoricsExample.lean at v0.15.0, compiled by the CI.

  5. Fetch and check

    Shell
    lake update
    lake lean Example.lean

    lake update fetches this package and Mathlib, and Mathlib's update hook downloads the compiled Mathlib (lake exe cache get). lake lean Example.lean builds the imports of the file (steps 3 and 4) and checks it. If the file belongs to a lean_lib of your project, lake build <lib> does the same. Avoid a bare lake build in a project from the standard template: its default target is the executable, whose link compiles every imported Mathlib module to native code. Same versions required: Lean v4.35.0, Mathlib f0b4c81.

Alternative: import Formalizations.Reusable imports the whole layer (all areas).

Bruck–Ryser–Chowla: if a finite projective plane of order n exists and n ≡ 1 or 2 (mod 4), then n is a sum of two squares (so no plane of order 6 or 14).

Lean statement

Lean 4
theorem bruck_ryser_chowla (P L : Type*) [Membership P L] [Configuration.ProjectivePlane P L] [Finite P]
    [Finite L]
    (h : Configuration.ProjectivePlane.order P L % 4 = 1 ∨
      Configuration.ProjectivePlane.order P L % 4 = 2) :
    ∃ a b : ℕ, Configuration.ProjectivePlane.order P L = a ^ 2 + b ^ 2
Name
Formalizations.Reusable.bruck_ryser_chowla
Import
import Formalizations.Reusable.Combinatorics
Version
formalizations 0.15.0Lean v4.35.0Mathlib f0b4c81
Role
showcase a classical theorem, to consult
Provenance
BruckRyserChowla.exists_sq_add_sq in Formalizations.Combinatorics.Configuration.BruckRyserChowla
Paper: none
Classical reference
R. H. Bruck, H. J. Ryser, The nonexistence of certain finite projective planes, Canad. J. Math. 1 (1949); S. Chowla, H. J. Ryser, Combinatorial problems, Canad. J. Math. 2 (1950)
Trust
standard axioms only propext, Classical.choice, Quot.sound
#print axioms in FormalizationsTest/Axioms.lean, audited by scripts/check_axioms.sh (2758 results), which the CI build workflow runs and passed at this commit.
Status
reusable not an upstream candidate
Area
Combinatorics

Links

Lean docstring

Bruck–Ryser–Chowla theorem. If a finite projective plane of order n exists and n ≡ 1 or 2 (mod 4), then n is a sum of two squares (so there is no plane of order 6 or 14).

  • Archive: BruckRyserChowla.exists_sq_add_sq (Formalizations.Combinatorics.Configuration.BruckRyserChowla); the module cites no paper DOI of ours.
  • Classical reference: R. H. Bruck, H. J. Ryser, The nonexistence of certain finite projective planes, Canad. J. Math. 1 (1949) 88–93; S. Chowla, H. J. Ryser, Combinatorial problems, Canad. J. Math. 2 (1950) 93–99.
  • Example: no finite projective plane has order 6.

Upstream

uses Mathlib's Configuration.ProjectivePlane; a specific theorem of finite geometry, not a general API

Depends on, in this repository

None besides the archive module (repo_dependencies = []).