AFTD Auto-Formalizing Theoretical Domains

odd_cycle_seven_three_token_fractional_cover

theoremverifiedoriginal

There exists a function assigning a nonnegative rational weight to each vertex set C of a directed 7-cycle in the 3-token graph of Z/7Z (where an arc replaces some x in S with x+1 when x+1 is unoccupied) such that every 3-subset S of Z/7Z has sum of weights of cycles containing S equal to 1.

Statement

theorem odd_cycle_seven_three_token_fractional_cover :
    ∃ (weights : { C : Finset { s : Finset (ZMod 7) // s.card = 3 } //
        ∃ c : ZMod 7 → { s : Finset (ZMod 7) // s.card = 3 },
          (∀ i : ZMod 7, ∃ x ∈ (c i).val, (x + 1) ∉ (c i).val ∧ (c (i + 1)).val = insert (x + 1) ((c i).val.erase x)) ∧
          C = Finset.image c Finset.univ } → ℚ),
      (∀ C, 0 ≤ weights C) ∧
      (∀ S : { s : Finset (ZMod 7) // s.card = 3 },
        ∑ C, (if S ∈ C.val then weights C else 0) = 1)
Related work
arXiv:2611.22830
Verified
27 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • 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…

Read back from the Lean

There exists a function weights assigning a rational number to each set C of 3-element subsets of ZMod 7 that can be realized as the image of a cycle of length 7 in the token configuration graph—that is, C = Finset.image c Finset.univ for some c : ZMod 7 → { s : Finset (ZMod 7) // s.card = 3 } where at each step i : ZMod 7, configuration c (i + 1) is formed from c i by moving a single token from some x ∈ c i to x + 1 ∉ c i (i.e., (c (i + 1)).val = insert (x + 1) ((c i).val.erase x))—such that: 1. Every weight is non-negative: ∀ C, 0 ≤ weights C. 2. For every 3-element subset S of ZMod 7, the sum of weights C over all such cycle-images C containing S equals 1 (an exact fractional cover).

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 constructs an explicit fractional cycle cover of the 3-token graph of the directed 7-cycle by considering three base 7-cycles and their shifts by elements of Z/7Z. Integer weights of 1, 1, and 3 are assigned to the shifts of the three base cycles, and exhaustive evaluation (`decide`) verifies that each 3-subset of Z/7Z is covered with a total weight of 7. Dividing these weights by 7 yields nonnegative rational weights summing to 1 on every 3-subset, which is verified by exchanging the order of summation and collapsing the cycle sum to the precomputed integer value.

  1. Translating a 3-element subset of Z/7Z by any shift preserves its cardinality.

    The shift map x ↦ x + k on Z/7Z is injective because addition satisfies right cancellation (`add_right_cancel`). By `card_image_of_injective`, the cardinality of the image set equals the cardinality of the original set, which is 3.

    lines 3–6

    uses card_image_of_injective, add_right_cancel

    lemma odd_cycle_seven_three_token_fractional_cover_shift_set_card (s : Finset (ZMod 7)) (k : ZMod 7) (h : s.card = 3) :
        (s.image (· + k)).card = 3 := by
      rw [card_image_of_injective s (fun a b hab => add_right_cancel hab), h]
    
  2. Each of the 21 vertex sets defining the three base cycles consists of exactly 3 distinct elements of Z/7Z. automation

    For each base cycle m ∈ {0, 1, 2} and each step i ∈ {0, ..., 6}, the set of tokens is explicitly specified as three elements. The decision procedure `decide` computes the cardinality of each explicit finite set by checking pairwise inequality of the elements and confirms that all 21 sets have cardinality 3.

    lines 11–33

    def odd_cycle_seven_three_token_fractional_cover_base_c : Fin 3 → Fin 7 → { s : Finset (ZMod 7) // s.card = 3 }
      | 0, 0 => ⟨{0, 2, 4}, by decide⟩
      | 0, 1 => ⟨{0, 2, 5}, by decide⟩
      | 0, 2 => ⟨{1, 2, 5}, by decide⟩
      | 0, 3 => ⟨{1, 3, 5}, by decide⟩
      | 0, 4 => ⟨{1, 3, 6}, by decide⟩
      | 0, 5 => ⟨{2, 3, 6}, by decide⟩
      | 0, 6 => ⟨{2, 4, 6}, by decide⟩
      | 1, 0 => ⟨{3, 4, 5}, by decide⟩
      | 1, 1 => ⟨{3, 4, 6}, by decide⟩
      | 1, 2 => ⟨{0, 3, 4}, by decide⟩
      | 1, 3 => ⟨{0, 3, 5}, by decide⟩
      | 1, 4 => ⟨{1, 3, 5}, by decide⟩
      | 1, 5 => ⟨{1, 4, 5}, by decide⟩
      | 1, 6 => ⟨{2, 4, 5}, by decide⟩
      | 2, 0 => ⟨{0, 1, 2}, by decide⟩
      | 2, 1 => ⟨{0, 1, 3}, by decide⟩
      | 2, 2 => ⟨{0, 2, 3}, by decide⟩
      | 2, 3 => ⟨{1, 2, 3}, by decide⟩
      | 2, 4 => ⟨{1, 2, 4}, by decide⟩
      | 2, 5 => ⟨{1, 2, 5}, by decide⟩
      | 2, 6 => ⟨{1, 2, 6}, by decide⟩
    
  3. Every step in each of the 21 shifted cycles is a valid move in the directed 3-token graph. automation

    For each of the three base cycles, each shift k ∈ Z/7Z, and each position i ∈ Z/7Z, moving from step i to step i + 1 replaces some token x with x + 1 while leaving the other two tokens in place, with x + 1 initially unoccupied. Because the parameter space is finite, `decide` checks this existential transition property exhaustively for all (m, k, i).

    lines 34–46

    def odd_cycle_seven_three_token_fractional_cover_cycle_step (m : Fin 3) (k : ZMod 7) (i : ZMod 7) :
        { s : Finset (ZMod 7) // s.card = 3 } :=
      odd_cycle_seven_three_token_fractional_cover_shift_sub
        (odd_cycle_seven_three_token_fractional_cover_base_c m ⟨i.val, ZMod.val_lt i⟩) k
    
    lemma odd_cycle_seven_three_token_fractional_cover_cycle_step_valid :
        ∀ (m : Fin 3) (k : ZMod 7) (i : ZMod 7),
          ∃ x ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_step m k i).val,
            (x + 1) ∉ (odd_cycle_seven_three_token_fractional_cover_cycle_step m k i).val ∧
            (odd_cycle_seven_three_token_fractional_cover_cycle_step m k (i + 1)).val =
              insert (x + 1) ((odd_cycle_seven_three_token_fractional_cover_cycle_step m k i).val.erase x) := by
      decide
    
  4. Assigning integer weights 1, 1, and 3 to the three base cycles covers every 3-subset of Z/7Z with a total weight of 7 across all 21 shifted cycles. automation

    For each 3-element subset S ⊆ Z/7Z, we consider the sum over all 21 shifted cycles p = (m, k) of the weight of m if S is a vertex of cycle p, and 0 otherwise. Since there are 35 such subsets and 21 cycles, `decide` verifies by direct finite computation that the sum equals 7 for every subset.

    lines 53–71

    def odd_cycle_seven_three_token_fractional_cover_cycle_elem (p : Fin 3 × ZMod 7) :
        OddCycleSevenThreeTokenFractionalCoverSubtype :=
      ⟨Finset.image (odd_cycle_seven_three_token_fractional_cover_cycle_step p.1 p.2) Finset.univ,
       ⟨odd_cycle_seven_three_token_fractional_cover_cycle_step p.1 p.2,
        ⟨odd_cycle_seven_three_token_fractional_cover_cycle_step_valid p.1 p.2, rfl⟩⟩⟩
    
    def odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat : Fin 3 → ℕ
      | 0 => 1
      | 1 => 1
      | 2 => 3
    
    lemma odd_cycle_seven_three_token_fractional_cover_sum_nat_eq_seven :
        ∀ S : { s : Finset (ZMod 7) // s.card = 3 },
          ∑ p : Fin 3 × ZMod 7,
            (if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then
              odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1
            else 0) = 7 := by
      decide
    
  5. The candidate rational weight assigned to each cycle is nonnegative.

    We define the weight of a cycle vertex set C to be the sum of the integer weights of all pairs p = (m, k) that generate C, divided by 7. Each term in the sum is either a nonnegative integer weight or 0, so the numerator is nonnegative by `Finset.sum_nonneg` and `positivity`. Since the denominator 7 is positive (`norm_num`), the quotient is nonnegative by `div_nonneg`.

    lines 88–96

    uses div_nonneg, Finset.sum_nonneg

      use odd_cycle_seven_three_token_fractional_cover_weights
      constructor
      · intro C
        dsimp [odd_cycle_seven_three_token_fractional_cover_weights]
        apply div_nonneg
        · apply Finset.sum_nonneg
          intro p hp
          split_ifs <;> positivity
        · norm_num
  6. For any 3-subset S, the total fractional cover weight is 1/7 times the sum over all cycles C of the conditional integer weights.

    Fix a 3-subset S. Unfolding the definition of weights shows that the term (S ∈ C ? w(C) : 0) equals 1/7 times the conditional sum of integer weights for parameter pairs producing C when S ∈ C, and 0 otherwise (proven as `h1`). Applying `Finset.sum_div` factors the scalar 1/7 out of the summation over all cycles C.

    lines 97–107

    uses Finset.sum_div

      · intro S
        have h1 : ∀ C : OddCycleSevenThreeTokenFractionalCoverSubtype,
            (if S ∈ C.val then odd_cycle_seven_three_token_fractional_cover_weights C else 0) =
            (if S ∈ C.val then ∑ p : Fin 3 × ZMod 7,
              if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then
                (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)
              else 0 else 0) / 7 := by
          intro C
          dsimp [odd_cycle_seven_three_token_fractional_cover_weights]
          split_ifs <;> ring
        simp_rw [h1, ← Finset.sum_div]
  7. The outer sum over cycles and the inner sum over parameter pairs can be exchanged.

    First, the membership condition S ∈ C is distributed inside the summation over parameter pairs p (proven as `h2`), since when S ∉ C the entire inner sum vanishes. Then, `Finset.sum_comm` interchanges the summation over cycles C and the summation over parameter pairs p.

    lines 108–124

    uses Finset.sum_comm

        have h2 : ∀ C : OddCycleSevenThreeTokenFractionalCoverSubtype,
            (if S ∈ C.val then ∑ p : Fin 3 × ZMod 7,
              if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then
                (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)
              else 0 else 0) =
            ∑ p : Fin 3 × ZMod 7,
              if S ∈ C.val then
                (if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then
                  (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)
                else 0)
              else 0 := by
          intro C
          split_ifs with h
          · rfl
          · simp
        simp_rw [h2]
        rw [Finset.sum_comm]
  8. For each parameter pair p, the inner sum over all cycles C collapses to whether the cycle generated by p contains S.

    For a fixed pair p, the summand is nonzero only for the unique cycle C equal to the cycle C_p generated by p (proven as `h4`). Summing this indicator over all cycles C in the universe via `Finset.sum_ite_eq'`, `Finset.mem_univ`, and `if_true` collapses the sum over C to the single term (S ∈ C_p ? weight(p.1) : 0).

    lines 125–153

    uses Finset.sum_ite_eq', Finset.mem_univ, if_true

        have h3 : ∀ p : Fin 3 × ZMod 7,
            (∑ C : OddCycleSevenThreeTokenFractionalCoverSubtype,
              if S ∈ C.val then
                (if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then
                  (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)
                else 0)
              else 0) =
            if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then
              (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)
            else 0 := by
          intro p
          have h4 : ∀ C : OddCycleSevenThreeTokenFractionalCoverSubtype,
              (if S ∈ C.val then
                (if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then
                  (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)
                else 0)
              else 0) =
              if C = odd_cycle_seven_three_token_fractional_cover_cycle_elem p then
                (if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then
                  (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)
                else 0)
              else 0 := by
            intro C
            by_cases h : C = odd_cycle_seven_three_token_fractional_cover_cycle_elem p
            · subst h; split_ifs <;> rfl
            · have : ¬(odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C) := fun h' => h h'.symm
              simp [h, this]
          simp_rw [h4, Finset.sum_ite_eq', Finset.mem_univ, if_true]
        simp_rw [h3]
  9. The total fractional weight covering S equals 1.

    The sum of rational values is recast as the rational cast of the integer sum over pairs p (`h_cast`). By lemma `odd_cycle_seven_three_token_fractional_cover_sum_nat_eq_seven`, this integer sum equals 7 for any 3-subset S. Substituting 7 gives 7 / 7 = 1, which is evaluated by `norm_num`.

    lines 154–164

    uses odd_cycle_seven_three_token_fractional_cover_sum_nat_eq_seven

        have h_cast : (∑ p : Fin 3 × ZMod 7,
            if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then
              (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)
            else 0) =
            ((∑ p : Fin 3 × ZMod 7,
              if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then
                odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1
              else 0 : ℕ) : ℚ) := by
          push_cast; rfl
        rw [h_cast, odd_cycle_seven_three_token_fractional_cover_sum_nat_eq_seven S]
        norm_num
card_image_of_injective
The image of a finite set under an injective map has the same cardinality as the original set.
add_right_cancel
In an additive structure with right cancellation, adding the same element on the right preserves equality only if the left-hand elements are equal.
div_nonneg
The quotient of two nonnegative numbers is nonnegative.
Finset.sum_nonneg
A finite sum of nonnegative terms is nonnegative.
Finset.sum_div
Dividing a finite sum by a scalar is equal to dividing each term by that scalar and then summing.
Finset.sum_comm
The order of summation in a double finite sum can be interchanged.
Finset.sum_ite_eq'
The sum over a finite set of terms that are non-zero only when the index equals a fixed element a evaluates to the value at a if a belongs to the set, and 0 otherwise.
Finset.mem_univ
Every element of a finite type belongs to its universal finset.
if_true
An if-then-else conditional whose condition is true evaluates to the then branch.
odd_cycle_seven_three_token_fractional_cover_sum_nat_eq_seven
For every 3-subset S of Z/7Z, the sum of the integer weights of all shifted base cycles containing S is equal to 7.

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

open Finsetlemma odd_cycle_seven_three_token_fractional_cover_shift_set_card (s : Finset (ZMod 7)) (k : ZMod 7) (h : s.card = 3) :    (s.image (· + k)).card = 3 := by  rw [card_image_of_injective s (fun a b hab => add_right_cancel hab), h]def odd_cycle_seven_three_token_fractional_cover_shift_sub (s : { s : Finset (ZMod 7) // s.card = 3 }) (k : ZMod 7) :    { s : Finset (ZMod 7) // s.card = 3 } :=  ⟨s.val.image (· + k), odd_cycle_seven_three_token_fractional_cover_shift_set_card s.val k s.property⟩def odd_cycle_seven_three_token_fractional_cover_base_c : Fin 3 → Fin 7 → { s : Finset (ZMod 7) // s.card = 3 }  | 0, 0 => ⟨{0, 2, 4}, by decide⟩  | 0, 1 => ⟨{0, 2, 5}, by decide⟩  | 0, 2 => ⟨{1, 2, 5}, by decide⟩  | 0, 3 => ⟨{1, 3, 5}, by decide⟩  | 0, 4 => ⟨{1, 3, 6}, by decide⟩  | 0, 5 => ⟨{2, 3, 6}, by decide⟩  | 0, 6 => ⟨{2, 4, 6}, by decide⟩  | 1, 0 => ⟨{3, 4, 5}, by decide⟩  | 1, 1 => ⟨{3, 4, 6}, by decide⟩  | 1, 2 => ⟨{0, 3, 4}, by decide⟩  | 1, 3 => ⟨{0, 3, 5}, by decide⟩  | 1, 4 => ⟨{1, 3, 5}, by decide⟩  | 1, 5 => ⟨{1, 4, 5}, by decide⟩  | 1, 6 => ⟨{2, 4, 5}, by decide⟩  | 2, 0 => ⟨{0, 1, 2}, by decide⟩  | 2, 1 => ⟨{0, 1, 3}, by decide⟩  | 2, 2 => ⟨{0, 2, 3}, by decide⟩  | 2, 3 => ⟨{1, 2, 3}, by decide⟩  | 2, 4 => ⟨{1, 2, 4}, by decide⟩  | 2, 5 => ⟨{1, 2, 5}, by decide⟩  | 2, 6 => ⟨{1, 2, 6}, by decide⟩def odd_cycle_seven_three_token_fractional_cover_cycle_step (m : Fin 3) (k : ZMod 7) (i : ZMod 7) :    { s : Finset (ZMod 7) // s.card = 3 } :=  odd_cycle_seven_three_token_fractional_cover_shift_sub    (odd_cycle_seven_three_token_fractional_cover_base_c m ⟨i.val, ZMod.val_lt i⟩) klemma odd_cycle_seven_three_token_fractional_cover_cycle_step_valid :    ∀ (m : Fin 3) (k : ZMod 7) (i : ZMod 7),      ∃ x ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_step m k i).val,        (x + 1) ∉ (odd_cycle_seven_three_token_fractional_cover_cycle_step m k i).val ∧        (odd_cycle_seven_three_token_fractional_cover_cycle_step m k (i + 1)).val =          insert (x + 1) ((odd_cycle_seven_three_token_fractional_cover_cycle_step m k i).val.erase x) := by  decideabbrev OddCycleSevenThreeTokenFractionalCoverSubtype :=  { C : Finset { s : Finset (ZMod 7) // s.card = 3 } //    ∃ c : ZMod 7 → { s : Finset (ZMod 7) // s.card = 3 },      (∀ i : ZMod 7, ∃ x ∈ (c i).val, (x + 1) ∉ (c i).val ∧ (c (i + 1)).val = insert (x + 1) ((c i).val.erase x)) ∧      C = Finset.image c Finset.univ }def odd_cycle_seven_three_token_fractional_cover_cycle_elem (p : Fin 3 × ZMod 7) :    OddCycleSevenThreeTokenFractionalCoverSubtype :=  ⟨Finset.image (odd_cycle_seven_three_token_fractional_cover_cycle_step p.1 p.2) Finset.univ,   ⟨odd_cycle_seven_three_token_fractional_cover_cycle_step p.1 p.2,    ⟨odd_cycle_seven_three_token_fractional_cover_cycle_step_valid p.1 p.2, rfl⟩⟩⟩def odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat : Fin 3 → ℕ  | 0 => 1  | 1 => 1  | 2 => 3lemma odd_cycle_seven_three_token_fractional_cover_sum_nat_eq_seven :    ∀ S : { s : Finset (ZMod 7) // s.card = 3 },      ∑ p : Fin 3 × ZMod 7,        (if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then          odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1        else 0) = 7 := by  decidedef odd_cycle_seven_three_token_fractional_cover_weights    (C : OddCycleSevenThreeTokenFractionalCoverSubtype) : ℚ :=  (∑ p : Fin 3 × ZMod 7,    if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then      (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)    else 0) / 7/-- The 3-token graph of C_7 admits a uniform fractional winding cycle cover. -/theorem odd_cycle_seven_three_token_fractional_cover :    ∃ (weights : { C : Finset { s : Finset (ZMod 7) // s.card = 3 } //        ∃ c : ZMod 7 → { s : Finset (ZMod 7) // s.card = 3 },          (∀ i : ZMod 7, ∃ x ∈ (c i).val, (x + 1) ∉ (c i).val ∧ (c (i + 1)).val = insert (x + 1) ((c i).val.erase x)) ∧          C = Finset.image c Finset.univ } → ℚ),      (∀ C, 0 ≤ weights C) ∧      (∀ S : { s : Finset (ZMod 7) // s.card = 3 },        ∑ C, (if S ∈ C.val then weights C else 0) = 1) := by  use odd_cycle_seven_three_token_fractional_cover_weights  constructor  · intro C    dsimp [odd_cycle_seven_three_token_fractional_cover_weights]    apply div_nonneg    · apply Finset.sum_nonneg      intro p hp      split_ifs <;> positivity    · norm_num  · intro S    have h1 : ∀ C : OddCycleSevenThreeTokenFractionalCoverSubtype,        (if S ∈ C.val then odd_cycle_seven_three_token_fractional_cover_weights C else 0) =        (if S ∈ C.val then ∑ p : Fin 3 × ZMod 7,          if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then            (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)          else 0 else 0) / 7 := by      intro C      dsimp [odd_cycle_seven_three_token_fractional_cover_weights]      split_ifs <;> ring    simp_rw [h1, ← Finset.sum_div]    have h2 : ∀ C : OddCycleSevenThreeTokenFractionalCoverSubtype,        (if S ∈ C.val then ∑ p : Fin 3 × ZMod 7,          if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then            (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)          else 0 else 0) =        ∑ p : Fin 3 × ZMod 7,          if S ∈ C.val then            (if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then              (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)            else 0)          else 0 := by      intro C      split_ifs with h      · rfl      · simp    simp_rw [h2]    rw [Finset.sum_comm]    have h3 : ∀ p : Fin 3 × ZMod 7,        (∑ C : OddCycleSevenThreeTokenFractionalCoverSubtype,          if S ∈ C.val then            (if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then              (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)            else 0)          else 0) =        if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then          (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)        else 0 := by      intro p      have h4 : ∀ C : OddCycleSevenThreeTokenFractionalCoverSubtype,          (if S ∈ C.val then            (if odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C then              (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)            else 0)          else 0) =          if C = odd_cycle_seven_three_token_fractional_cover_cycle_elem p then            (if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then              (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)            else 0)          else 0 := by        intro C        by_cases h : C = odd_cycle_seven_three_token_fractional_cover_cycle_elem p        · subst h; split_ifs <;> rfl        · have : ¬(odd_cycle_seven_three_token_fractional_cover_cycle_elem p = C) := fun h' => h h'.symm          simp [h, this]      simp_rw [h4, Finset.sum_ite_eq', Finset.mem_univ, if_true]    simp_rw [h3]    have h_cast : (∑ p : Fin 3 × ZMod 7,        if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then          (odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1 : ℚ)        else 0) =        ((∑ p : Fin 3 × ZMod 7,          if S ∈ (odd_cycle_seven_three_token_fractional_cover_cycle_elem p).val then            odd_cycle_seven_three_token_fractional_cover_cycle_weight_nat p.1          else 0 : ℕ) : ℚ) := by      push_cast; rfl    rw [h_cast, odd_cycle_seven_three_token_fractional_cover_sum_nat_eq_seven S]    norm_num
See it in the graphDiscuss this resultChallenge it