AFTD Auto-Formalizing Theoretical Domains

op_2281_fifteen_le_max_beta_flats

theoremverifiedformalization

The maximum number of beta-flats in a hyperplane section on the 6-dimensional vector space (Fin 6 → ZMod 2) over the field with two elements is at least 15. Here a hyperplane section is a set K of 45 three-dimensional subspaces (planes) such that every two-dimensional subspace lies in at most one plane of K and every one-dimensional subspace lies in exactly 5 planes of K; a beta-flat of K is a five-dimensional subspace F that contains exactly 5 planes of K, all of which contain one common one-dimensional subspace; and max_beta_flats is the maximum, over all hyperplane sections K, of the number of beta-flats of K.

Statement

theorem op_2281_fifteen_le_max_beta_flats : 15 ≤ max_beta_flats
Formalizes
arXiv:2611.30333 (Alpha-points of a putative binary q-analog of the Fano plane), Appendix B: the explicit hyperplane section with 15 beta-flats, the lower bound quoted in Problem 8.2.
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 9
  • max_beta_flatsThe maximum number of beta-flats across all hyperplane sections in (Fin 6 → ZMod 2), defined as Finset.sup hyperplane_sections beta_count.
  • is_hyperplane_sectionA finite set (Finset) K of submodules of the 6-dimensional vector space (Fin 6 → ZMod 2) over ZMod 2 is a hyperplane section if and only…
  • is_beta_flatA 5-dimensional subspace F of (Fin 6 → ZMod 2) is a beta-flat with respect to a set K of planes if F contains exactly 5 planes of K and…
  • beta_countThe number of beta-flats with respect to K in (Fin 6 → ZMod 2).
  • beta_flatsThe set of all 5-dimensional subspaces of (Fin 6 → ZMod 2) that are beta-flats with respect to K.
  • hyperplane_sectionsThe finset of all hyperplane sections K on the vector space (Fin 6 → ZMod 2) over ZMod 2, defined by filtering Finset.univ with the…
  • cFor a group $G$ and an element $s \in G$, the local count $c_G(s)$ is the cardinality of the set of elements $g \in G$ such that…
  • VThe ambient space $V = \mathbb{F}_p^n \times \mathbb{F}_p^n$ of pairs of coordinate vectors.
  • FThe prime field $\mathrm{GF}(p)$, realized as $\mathbb{Z}/p\mathbb{Z}$ via ZMod.

Read back from the Lean

