AFTD Auto-Formalizing Theoretical Domains

op874_pseudoforest_graph_and_cut_public

theoremverified

The explicit eight-vertex graph is connected, bridgeless and cubic, and has the displayed perfect matching, two factor squares and a locally maximal matching cut of globally maximum score six.

Statement

theorem op874_pseudoforest_graph_and_cut_public :
    let M : Finset (Sym2 (Fin 8)) := {s(0,5),s(2,6),s(1,7),s(3,4)}
    let F : Finset (Sym2 (Fin 8)) := {s(0,1),s(1,2),s(2,3),s(3,0),s(4,5),s(5,6),s(6,7),s(7,4)}
    let b : Fin 8 → Bool := ![true,true,false,false,false,true,false,true]
    let mate : Fin 8 → Fin 8 := ![5,7,6,4,3,0,2,1]
    let same := fun v : Fin 8 => (Finset.univ.filter fun w : Fin 8 =>
      s(v,w) ∈ F ∧ b v = b w).card
    let score := fun c : Fin 8 → Bool =>
      (([(0,1),(1,2),(2,3),(3,0),(4,5),(5,6),(6,7),(7,4)] : List (Fin 8 × Fin 8)).filter
        fun e => c e.1 != c e.2).length
    ∃ G : SimpleGraph (Fin 8), G.Connected ∧
      (∀ e : Sym2 (Fin 8), ¬ G.IsBridge e) ∧
      (∀ u v, G.Adj u v ↔ u ≠ v ∧ s(u,v) ∈ op874pf_edges) ∧
      (∀ v : Fin 8, (op874pf_edges.filter fun e => v ∈ e).card=3) ∧
      Disjoint M F ∧ (∀ v : Fin 8, (M.filter fun e => v ∈ e).card=1) ∧
      (∀ v : Fin 8, mate (mate v) = v ∧ mate v ≠ v ∧ s(v,mate v) ∈ M ∧
        b v = b (mate v) ∧ same v + same (mate v) ≤ 2) ∧
      score b = 6 ∧
      (∀ c : Fin 8 → Bool,
        c 0=c 5 → c 1=c 7 → c 2=c 6 → c 3=c 4 → score c ≤ 6)
Source
OP-874: graph and matching-cut certificate for the pseudoforest obstruction.
Verified
24 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • op874pf_edgesThe twelve edges of the explicit eight-vertex port-obstruction graph.

The proof, explained

