AFTD Auto-Formalizing Theoretical Domains

in1277_seven_block_3_factorcritical

theoremverified

The displayed seven-vertex block 3 in the explicit control graph is 1-factor-critical.

Statement

theorem in1277_seven_block_3_factorcritical : is_k_factor_critical (in1261_seven_graph.induce {v | v ∈ ({21,22,23,24,25,26,27} : Finset (Fin 28))}) 1
Source
OP-1957 seven-block control, experiment 43349
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
  • in1261_seven_graphThe symmetric graph on 28 vertices whose unequal ordered endpoints avoid the displayed forbidden pairs.
  • is_k_factor_criticalA simple graph G on a finite vertex type V is k-factor-critical if for every subset S of V with cardinality k, the induced subgraph on Sᶜ…
  • in1261_seven_forbidden_orderedOrdered forbidden pairs of the explicit seven-by-seven boundary control graph.
Used by 1

The proof, explained

To show that the 7-vertex block {21, ..., 27} is 1-factor-critical, we must show that removing any single vertex leaves a 6-vertex induced subgraph with a perfect matching. We establish a general reduction showing that an induced subgraph is 1-factor-critical whenever an involution without fixed points pairs each remaining vertex with an adjacent neighbor for every single-vertex deletion. An explicit lookup table specifies these pairings across all 7 possible deletions (giving 3 disjoint edges on the remaining 6 vertices in each case). The validity of these pairings—in particular that every paired pair is an edge of the control graph—is verified computationally by exhaustive evaluation (decide), completing the proof.

  1. Adjacency in the control graph in1261_seven_graph is decidable.

    Unfolding the definitions of in1261_seven_graph and its forbidden edge pairs in1261_seven_forbidden_ordered expresses adjacency as a combination of equality, inequality, and bounded arithmetic on Fin 28 and ℕ. Lean's typeclass synthesis (infer_instance) automatically derives the DecidableRel instance from these decidable primitives.

    lines 5–6

      unfold in1261_seven_graph in1261_seven_forbidden_ordered
      infer_instance
  2. A graph has a perfect matching if it admits an involution without fixed points that pairs each vertex with an adjacent partner.

    We construct the spanning subgraph P with edges {(x, f(x)) | x ∈ V}. Since f is an involution without fixed points and each x is adjacent to f(x), P is a symmetric subgraph of G. By SimpleGraph.Subgraph.isPerfectMatching_iff, P is a perfect matching if and only if each vertex x has a unique neighbor in P; this holds because f(x) is the unique witness satisfying y = f(x).

    lines 11–23

    uses Set.mem_univ, SimpleGraph.Subgraph.isPerfectMatching_iff

      classical
      let P : G.Subgraph := ⟨Set.univ, fun x y => y = f x,
        by intro x y h; subst y; exact hadj x,
        by intro x y h; exact Set.mem_univ x,
        by
          constructor
          intro x y h
          subst y
          exact (hinv x).symm⟩
      refine ⟨P, ?_⟩
      rw [SimpleGraph.Subgraph.isPerfectMatching_iff]
      intro x
      exact ⟨f x, rfl, fun y h => h⟩
  3. An induced subgraph on a vertex set A is 1-factor-critical if an adjacency-preserving involution on A \ {r} exists for every r ∈ A.

    By definition, 1-factor-criticality requires a perfect matching after removing any singleton set S = {r} from A, obtained using Finset.card_eq_one.mp. The remaining vertices form the induced subgraph H on A \ {r}. The hypothesis guarantees that x ↦ f(r, x) maps A \ {r} to itself, is an involution, and pairs adjacent vertices. Applying in1277_block_3_perfect_matching_of_adjacency_involution to H and this partner map produces the desired perfect matching.

    lines 29–50

    uses Finset.card_eq_one.mp, in1277_block_3_perfect_matching_of_adjacency_involution

      classical
      intro S hS
      obtain ⟨r, rfl⟩ := Finset.card_eq_one.mp hS
      let H := (in1261_seven_graph.induce {v | v ∈ A}).induce ((↑({r} : Finset {v // v ∈ A}) : Set {v // v ∈ A})ᶜ)
      let blockPartner : {x : {v // v ∈ A} // x ∈ (↑({r} : Finset {v // v ∈ A}) : Set {v // v ∈ A})ᶜ} →
          {x : {v // v ∈ A} // x ∈ (↑({r} : Finset {v // v ∈ A}) : Set {v // v ∈ A})ᶜ} := fun x =>
        ⟨⟨f r.val x.val.val, (h r.val x.val.val r.property x.val.property (by
           intro e; apply x.property; simp only [Finset.coe_singleton, Set.mem_singleton_iff]; exact Subtype.ext e)).1⟩, by
           simp only [Finset.coe_singleton, Set.mem_compl_iff, Set.mem_singleton_iff]
           intro e
           have he := congrArg Subtype.val e
           exact (h r.val x.val.val r.property x.val.property (by
             intro ee; apply x.property; simp only [Finset.coe_singleton, Set.mem_singleton_iff]; exact Subtype.ext ee)).2.1 he⟩
      apply in1277_block_3_perfect_matching_of_adjacency_involution H blockPartner
      · intro x
        apply Subtype.ext
        apply Subtype.ext
        exact (h r.val x.val.val r.property x.val.property (by
          intro e; apply x.property; simp only [Finset.coe_singleton, Set.mem_singleton_iff]; exact Subtype.ext e)).2.2.1
      · intro x
        exact (h r.val x.val.val r.property x.val.property (by
          intro e; apply x.property; simp only [Finset.coe_singleton, Set.mem_singleton_iff]; exact Subtype.ext e)).2.2.2
  4. The explicit lookup table defines a valid adjacency-preserving involution on the remaining 6 vertices for each of the 7 single-vertex deletions in block 3. automation

    The assertion is a universal statement over the 7-element set {21, 22, 23, 24, 25, 26, 27}. For each of the 7 choices of deleted vertex r and each of the 6 remaining vertices x, Lean verifies by computation that in1277_block_3_table r x belongs to the block, differs from r, satisfies the involution identity, and is adjacent to x in in1261_seven_graph. The decide tactic closes the goal by exhaustive evaluation of all 42 cases.

    line 77

      decide
  5. The induced subgraph of in1261_seven_graph on the seven-vertex block {21, 22, 23, 24, 25, 26, 27} is 1-factor-critical.

    The main theorem follows immediately by applying the reduction lemma in1277_block_3_factor_block_from_table to the vertex set {21, 22, 23, 24, 25, 26, 27}, supplying the lookup table in1277_block_3_table and the certificate in1277_block_3_table_valid.

    line 80

    uses in1277_block_3_factor_block_from_table, in1277_block_3_table_valid

      exact in1277_block_3_factor_block_from_table _ in1277_block_3_table in1277_block_3_table_valid
Set.mem_univ
Every element of a type belongs to the universal set.
SimpleGraph.Subgraph.isPerfectMatching_iff
A subgraph is a perfect matching if and only if every vertex of the ambient graph has exactly one neighbor in the subgraph.
Finset.card_eq_one.mp
A finite set has cardinality 1 only if it is a singleton {a} for some element a.
in1277_block_3_perfect_matching_of_adjacency_involution
If an involution on the vertices of a graph pairs each vertex with an adjacent neighbor, then the graph admits a perfect matching.
in1277_block_3_factor_block_from_table
If for every vertex r in A there is an involution on A \ {r} pairing each vertex with an adjacent partner in the graph, then the induced subgraph on A is 1-factor-critical.
in1277_block_3_table_valid
For every choice of deleted vertex r in {21, ..., 27} and every remaining vertex x, the lookup table returns an element of the set distinct from r, forms an involution, and is adjacent to x in the control graph.

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

set_option maxHeartbeats 4000000set_option maxRecDepth 10000set_option linter.all falselocal instance  aftdLocal_1e75cd5d219cec78_0 : DecidableRel in1261_seven_graph.Adj := by  unfold in1261_seven_graph in1261_seven_forbidden_ordered  infer_instanceprivate theorem in1277_block_3_perfect_matching_of_adjacency_involution {V : Type*} (G : SimpleGraph V) (f : V → V)    (hinv : Function.Involutive f) (hadj : ∀ x, G.Adj x (f x)) :    ∃ P : G.Subgraph, P.IsPerfectMatching := by  classical  let P : G.Subgraph := ⟨Set.univ, fun x y => y = f x,    by intro x y h; subst y; exact hadj x,    by intro x y h; exact Set.mem_univ x,    by      constructor      intro x y h      subst y      exact (hinv x).symm⟩  refine ⟨P, ?_⟩  rw [SimpleGraph.Subgraph.isPerfectMatching_iff]  intro x  exact ⟨f x, rfl, fun y h => h⟩private theorem in1277_block_3_factor_block_from_table (A : Finset (Fin 28)) (f : Fin 28 → Fin 28 → Fin 28) (h : ∀ r x, r ∈ A → x ∈ A → x ≠ r →   f r x ∈ A ∧ f r x ≠ r ∧ f r (f r x) = x ∧ in1261_seven_graph.Adj x (f r x)) : is_k_factor_critical (in1261_seven_graph.induce {v | v ∈ A}) 1 := by  classical  intro S hS  obtain ⟨r, rfl⟩ := Finset.card_eq_one.mp hS  let H := (in1261_seven_graph.induce {v | v ∈ A}).induce ((↑({r} : Finset {v // v ∈ A}) : Set {v // v ∈ A})ᶜ)  let blockPartner : {x : {v // v ∈ A} // x ∈ (↑({r} : Finset {v // v ∈ A}) : Set {v // v ∈ A})ᶜ} →      {x : {v // v ∈ A} // x ∈ (↑({r} : Finset {v // v ∈ A}) : Set {v // v ∈ A})ᶜ} := fun x =>    ⟨⟨f r.val x.val.val, (h r.val x.val.val r.property x.val.property (by       intro e; apply x.property; simp only [Finset.coe_singleton, Set.mem_singleton_iff]; exact Subtype.ext e)).1⟩, by       simp only [Finset.coe_singleton, Set.mem_compl_iff, Set.mem_singleton_iff]       intro e       have he := congrArg Subtype.val e       exact (h r.val x.val.val r.property x.val.property (by         intro ee; apply x.property; simp only [Finset.coe_singleton, Set.mem_singleton_iff]; exact Subtype.ext ee)).2.1 he⟩  apply in1277_block_3_perfect_matching_of_adjacency_involution H blockPartner  · intro x    apply Subtype.ext    apply Subtype.ext    exact (h r.val x.val.val r.property x.val.property (by      intro e; apply x.property; simp only [Finset.coe_singleton, Set.mem_singleton_iff]; exact Subtype.ext e)).2.2.1  · intro x    exact (h r.val x.val.val r.property x.val.property (by      intro e; apply x.property; simp only [Finset.coe_singleton, Set.mem_singleton_iff]; exact Subtype.ext e)).2.2.2private def in1277_block_3_table (r x : Fin 28) : Fin 28 :=  if r = 21 ∧ x = 22 then 23 else if r = 21 ∧ x = 23 then 22 else  if r = 21 ∧ x = 24 then 25 else if r = 21 ∧ x = 25 then 24 else  if r = 21 ∧ x = 26 then 27 else if r = 21 ∧ x = 27 then 26 else  if r = 22 ∧ x = 21 then 23 else if r = 22 ∧ x = 23 then 21 else  if r = 22 ∧ x = 24 then 25 else if r = 22 ∧ x = 25 then 24 else  if r = 22 ∧ x = 26 then 27 else if r = 22 ∧ x = 27 then 26 else  if r = 23 ∧ x = 21 then 22 else if r = 23 ∧ x = 22 then 21 else  if r = 23 ∧ x = 24 then 25 else if r = 23 ∧ x = 25 then 24 else  if r = 23 ∧ x = 26 then 27 else if r = 23 ∧ x = 27 then 26 else  if r = 24 ∧ x = 21 then 22 else if r = 24 ∧ x = 22 then 21 else  if r = 24 ∧ x = 23 then 25 else if r = 24 ∧ x = 25 then 23 else  if r = 24 ∧ x = 26 then 27 else if r = 24 ∧ x = 27 then 26 else  if r = 25 ∧ x = 21 then 22 else if r = 25 ∧ x = 22 then 21 else  if r = 25 ∧ x = 23 then 24 else if r = 25 ∧ x = 24 then 23 else  if r = 25 ∧ x = 26 then 27 else if r = 25 ∧ x = 27 then 26 else  if r = 26 ∧ x = 21 then 22 else if r = 26 ∧ x = 22 then 21 else  if r = 26 ∧ x = 23 then 24 else if r = 26 ∧ x = 24 then 23 else  if r = 26 ∧ x = 25 then 27 else if r = 26 ∧ x = 27 then 25 else  if r = 27 ∧ x = 21 then 22 else if r = 27 ∧ x = 22 then 21 else  if r = 27 ∧ x = 23 then 24 else if r = 27 ∧ x = 24 then 23 else  if r = 27 ∧ x = 25 then 26 else if r = 27 ∧ x = 26 then 25 else  xprivate theorem in1277_block_3_table_valid : ∀ r x : Fin 28, r ∈ ({21,22,23,24,25,26,27} : Finset (Fin 28)) → x ∈ ({21,22,23,24,25,26,27} : Finset (Fin 28)) → x ≠ r → in1277_block_3_table r x ∈ ({21,22,23,24,25,26,27} : Finset (Fin 28)) ∧ in1277_block_3_table r x ≠ r ∧ in1277_block_3_table r (in1277_block_3_table r x) = x ∧ in1261_seven_graph.Adj x (in1277_block_3_table r x) := by  decidetheorem in1277_seven_block_3_factorcritical : is_k_factor_critical (in1261_seven_graph.induce {v | v ∈ ({21,22,23,24,25,26,27} : Finset (Fin 28))}) 1 := by  exact in1277_block_3_factor_block_from_table _ in1277_block_3_table in1277_block_3_table_valid
See it in the graphDiscuss this resultChallenge it