The maximum (supremum) over all hyperplane sections $K$ of the number of $\beta$-flats of $K$ (beta_count K) is at least 15. Equivalently, there exists at least one hyperplane section $K$ having at least 15 $\beta$-flats.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The proof establishes the lower bound max_beta_flats ≥ 15 by constructing an explicit hyperplane section K of 45 planes in (Fin 6 → ZMod 2) and exhibiting 15 distinct beta-flats for K. The 45 planes and 15 hyperplanes are represented by integer bitmasks, and all required incidence, intersection, and dimensionality conditions are verified computationally by the Lean kernel. Because each of the 15 hyperplanes contains exactly 5 planes of K all meeting in a shared 1-dimensional focal subspace, K possesses at least 15 beta-flats, yielding the result.

  1. The vector encoding map converts bitwise XOR to vector addition in (ZMod 2)^6.

    Vector addition is verified coordinate-wise: the i-th component of vec (a ^^^ b) is 1 if the i-th bit is set and 0 otherwise, which agrees with adding the i-th components of vec a and vec b in ZMod 2.

    lines 7–11

    uses Nat.testBit_xor, Pi.add_apply

    theorem vec_xor (a b : ℕ) : vec (a ^^^ b) = vec a + vec b := by
      funext i
      simp only [vec, Nat.testBit_xor, Pi.add_apply]
      cases a.testBit i <;> cases b.testBit i <;> decide
    
  2. The integer 0 encodes the zero vector in (ZMod 2)^6.

    All bits of the number 0 are false, so each coordinate of vec 0 evaluates to 0.

    lines 12–14

    theorem vec_zero : vec 0 = 0 := by
      funext i; simp [vec]
    
  3. The vector encoding map is injective on integers strictly less than 64.

    If vec a = vec b, their coordinates agree for all indices i < 6, so their first 6 bits are identical. For bits i ≥ 6, both a and b are strictly less than 64 = 2^6 ≤ 2^i, meaning all higher bits are 0. Hence all bits of a and b coincide, showing a = b.

    lines 15–26

    uses Nat.eq_of_testBit_eq, congrFun, Nat.pow_le_pow_right, Nat.testBit_lt_two_pow

    theorem vec_inj {a b : ℕ} (ha : a < 64) (hb : b < 64) (h : vec a = vec b) : a = b := by
      apply Nat.eq_of_testBit_eq
      intro i
      by_cases hi : i < 6
      · have := congrFun h ⟨i, hi⟩
        simp only [vec] at this
        cases h1 : a.testBit i <;> cases h2 : b.testBit i <;> simp_all
      · have h64 : (64 : ℕ) ≤ 2 ^ i := by
          calc (64 : ℕ) = 2 ^ 6 := by norm_num
            _ ≤ 2 ^ i := Nat.pow_le_pow_right (by norm_num) (by omega)
        rw [Nat.testBit_lt_two_pow (by omega), Nat.testBit_lt_two_pow (by omega)]
    
  4. The vector encoding is a bijection between Fin 64 and (ZMod 2)^6.

    The map from Fin 64 to (ZMod 2)^6 is injective by injectivity on numbers below 64. Since both types have cardinality 64, any injection between them is automatically a bijection, so every vector has an integer preimage.

    lines 27–36

    uses Fin.ext, vec_inj, Fintype.bijective_iff_injective_and_card

    theorem vec_surj (v : V6) : ∃ n, n < 64 ∧ vec n = v := by
      have hinj : Function.Injective (fun n : Fin 64 => vec n.1) :=
        fun a b h => Fin.ext (vec_inj a.2 b.2 h)
      have hbij : Function.Bijective (fun n : Fin 64 => vec n.1) := by
        rw [Fintype.bijective_iff_injective_and_card]
        refine ⟨hinj, ?_⟩
        simp
      obtain ⟨n, hn⟩ := hbij.2 v
      exact ⟨n.1, n.2, hn⟩
    
  5. Any XOR-closed subset S containing 0 defines an F₂-submodule subOf S.

    The zero vector is in the set because 0 ∈ S; the set is closed under addition because vector addition matches XOR and S is XOR-closed; and scalar multiplication by 0 or 1 in ZMod 2 stays in the subspace.

    lines 38–50

    uses vec_xor, vec_zero, zero_smul, one_smul

    def subOf (S : Finset ℕ) (h0 : 0 ∈ S) (hx : ∀ n ∈ S, ∀ m ∈ S, n ^^^ m ∈ S) :
        Submodule (ZMod 2) V6 where
      carrier := {v | ∃ n ∈ S, vec n = v}
      zero_mem' := ⟨0, h0, vec_zero⟩
      add_mem' := by
        rintro _ _ ⟨n, hn, rfl⟩ ⟨m, hm, rfl⟩
        exact ⟨n ^^^ m, hx n hn m hm, vec_xor n m⟩
      smul_mem' := by
        rintro c _ ⟨n, hn, rfl⟩
        fin_cases c
        · exact ⟨0, h0, by rw [vec_zero]; exact (zero_smul (ZMod 2) (vec n)).symm⟩
        · exact ⟨n, hn, (one_smul (ZMod 2) (vec n)).symm⟩
    
  6. For n < 64 and S ⊆ {0, ..., 63}, vec n belongs to subOf S if and only if n ∈ S.

    The backward direction is immediate from the definition of subOf. The forward direction holds because if vec n = vec m for some m ∈ S, injectivity of vec on numbers below 64 implies n = m ∈ S.

    lines 51–57

    uses vec_inj

    theorem mem_subOf {S : Finset ℕ} {h0 hx} (hS : ∀ n ∈ S, n < 64) {n : ℕ} (hn : n < 64) :
        vec n ∈ subOf S h0 hx ↔ n ∈ S := by
      constructor
      · rintro ⟨m, hm, he⟩
        rwa [← vec_inj (hS m hm) hn he]
      · intro h; exact ⟨n, h, rfl⟩
    
  7. The cardinality of subOf S as a type equals the cardinality of the finset S.

    An explicit equivalence between the subtype subOf S and the finset S is constructed via Classical.choose and vec, with injectivity of vec ensuring that round trips are the identity.

    lines 58–69

    uses Subtype.ext, Nat.card_congr, Nat.card_eq_fintype_card, Fintype.card_coe

    theorem card_subOf {S : Finset ℕ} {h0 hx} (hS : ∀ n ∈ S, n < 64) :
        Nat.card (subOf S h0 hx) = S.card := by
      have e : (subOf S h0 hx) ≃ S :=
        { toFun := fun v => ⟨Classical.choose v.2, (Classical.choose_spec v.2).1⟩
          invFun := fun n => ⟨vec n.1, n.1, n.2, rfl⟩
          left_inv := fun v => Subtype.ext (Classical.choose_spec v.2).2
          right_inv := fun n => by
            apply Subtype.ext
            have h := Classical.choose_spec (show vec n.1 ∈ subOf S h0 hx from ⟨n.1, n.2, rfl⟩)
            exact vec_inj (hS _ h.1) (hS _ n.2) h.2 }
      rw [Nat.card_congr e, Nat.card_eq_fintype_card, Fintype.card_coe]
    
  8. A submodule over ZMod 2 with 2^k elements has dimension k.

    The cardinality of any finite-dimensional vector space over ZMod 2 is 2 raised to its dimension; since the function x ↦ 2^x is injective on natural numbers, the dimension must equal k.

    lines 70–75

    uses Module.natCard_eq_pow_finrank, Nat.card_zmod, Nat.pow_right_injective

    theorem finrank_of_natCard (W : Submodule (ZMod 2) V6) (k : ℕ) (h : Nat.card W = 2 ^ k) :
        Module.finrank (ZMod 2) W = k := by
      have := Module.natCard_eq_pow_finrank (K := ZMod 2) (V := W)
      rw [h, Nat.card_zmod] at this
      exact (Nat.pow_right_injective (le_refl 2) this).symm
    
  9. Inclusion of submodules subOf S ≤ subOf T is equivalent to subset inclusion S ⊆ T.

    If the subspace of S is contained in that of T, then every element n ∈ S has vec n in subOf T, hence n ∈ T. Conversely, any vector in subOf S comes from an index in S ⊆ T, so it lies in subOf T.

    lines 76–83

    uses mem_subOf

    theorem le_subOf_iff {S T : Finset ℕ} {h0 hx h0' hx'} (hS : ∀ n ∈ S, n < 64)
        (hT : ∀ n ∈ T, n < 64) : subOf S h0 hx ≤ subOf T h0' hx' ↔ S ⊆ T := by
      constructor
      · intro h n hn
        exact (mem_subOf hT (hS n hn)).mp (h ⟨n, hn, rfl⟩)
      · rintro h _ ⟨n, hn, rfl⟩
        exact ⟨n, h hn, rfl⟩
    
  10. Any subspace contained in both subOf S and subOf T has cardinality at most |S ∩ T|.

    The intersection S ∩ T is also XOR-closed and contains 0, so it forms a submodule. Any vector in W belongs to both subOf S and subOf T, hence to subOf (S ∩ T), and the result follows from the injectivity of the inclusion map and the cardinality formula for subOf.

    lines 84–101

    uses card_subOf, Nat.card_le_card_of_injective, Submodule.inclusion_injective

    theorem card_le_inter {S T : Finset ℕ} {h0 hx h0' hx'} (hS : ∀ n ∈ S, n < 64)
        (hT : ∀ n ∈ T, n < 64) (W : Submodule (ZMod 2) V6) (h1 : W ≤ subOf S h0 hx)
        (h2 : W ≤ subOf T h0' hx') : Nat.card W ≤ (S ∩ T).card := by
      have hI0 : 0 ∈ S ∩ T := Finset.mem_inter.mpr ⟨h0, h0'⟩
      have hIx : ∀ n ∈ S ∩ T, ∀ m ∈ S ∩ T, n ^^^ m ∈ S ∩ T := by
        intro n hn m hm
        rw [Finset.mem_inter] at hn hm ⊢
        exact ⟨hx n hn.1 m hm.1, hx' n hn.2 m hm.2⟩
      have hIS : ∀ n ∈ S ∩ T, n < 64 := fun n hn => hS n (Finset.mem_inter.mp hn).1
      have hle : W ≤ subOf (S ∩ T) hI0 hIx := by
        intro v hv
        obtain ⟨n, hn, rfl⟩ := h1 hv
        have hn2 : vec n ∈ subOf T h0' hx' := h2 hv
        rw [mem_subOf hT (hS n hn)] at hn2
        exact ⟨n, Finset.mem_inter.mpr ⟨hn, hn2⟩, rfl⟩
      rw [← card_subOf (h0 := hI0) (hx := hIx) hIS]
      exact Nat.card_le_card_of_injective _ (Submodule.inclusion_injective hle)
    
  11. The 45 blocks and 15 hyperplanes satisfy all required combinatorial and incidence properties. automation

    The Lean kernel verifies by exhaustive finite computation that: each block has 8 elements below 64 and is XOR-closed; distinct blocks intersect in at most 2 elements; every non-zero vector lies in exactly 5 blocks; each hyperplane has 32 elements below 64 and is XOR-closed; each hyperplane contains exactly 5 blocks; the blocks in the k-th hyperplane all contain focal k; focal k is non-zero and below 64; and the 15 hyperplanes are distinct.

    lines 117–134

    theorem blk_lt : ∀ j, ∀ n ∈ blk j, n < 64 := by decide +kernel
    theorem blk_zero : ∀ j, 0 ∈ blk j := by decide +kernel
    theorem blk_xor : ∀ j, ∀ n ∈ blk j, ∀ m ∈ blk j, n ^^^ m ∈ blk j := by decide +kernel
    theorem blk_card : ∀ j, (blk j).card = 8 := by decide +kernel
    theorem blk_inter : ∀ i j, i ≠ j → (blk i ∩ blk j).card ≤ 2 := by decide +kernel
    theorem blk_points : ∀ n, n < 64 → n ≠ 0 →
        (Finset.univ.filter (fun j => n ∈ blk j)).card = 5 := by decide +kernel
    theorem hyp_lt : ∀ k, ∀ n ∈ hyp (mask k), n < 64 := by decide +kernel
    theorem hyp_zero : ∀ k, 0 ∈ hyp (mask k) := by decide +kernel
    theorem hyp_xor : ∀ k, ∀ n ∈ hyp (mask k), ∀ m ∈ hyp (mask k), n ^^^ m ∈ hyp (mask k) := by
      decide +kernel
    theorem hyp_card : ∀ k, (hyp (mask k)).card = 32 := by decide +kernel
    theorem hyp_blocks : ∀ k, (Finset.univ.filter (fun j => blk j ⊆ hyp (mask k))).card = 5 := by
      decide +kernel
    theorem hyp_focal : ∀ k j, blk j ⊆ hyp (mask k) → focal k ∈ blk j := by decide +kernel
    theorem focal_lt : ∀ k, focal k < 64 ∧ focal k ≠ 0 := by decide +kernel
    theorem hyp_inj : ∀ k k', hyp (mask k) = hyp (mask k') → k = k' := by decide +kernel
    
  12. For any f, the two-element set {0, f} contains 0 and is closed under XOR.

    Zero is an explicit element of {0, f}, and checking the four combinations of 0 and f under XOR shows that 0 ^^^ 0 = 0, 0 ^^^ f = f, f ^^^ 0 = f, and f ^^^ f = 0, all of which lie in {0, f}.

    lines 136–143

    uses Finset.mem_insert, Finset.mem_singleton

    theorem pair_zero (f : ℕ) : 0 ∈ ({0, f} : Finset ℕ) := by simp
    
    theorem pair_xor (f : ℕ) : ∀ n ∈ ({0, f} : Finset ℕ), ∀ m ∈ ({0, f} : Finset ℕ),
        n ^^^ m ∈ ({0, f} : Finset ℕ) := by
      intro n hn m hm
      simp only [Finset.mem_insert, Finset.mem_singleton] at hn hm ⊢
      rcases hn with rfl | rfl <;> rcases hm with rfl | rfl <;> simp
    
  13. Every 1-dimensional subspace has a unique non-zero generator determining subspace containment.

    A 1-dimensional subspace P is spanned by any non-zero vector v ∈ P. Any subspace W containing v contains all scalar multiples c • v, and hence contains P entirely.

    lines 144–154

    uses Subtype.ext, congrArg, Submodule.coe_smul

    theorem point_gen (P : Submodule (ZMod 2) V6) (hP : Module.finrank (ZMod 2) P = 1) :
        ∃ x : V6, x ≠ 0 ∧ ∀ W : Submodule (ZMod 2) V6, P ≤ W ↔ x ∈ W := by
      obtain ⟨v, hv, hall⟩ := finrank_eq_one_iff'.mp hP
      refine ⟨v.1, fun h => hv (Subtype.ext h), fun W => ⟨fun h => h v.2, ?_⟩⟩
      intro h w hw
      obtain ⟨c, hc⟩ := hall ⟨w, hw⟩
      have h' := congrArg Subtype.val hc
      rw [Submodule.coe_smul] at h'
      rw [show w = c • (v : V6) from h'.symm]
      exact W.smul_mem c h
    
  14. The 45 blocks define 45 distinct 3-dimensional subspaces, forming a family K.

    If two blocks defined the same subspace, their underlying sets would be subsets of each other, giving an intersection of size 8. But distinct blocks intersect in at most 2 elements, so the block-to-subspace mapping B is injective.

    lines 156–168

    uses blk_inter, le_subOf_iff, blk_card

    theorem main : 15 ≤ max_beta_flats := by
      classical
      let B : Fin 45 → Submodule (ZMod 2) V6 := fun j => subOf (blk j) (blk_zero j) (blk_xor j)
      let K := Finset.univ.image B
      have hBinj : Function.Injective B := by
        intro i j h
        by_contra hne
        have h1 := blk_inter i j hne
        have hsub : blk i ⊆ blk j := (le_subOf_iff (blk_lt i) (blk_lt j)).mp h.le
        rw [Finset.inter_eq_left.mpr hsub, blk_card] at h1
        omega
      have hmemK : ∀ b, b ∈ K ↔ ∃ j, B j = b := by
        intro b; simp [K]
  15. The family K is a hyperplane section on (ZMod 2)^6.

    K contains 45 planes because B is injective. Each plane has cardinality 8 = 2^3, hence dimension 3. Any 2-dimensional subspace has cardinality 4, so it cannot lie in two distinct planes whose intersection has size at most 2. Any 1-dimensional subspace is generated by a non-zero vector vec n, which belongs to exactly 5 blocks by the point-incidence certificate.

    lines 169–206

    uses Finset.card_image_of_injective, finrank_of_natCard, card_le_inter, blk_points, point_gen

      have hK : is_hyperplane_section K := by
        refine ⟨?_, ?_, ?_, ?_⟩
        · rw [Finset.card_image_of_injective _ hBinj]; simp
        · intro b hb
          obtain ⟨j, rfl⟩ := (hmemK b).mp hb
          apply finrank_of_natCard
          rw [card_subOf (blk_lt j), blk_card]; norm_num
        · intro L hL
          rw [Finset.card_le_one]
          intro b1 hb1 b2 hb2
          rw [Finset.mem_filter] at hb1 hb2
          obtain ⟨i, rfl⟩ := (hmemK _).mp hb1.1
          obtain ⟨j, rfl⟩ := (hmemK _).mp hb2.1
          by_contra hne
          have hij : i ≠ j := fun h => hne (h ▸ rfl)
          have hc := card_le_inter (blk_lt i) (blk_lt j) L hb1.2 hb2.2
          have hL4 : Nat.card L = 4 := by
            rw [Module.natCard_eq_pow_finrank (K := ZMod 2), hL, Nat.card_zmod]; norm_num
          have h42 : (4 : ℕ) ≤ 2 := by
            calc (4 : ℕ) = Nat.card L := hL4.symm
              _ ≤ _ := hc
              _ ≤ 2 := blk_inter i j hij
          omega
        · intro P hP
          obtain ⟨x, hx0, hxW⟩ := point_gen P hP
          obtain ⟨n, hn, rfl⟩ := vec_surj x
          have hn0 : n ≠ 0 := by rintro rfl; exact hx0 vec_zero
          have hfil : K.filter (fun b => P ≤ b) =
              (Finset.univ.filter (fun j => n ∈ blk j)).image B := by
            ext b
            simp only [K, Finset.mem_filter, Finset.mem_image, Finset.mem_univ, true_and, hxW]
            constructor
            · rintro ⟨⟨j, rfl⟩, h⟩
              exact ⟨j, (mem_subOf (blk_lt j) hn).mp h, rfl⟩
            · rintro ⟨j, h, rfl⟩
              exact ⟨⟨j, rfl⟩, (mem_subOf (blk_lt j) hn).mpr h⟩
          rw [hfil, Finset.card_image_of_injective _ hBinj]
          exact blk_points n hn hn0
  16. The 15 candidate hyperplanes F k are pairwise distinct.

    If F k = F k', then their defining subsets of Fin 64 are submodules that contain each other, so their underlying sets of integers are equal, which implies k = k' by the kernel injectivity check.

    lines 207–212

    uses hyp_inj, Finset.Subset.antisymm

      let F : Fin 15 → Submodule (ZMod 2) V6 := fun k => subOf (hyp (mask k)) (hyp_zero k) (hyp_xor k)
      have hFinj : Function.Injective F := by
        intro k k' h
        apply hyp_inj
        exact Finset.Subset.antisymm ((le_subOf_iff (hyp_lt k) (hyp_lt k')).mp h.le)
          ((le_subOf_iff (hyp_lt k') (hyp_lt k)).mp h.ge)
  17. Each of the 15 hyperplanes F k is a beta-flat for K.

    Each F k has cardinality 32 = 2^5, so its dimension is 5. It contains exactly 5 planes of K because exactly 5 blocks are subsets of the k-th hyperplane set. Furthermore, all 5 planes share the non-zero vector focal k, which spans a common 1-dimensional subspace contained in all 5 planes.

    lines 213–246

    uses hyp_card, hyp_blocks, hyp_focal, Finset.card_pair

      have hflat : ∀ k, is_beta_flat K (F k) := by
        intro k
        refine ⟨?_, ?_, ?_⟩
        · apply finrank_of_natCard
          rw [card_subOf (hyp_lt k), hyp_card]; norm_num
        · have hfil : K.filter (fun b => b ≤ F k) =
              (Finset.univ.filter (fun j => blk j ⊆ hyp (mask k))).image B := by
            ext b
            simp only [K, Finset.mem_filter, Finset.mem_image, Finset.mem_univ, true_and]
            constructor
            · rintro ⟨⟨j, rfl⟩, h⟩
              exact ⟨j, (le_subOf_iff (blk_lt j) (hyp_lt k)).mp h, rfl⟩
            · rintro ⟨j, h, rfl⟩
              exact ⟨⟨j, rfl⟩, (le_subOf_iff (blk_lt j) (hyp_lt k)).mpr h⟩
          rw [hfil, Finset.card_image_of_injective _ hBinj]
          exact hyp_blocks k
        · have hpl : ∀ n ∈ ({0, focal k} : Finset ℕ), n < 64 := by
            intro n hn
            simp only [Finset.mem_insert, Finset.mem_singleton] at hn
            rcases hn with rfl | rfl
            · norm_num
            · exact (focal_lt k).1
          refine ⟨subOf {0, focal k} (pair_zero _) (pair_xor _), ?_, ?_⟩
          · apply finrank_of_natCard
            rw [card_subOf hpl, Finset.card_pair (focal_lt k).2.symm]; norm_num
          · intro b hb hbF
            obtain ⟨j, rfl⟩ := (hmemK b).mp hb
            have hsub := (le_subOf_iff (blk_lt j) (hyp_lt k)).mp hbF
            rw [le_subOf_iff hpl (blk_lt j)]
            intro n hn
            simp only [Finset.mem_insert, Finset.mem_singleton] at hn
            rcases hn with rfl | rfl
            · exact blk_zero j
            · exact hyp_focal k j hsub
  18. The hyperplane section K has at least 15 beta-flats, so max_beta_flats ≥ 15.

    The 15 distinct beta-flats F k form a subset of the beta-flats of K, showing beta_count K ≥ 15. Since K is an element of the set of all hyperplane sections, 15 ≤ beta_count K ≤ max_beta_flats.

    lines 247–257

    uses Finset.card_le_card, Finset.le_sup

      have hcount : 15 ≤ beta_count K := by
        have hsub : Finset.univ.image F ⊆ beta_flats K := by
          intro f hf
          obtain ⟨k, -, rfl⟩ := Finset.mem_image.mp hf
          exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hflat k⟩
        have := Finset.card_le_card hsub
        rw [Finset.card_image_of_injective _ hFinj] at this
        simpa [beta_count] using this
      have hKmem : K ∈ hyperplane_sections := Finset.mem_filter.mpr ⟨Finset.mem_univ _, hK⟩
      exact hcount.trans (Finset.le_sup (f := beta_count) hKmem)
    
  19. The maximum number of beta-flats across all hyperplane sections in (ZMod 2)^6 is at least 15.

    The theorem is proved directly by calling Op2281Cert.main.

    lines 260–261

    uses Op2281Cert.main

    theorem op_2281_fifteen_le_max_beta_flats : 15 ≤ max_beta_flats := by
      exact Op2281Cert.main
Nat.testBit_xor
The i-th bit of the bitwise XOR of x and y is the boolean XOR of the i-th bit of x and the i-th bit of y.
Pi.add_apply
Pointwise addition of functions evaluated at an argument is the sum of their values.
Nat.eq_of_testBit_eq
Two natural numbers are equal if all their corresponding bits in binary representation are equal.
congrFun
Equal functions take equal values at the same input argument.
Nat.pow_le_pow_right
If the base is positive and i ≤ j, then n^i ≤ n^j.
Nat.testBit_lt_two_pow
If x < 2^i, then the i-th bit of x is 0 (false).
Fin.ext
Two elements of Fin n are equal if their underlying natural values are equal.
vec_inj
The vector encoding map vec is injective on natural numbers strictly less than 64.
Fintype.bijective_iff_injective_and_card
A map between finite types of equal cardinality is bijective if and only if it is injective.
vec_xor
The vector encoding of an XOR is the sum of the vector encodings.
vec_zero
The vector encoding of 0 is the zero vector.
zero_smul
Scaling any vector by the scalar 0 yields the zero vector.
one_smul
Scaling any vector by the scalar 1 leaves the vector unchanged.
Subtype.ext
Two elements of a subtype are equal if their underlying values are equal.
Nat.card_congr
If two types are in bijection, their cardinalities are equal.
Nat.card_eq_fintype_card
For a finite type, its cardinality as a type matches its Fintype card.
Fintype.card_coe
The cardinality of a Finset coerced to a type equals its card.
Module.natCard_eq_pow_finrank
The cardinality of a finite-dimensional vector space V over a division ring K is |K|^(dim V).
Nat.card_zmod
The cardinality of ZMod n is n.
Nat.pow_right_injective
The function a^x is injective in x for any base a ≥ 2.
mem_subOf
An encoded vector vec n lies in the subspace subOf S if and only if n ∈ S.
card_subOf
The cardinality of the subspace subOf S equals the size of S, for S ⊆ {0, ..., 63}.
Nat.card_le_card_of_injective
An injective function from α to β implies |α| ≤ |β|.
Submodule.inclusion_injective
The canonical inclusion map of a submodule into a containing submodule is injective.
Finset.mem_insert
An element belongs to {a} ∪ s if and only if it equals a or belongs to s.
Finset.mem_singleton
An element belongs to the singleton {a} if and only if it equals a.
congrArg
Applying a function to equal arguments yields equal values.
Submodule.coe_smul
Coercing a scalar multiple of a submodule element to the ambient space equals the scalar multiple of the coerced element.
blk_inter
Distinct blocks among the 45 have intersection of size at most 2.
le_subOf_iff
Inclusion of subspaces subOf S ≤ subOf T is equivalent to subset inclusion S ⊆ T.
blk_card
Each of the 45 blocks has cardinality 8.
Finset.card_image_of_injective
The image of a finset under an injective function has the same size as the finset.
finrank_of_natCard
If a submodule over ZMod 2 has cardinality 2^k, its dimension is k.
card_le_inter
Any subspace contained in both subOf S and subOf T has cardinality at most |S ∩ T|.
blk_points
Every non-zero vector in {1, ..., 63} belongs to exactly 5 of the 45 blocks.
point_gen
Every 1-dimensional subspace has a non-zero generator x such that P ≤ W iff x ∈ W.
hyp_inj
The 15 hyperplane masks define pairwise distinct subsets of {0, ..., 63}.
Finset.Subset.antisymm
Two sets are equal if each is a subset of the other.
hyp_card
Each of the 15 hyperplanes contains exactly 32 vectors.
hyp_blocks
Each of the 15 hyperplanes contains exactly 5 of the 45 blocks.
hyp_focal
Every block contained in the k-th hyperplane contains the focal point focal k.
Finset.card_pair
The finset {a, b} has cardinality 2 whenever a ≠ b.
Finset.card_le_card
If s ⊆ t, then |s| ≤ |t|.
Finset.le_sup
An element of a finset has evaluation at most the supremum over the finset.
Op2281Cert.main
The maximum number of beta-flats across all hyperplane sections is at least 15.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

namespace Op2281Certabbrev V6 := Fin 6 → ZMod 2def vec (n : ℕ) : V6 := fun i => if n.testBit i then 1 else 0theorem vec_xor (a b : ℕ) : vec (a ^^^ b) = vec a + vec b := by  funext i  simp only [vec, Nat.testBit_xor, Pi.add_apply]  cases a.testBit i <;> cases b.testBit i <;> decidetheorem vec_zero : vec 0 = 0 := by  funext i; simp [vec]theorem vec_inj {a b : ℕ} (ha : a < 64) (hb : b < 64) (h : vec a = vec b) : a = b := by  apply Nat.eq_of_testBit_eq  intro i  by_cases hi : i < 6  · have := congrFun h ⟨i, hi⟩    simp only [vec] at this    cases h1 : a.testBit i <;> cases h2 : b.testBit i <;> simp_all  · have h64 : (64 : ℕ) ≤ 2 ^ i := by      calc (64 : ℕ) = 2 ^ 6 := by norm_num        _ ≤ 2 ^ i := Nat.pow_le_pow_right (by norm_num) (by omega)    rw [Nat.testBit_lt_two_pow (by omega), Nat.testBit_lt_two_pow (by omega)]theorem vec_surj (v : V6) : ∃ n, n < 64 ∧ vec n = v := by  have hinj : Function.Injective (fun n : Fin 64 => vec n.1) :=    fun a b h => Fin.ext (vec_inj a.2 b.2 h)  have hbij : Function.Bijective (fun n : Fin 64 => vec n.1) := by    rw [Fintype.bijective_iff_injective_and_card]    refine ⟨hinj, ?_⟩    simp  obtain ⟨n, hn⟩ := hbij.2 v  exact ⟨n.1, n.2, hn⟩/-- The subspace whose vectors are the codes in a xor-closed set. -/def subOf (S : Finset ℕ) (h0 : 0 ∈ S) (hx : ∀ n ∈ S, ∀ m ∈ S, n ^^^ m ∈ S) :    Submodule (ZMod 2) V6 where  carrier := {v | ∃ n ∈ S, vec n = v}  zero_mem' := ⟨0, h0, vec_zero⟩  add_mem' := by    rintro _ _ ⟨n, hn, rfl⟩ ⟨m, hm, rfl⟩    exact ⟨n ^^^ m, hx n hn m hm, vec_xor n m⟩  smul_mem' := by    rintro c _ ⟨n, hn, rfl⟩    fin_cases c    · exact ⟨0, h0, by rw [vec_zero]; exact (zero_smul (ZMod 2) (vec n)).symm⟩    · exact ⟨n, hn, (one_smul (ZMod 2) (vec n)).symm⟩theorem mem_subOf {S : Finset ℕ} {h0 hx} (hS : ∀ n ∈ S, n < 64) {n : ℕ} (hn : n < 64) :    vec n ∈ subOf S h0 hx ↔ n ∈ S := by  constructor  · rintro ⟨m, hm, he⟩    rwa [← vec_inj (hS m hm) hn he]  · intro h; exact ⟨n, h, rfl⟩theorem card_subOf {S : Finset ℕ} {h0 hx} (hS : ∀ n ∈ S, n < 64) :    Nat.card (subOf S h0 hx) = S.card := by  have e : (subOf S h0 hx) ≃ S :=    { toFun := fun v => ⟨Classical.choose v.2, (Classical.choose_spec v.2).1⟩      invFun := fun n => ⟨vec n.1, n.1, n.2, rfl⟩      left_inv := fun v => Subtype.ext (Classical.choose_spec v.2).2      right_inv := fun n => by        apply Subtype.ext        have h := Classical.choose_spec (show vec n.1 ∈ subOf S h0 hx from ⟨n.1, n.2, rfl⟩)        exact vec_inj (hS _ h.1) (hS _ n.2) h.2 }  rw [Nat.card_congr e, Nat.card_eq_fintype_card, Fintype.card_coe]theorem finrank_of_natCard (W : Submodule (ZMod 2) V6) (k : ℕ) (h : Nat.card W = 2 ^ k) :    Module.finrank (ZMod 2) W = k := by  have := Module.natCard_eq_pow_finrank (K := ZMod 2) (V := W)  rw [h, Nat.card_zmod] at this  exact (Nat.pow_right_injective (le_refl 2) this).symmtheorem le_subOf_iff {S T : Finset ℕ} {h0 hx h0' hx'} (hS : ∀ n ∈ S, n < 64)    (hT : ∀ n ∈ T, n < 64) : subOf S h0 hx ≤ subOf T h0' hx' ↔ S ⊆ T := by  constructor  · intro h n hn    exact (mem_subOf hT (hS n hn)).mp (h ⟨n, hn, rfl⟩)  · rintro h _ ⟨n, hn, rfl⟩    exact ⟨n, h hn, rfl⟩theorem card_le_inter {S T : Finset ℕ} {h0 hx h0' hx'} (hS : ∀ n ∈ S, n < 64)    (hT : ∀ n ∈ T, n < 64) (W : Submodule (ZMod 2) V6) (h1 : W ≤ subOf S h0 hx)    (h2 : W ≤ subOf T h0' hx') : Nat.card W ≤ (S ∩ T).card := by  have hI0 : 0 ∈ S ∩ T := Finset.mem_inter.mpr ⟨h0, h0'⟩  have hIx : ∀ n ∈ S ∩ T, ∀ m ∈ S ∩ T, n ^^^ m ∈ S ∩ T := by    intro n hn m hm    rw [Finset.mem_inter] at hn hm ⊢    exact ⟨hx n hn.1 m hm.1, hx' n hn.2 m hm.2⟩  have hIS : ∀ n ∈ S ∩ T, n < 64 := fun n hn => hS n (Finset.mem_inter.mp hn).1  have hle : W ≤ subOf (S ∩ T) hI0 hIx := by    intro v hv    obtain ⟨n, hn, rfl⟩ := h1 hv    have hn2 : vec n ∈ subOf T h0' hx' := h2 hv    rw [mem_subOf hT (hS n hn)] at hn2    exact ⟨n, Finset.mem_inter.mpr ⟨hn, hn2⟩, rfl⟩  rw [← card_subOf (h0 := hI0) (hx := hIx) hIS]  exact Nat.card_le_card_of_injective _ (Submodule.inclusion_injective hle)def tri : Fin 45 → ℕ × ℕ × ℕ := ![(1,2,12), (3,8,37), (5,19,43), (7,24,34), (13,17,37), (1,4,24), (3,9,33), (5,26,42), (7,25,40), (14,20,37), (1,6,18), (3,16,41), (5,27,41), (8,20,36), (14,21,38), (1,8,22), (3,17,32), (6,10,32), (8,21,39), (14,22,36), (1,10,16), (4,18,34), (6,11,51), (9,20,35), (14,23,39), (2,8,49), (4,19,40), (6,24,33), (9,21,32), (15,20,34), (2,9,52), (4,26,32), (6,25,43), (12,16,33), (15,21,33), (2,16,37), (4,27,35), (7,10,35), (12,17,34), (15,22,35), (2,17,45), (5,18,33), (7,11,48), (13,16,38), (15,23,32)]def blk (j : Fin 45) : Finset ℕ :=  match tri j with  | (a, b, c) => {0, a, b, c, a ^^^ b, a ^^^ c, b ^^^ c, a ^^^ b ^^^ c}def mask : Fin 15 → ℕ := ![2, 8, 10, 20, 22, 28, 30, 32, 34, 40, 42, 52, 54, 60, 62]def focal : Fin 15 → ℕ := ![28, 18, 26, 9, 21, 15, 6, 1, 29, 19, 27, 8, 20, 14, 7]def par6 (x : ℕ) : Bool :=  x.testBit 0 ^^ x.testBit 1 ^^ x.testBit 2 ^^ x.testBit 3 ^^ x.testBit 4 ^^ x.testBit 5def hyp (m : ℕ) : Finset ℕ := (Finset.range 64).filter (fun v => par6 (v &&& m) = false)theorem blk_lt : ∀ j, ∀ n ∈ blk j, n < 64 := by decide +kerneltheorem blk_zero : ∀ j, 0 ∈ blk j := by decide +kerneltheorem blk_xor : ∀ j, ∀ n ∈ blk j, ∀ m ∈ blk j, n ^^^ m ∈ blk j := by decide +kerneltheorem blk_card : ∀ j, (blk j).card = 8 := by decide +kerneltheorem blk_inter : ∀ i j, i ≠ j → (blk i ∩ blk j).card ≤ 2 := by decide +kerneltheorem blk_points : ∀ n, n < 64 → n ≠ 0 →    (Finset.univ.filter (fun j => n ∈ blk j)).card = 5 := by decide +kerneltheorem hyp_lt : ∀ k, ∀ n ∈ hyp (mask k), n < 64 := by decide +kerneltheorem hyp_zero : ∀ k, 0 ∈ hyp (mask k) := by decide +kerneltheorem hyp_xor : ∀ k, ∀ n ∈ hyp (mask k), ∀ m ∈ hyp (mask k), n ^^^ m ∈ hyp (mask k) := by  decide +kerneltheorem hyp_card : ∀ k, (hyp (mask k)).card = 32 := by decide +kerneltheorem hyp_blocks : ∀ k, (Finset.univ.filter (fun j => blk j ⊆ hyp (mask k))).card = 5 := by  decide +kerneltheorem hyp_focal : ∀ k j, blk j ⊆ hyp (mask k) → focal k ∈ blk j := by decide +kerneltheorem focal_lt : ∀ k, focal k < 64 ∧ focal k ≠ 0 := by decide +kerneltheorem hyp_inj : ∀ k k', hyp (mask k) = hyp (mask k') → k = k' := by decide +kerneltheorem pair_zero (f : ℕ) : 0 ∈ ({0, f} : Finset ℕ) := by simptheorem pair_xor (f : ℕ) : ∀ n ∈ ({0, f} : Finset ℕ), ∀ m ∈ ({0, f} : Finset ℕ),    n ^^^ m ∈ ({0, f} : Finset ℕ) := by  intro n hn m hm  simp only [Finset.mem_insert, Finset.mem_singleton] at hn hm ⊢  rcases hn with rfl | rfl <;> rcases hm with rfl | rfl <;> simptheorem point_gen (P : Submodule (ZMod 2) V6) (hP : Module.finrank (ZMod 2) P = 1) :    ∃ x : V6, x ≠ 0 ∧ ∀ W : Submodule (ZMod 2) V6, P ≤ W ↔ x ∈ W := by  obtain ⟨v, hv, hall⟩ := finrank_eq_one_iff'.mp hP  refine ⟨v.1, fun h => hv (Subtype.ext h), fun W => ⟨fun h => h v.2, ?_⟩⟩  intro h w hw  obtain ⟨c, hc⟩ := hall ⟨w, hw⟩  have h' := congrArg Subtype.val hc  rw [Submodule.coe_smul] at h'  rw [show w = c • (v : V6) from h'.symm]  exact W.smul_mem c htheorem main : 15 ≤ max_beta_flats := by  classical  let B : Fin 45 → Submodule (ZMod 2) V6 := fun j => subOf (blk j) (blk_zero j) (blk_xor j)  let K := Finset.univ.image B  have hBinj : Function.Injective B := by    intro i j h    by_contra hne    have h1 := blk_inter i j hne    have hsub : blk i ⊆ blk j := (le_subOf_iff (blk_lt i) (blk_lt j)).mp h.le    rw [Finset.inter_eq_left.mpr hsub, blk_card] at h1    omega  have hmemK : ∀ b, b ∈ K ↔ ∃ j, B j = b := by    intro b; simp [K]  have hK : is_hyperplane_section K := by    refine ⟨?_, ?_, ?_, ?_⟩    · rw [Finset.card_image_of_injective _ hBinj]; simp    · intro b hb      obtain ⟨j, rfl⟩ := (hmemK b).mp hb      apply finrank_of_natCard      rw [card_subOf (blk_lt j), blk_card]; norm_num    · intro L hL      rw [Finset.card_le_one]      intro b1 hb1 b2 hb2      rw [Finset.mem_filter] at hb1 hb2      obtain ⟨i, rfl⟩ := (hmemK _).mp hb1.1      obtain ⟨j, rfl⟩ := (hmemK _).mp hb2.1      by_contra hne      have hij : i ≠ j := fun h => hne (h ▸ rfl)      have hc := card_le_inter (blk_lt i) (blk_lt j) L hb1.2 hb2.2      have hL4 : Nat.card L = 4 := by        rw [Module.natCard_eq_pow_finrank (K := ZMod 2), hL, Nat.card_zmod]; norm_num      have h42 : (4 : ℕ) ≤ 2 := by        calc (4 : ℕ) = Nat.card L := hL4.symm          _ ≤ _ := hc          _ ≤ 2 := blk_inter i j hij      omega    · intro P hP      obtain ⟨x, hx0, hxW⟩ := point_gen P hP      obtain ⟨n, hn, rfl⟩ := vec_surj x      have hn0 : n ≠ 0 := by rintro rfl; exact hx0 vec_zero      have hfil : K.filter (fun b => P ≤ b) =          (Finset.univ.filter (fun j => n ∈ blk j)).image B := by        ext b        simp only [K, Finset.mem_filter, Finset.mem_image, Finset.mem_univ, true_and, hxW]        constructor        · rintro ⟨⟨j, rfl⟩, h⟩          exact ⟨j, (mem_subOf (blk_lt j) hn).mp h, rfl⟩        · rintro ⟨j, h, rfl⟩          exact ⟨⟨j, rfl⟩, (mem_subOf (blk_lt j) hn).mpr h⟩      rw [hfil, Finset.card_image_of_injective _ hBinj]      exact blk_points n hn hn0  let F : Fin 15 → Submodule (ZMod 2) V6 := fun k => subOf (hyp (mask k)) (hyp_zero k) (hyp_xor k)  have hFinj : Function.Injective F := by    intro k k' h    apply hyp_inj    exact Finset.Subset.antisymm ((le_subOf_iff (hyp_lt k) (hyp_lt k')).mp h.le)      ((le_subOf_iff (hyp_lt k') (hyp_lt k)).mp h.ge)  have hflat : ∀ k, is_beta_flat K (F k) := by    intro k    refine ⟨?_, ?_, ?_⟩    · apply finrank_of_natCard      rw [card_subOf (hyp_lt k), hyp_card]; norm_num    · have hfil : K.filter (fun b => b ≤ F k) =          (Finset.univ.filter (fun j => blk j ⊆ hyp (mask k))).image B := by        ext b        simp only [K, Finset.mem_filter, Finset.mem_image, Finset.mem_univ, true_and]        constructor        · rintro ⟨⟨j, rfl⟩, h⟩          exact ⟨j, (le_subOf_iff (blk_lt j) (hyp_lt k)).mp h, rfl⟩        · rintro ⟨j, h, rfl⟩          exact ⟨⟨j, rfl⟩, (le_subOf_iff (blk_lt j) (hyp_lt k)).mpr h⟩      rw [hfil, Finset.card_image_of_injective _ hBinj]      exact hyp_blocks k    · have hpl : ∀ n ∈ ({0, focal k} : Finset ℕ), n < 64 := by        intro n hn        simp only [Finset.mem_insert, Finset.mem_singleton] at hn        rcases hn with rfl | rfl        · norm_num        · exact (focal_lt k).1      refine ⟨subOf {0, focal k} (pair_zero _) (pair_xor _), ?_, ?_⟩      · apply finrank_of_natCard        rw [card_subOf hpl, Finset.card_pair (focal_lt k).2.symm]; norm_num      · intro b hb hbF        obtain ⟨j, rfl⟩ := (hmemK b).mp hb        have hsub := (le_subOf_iff (blk_lt j) (hyp_lt k)).mp hbF        rw [le_subOf_iff hpl (blk_lt j)]        intro n hn        simp only [Finset.mem_insert, Finset.mem_singleton] at hn        rcases hn with rfl | rfl        · exact blk_zero j        · exact hyp_focal k j hsub  have hcount : 15 ≤ beta_count K := by    have hsub : Finset.univ.image F ⊆ beta_flats K := by      intro f hf      obtain ⟨k, -, rfl⟩ := Finset.mem_image.mp hf      exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hflat k⟩    have := Finset.card_le_card hsub    rw [Finset.card_image_of_injective _ hFinj] at this    simpa [beta_count] using this  have hKmem : K ∈ hyperplane_sections := Finset.mem_filter.mpr ⟨Finset.mem_univ _, hK⟩  exact hcount.trans (Finset.le_sup (f := beta_count) hKmem)end Op2281Certtheorem op_2281_fifteen_le_max_beta_flats : 15 ≤ max_beta_flats := by  exact Op2281Cert.main
See it in the graphDiscuss this resultChallenge it