We prove that the explicit 8-vertex graph with edges given by op874pf_edges is connected, bridgeless, cubic, and admits a locally maximal matching cut of maximum score 6. We define the graph as the union of a 4-edge matching M and two disjoint 4-cycles F, establish its connectivity and 2-edge-connectedness (bridgelessness) by checking alternate paths after edge deletions, and verify all combinatorial cut properties by finite exhaustive decision.

  1. The adjacency relation of op874pfg_graph is symmetric

    Given vertices u and v with u ≠ v and edge s(u, v) in the edge set, symmetry of inequality gives v ≠ u, and unordered pair symmetry (Sym2.eq_swap) ensures s(v, u) = s(u, v) is in the edge set.

    lines 12–13

    uses Sym2.eq_swap

        intro u v h
        exact ⟨h.1.symm, by simpa [Sym2.eq_swap] using h.2⟩⟩
  2. The adjacency relation of op874pfg_graph is loopless

    Adjacency requires u ≠ u, which is an immediate contradiction with reflexivity of equality.

    line 14

      loopless := ⟨by intro u h; exact h.1 rfl⟩
  3. The adjacency relation of op874pfg_graph is decidable

    Adjacency is unfolded to a conjunction of inequality and membership in a finite set of pairs, both of which are decidable, so typeclass synthesis finds the instance.

    lines 15–17

    private instance : DecidableRel op874pfg_graph.Adj := fun u v => by
      change Decidable (u ≠ v ∧ s(u,v) ∈ op874pfg_matching ∪ op874pfg_factor)
      infer_instance
  4. The graph op874pfg_graph is connected automation

    Connectivity on this explicit 8-vertex graph is decided by exhaustive computation.

    line 27

    private theorem op874pfg_connected : op874pfg_graph.Connected := by decide
  5. Any two vertices u and v remain reachable after deleting the edge between them automation

    We case-split on u across all eight vertices of Fin 8, and for each vertex, reachability to all other vertices in the edge-deleted graph is verified by computation.

    lines 30–31

      intro u
      fin_cases u <;> decide
  6. The graph op874pfg_graph is bridgeless

    Any edge e is an unordered pair s(u, v) by Sym2.ind. By SimpleGraph.isBridge_iff and double negation elimination (not_not), an edge is not a bridge if u and v remain reachable after its deletion, which holds by op874pfg_avoid_edge.

    lines 33–37

    uses Sym2.ind, SimpleGraph.isBridge_iff, not_not, op874pfg_avoid_edge

      intro e
      induction e using Sym2.ind with
      | _ u v =>
        rw [SimpleGraph.isBridge_iff, not_not]
        exact op874pfg_avoid_edge u v
  7. The graph op874pfg_graph witnesses all required properties except the edge description match automation

    We supply op874pfg_graph along with its proofs of connectivity and bridgelessness. The remaining conditions—cubic degree 3 at each vertex, disjointness of the matching and factor squares, 1-factor property of M, involution and cut properties of mate and b, cut score 6, and local/global optimality—are all closed by exhaustive finite evaluation.

    lines 59–60

    uses op874pfg_connected, op874pfg_bridgeless

      refine ⟨op874pfg_graph, op874pfg_connected, op874pfg_bridgeless, ?_, by decide,
        by decide, by decide, by decide, by decide, by decide⟩
  8. The edge set op874pf_edges equals the union of the matching and the factor squares, matching the adjacency definition

    We first check by finite evaluation that op874pf_edges is the union of op874pfg_matching and op874pfg_factor. Unfolding the definition of adjacency in op874pfg_graph, this identity rewrites the adjacency condition directly to membership in op874pf_edges.

    lines 61–65

      have hE : op874pf_edges = op874pfg_matching ∪ op874pfg_factor := by decide
      intro u v
      change (u ≠ v ∧ s(u,v) ∈ op874pfg_matching ∪ op874pfg_factor) ↔
        (u ≠ v ∧ s(u,v) ∈ op874pf_edges)
      rw [hE]
Sym2.eq_swap
Unordered pair symmetry: s(a, b) = s(b, a)
SimpleGraph.isBridge_iff
An edge s(u, v) is a bridge if and only if u and v are not reachable in the graph after deleting that edge
not_not
Double negation elimination: ¬¬a ↔ a
Sym2.ind
Induction principle for unordered pairs: to prove a property of an unordered pair, it suffices to prove it for pairs s(x, y)
op874pfg_avoid_edge
The graph remains connected after deleting any edge; specifically, u and v are reachable in the graph with s(u, v) removed
op874pfg_connected
The constructed graph op874pfg_graph is connected
op874pfg_bridgeless
The constructed graph op874pfg_graph has no bridges

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 maxRecDepth 8192set_option maxHeartbeats 3000000private def op874pfg_matching : Finset (Sym2 (Fin 8)) :=  {s(0,5),s(2,6),s(1,7),s(3,4)}private def op874pfg_factor : Finset (Sym2 (Fin 8)) :=  {s(0,1),s(1,2),s(2,3),s(3,0),s(4,5),s(5,6),s(6,7),s(7,4)}private def op874pfg_all_edges : Finset (Sym2 (Fin 8)) := op874pf_edgesprivate def op874pfg_graph : SimpleGraph (Fin 8) where  Adj u v := u ≠ v ∧ s(u,v) ∈ op874pfg_matching ∪ op874pfg_factor  symm := ⟨by    intro u v h    exact ⟨h.1.symm, by simpa [Sym2.eq_swap] using h.2⟩⟩  loopless := ⟨by intro u h; exact h.1 rfl⟩private instance : DecidableRel op874pfg_graph.Adj := fun u v => by  change Decidable (u ≠ v ∧ s(u,v) ∈ op874pfg_matching ∪ op874pfg_factor)  infer_instanceprivate def op874pfg_bits : Fin 8 → Bool := ![true,true,false,false,false,true,false,true]private def op874pfg_mate : Fin 8 → Fin 8 := ![5,7,6,4,3,0,2,1]private def op874pfg_same (v : Fin 8) : ℕ :=  (Finset.univ.filter fun w : Fin 8 =>    s(v,w) ∈ op874pfg_factor ∧ op874pfg_bits v = op874pfg_bits w).cardprivate def op874pfg_score (b : Fin 8 → Bool) : ℕ :=  ([(0,1),(1,2),(2,3),(3,0),(4,5),(5,6),(6,7),(7,4)] : List (Fin 8 × Fin 8)).filter    (fun e => b e.1 != b e.2) |>.lengthprivate theorem op874pfg_connected : op874pfg_graph.Connected := by decideprivate theorem op874pfg_avoid_edge : ∀ u v : Fin 8,    (op874pfg_graph.deleteEdges {s(u,v)}).Reachable u v := by  intro u  fin_cases u <;> decideprivate theorem op874pfg_bridgeless : ∀ e : Sym2 (Fin 8), ¬ op874pfg_graph.IsBridge e := by  intro e  induction e using Sym2.ind with  | _ u v =>    rw [SimpleGraph.isBridge_iff, not_not]    exact op874pfg_avoid_edge u vtheorem op874_pseudoforest_graph_and_cut_public :    let M : Finset (Sym2 (Fin 8)) := {s(0,5),s(2,6),s(1,7),s(3,4)}    let F : Finset (Sym2 (Fin 8)) := {s(0,1),s(1,2),s(2,3),s(3,0),s(4,5),s(5,6),s(6,7),s(7,4)}    let b : Fin 8 → Bool := ![true,true,false,false,false,true,false,true]    let mate : Fin 8 → Fin 8 := ![5,7,6,4,3,0,2,1]    let same := fun v : Fin 8 => (Finset.univ.filter fun w : Fin 8 =>      s(v,w) ∈ F ∧ b v = b w).card    let score := fun c : Fin 8 → Bool =>      (([(0,1),(1,2),(2,3),(3,0),(4,5),(5,6),(6,7),(7,4)] : List (Fin 8 × Fin 8)).filter        fun e => c e.1 != c e.2).length    ∃ G : SimpleGraph (Fin 8), G.Connected ∧      (∀ e : Sym2 (Fin 8), ¬ G.IsBridge e) ∧      (∀ u v, G.Adj u v ↔ u ≠ v ∧ s(u,v) ∈ op874pf_edges) ∧      (∀ v : Fin 8, (op874pf_edges.filter fun e => v ∈ e).card=3) ∧      Disjoint M F ∧ (∀ v : Fin 8, (M.filter fun e => v ∈ e).card=1) ∧      (∀ v : Fin 8, mate (mate v) = v ∧ mate v ≠ v ∧ s(v,mate v) ∈ M ∧        b v = b (mate v) ∧ same v + same (mate v) ≤ 2) ∧      score b = 6 ∧      (∀ c : Fin 8 → Bool,        c 0=c 5 → c 1=c 7 → c 2=c 6 → c 3=c 4 → score c ≤ 6) := by  refine ⟨op874pfg_graph, op874pfg_connected, op874pfg_bridgeless, ?_, by decide,    by decide, by decide, by decide, by decide, by decide⟩  have hE : op874pf_edges = op874pfg_matching ∪ op874pfg_factor := by decide  intro u v  change (u ≠ v ∧ s(u,v) ∈ op874pfg_matching ∪ op874pfg_factor) ↔    (u ≠ v ∧ s(u,v) ∈ op874pf_edges)  rw [hE]
See it in the graphDiscuss this resultChallenge it