AFTD Auto-Formalizing Theoretical Domains

good_slopes_fiber55_nonunit_collision_gap

theoremverified

Let S be any finite set of points over Z/55Z. If a unit direction has a collision between distinct points whose first-coordinate difference is not a unit, then S has at most 36 good unit directions.

Statement

theorem good_slopes_fiber55_nonunit_collision_gap (S : Finset (ZMod 55 × ZMod 55)) (a : ZMod 55) (ha : IsUnit a) (p q : ZMod 55 × ZMod 55) (hp : p ∈ S) (hq : q ∈ S) (hpq : p ≠ q) (hcollision : p.2 + a*p.1 = q.2 + a*q.1) (hnonunit : ¬ IsUnit (q.1-p.1)) : (good_slopes_point_directions 55 S).card ≤ 36
Source
CRT collision reduction for the local fiber approach to OP-1027; experiment 27539 illustrates the stronger difference-11 case.
Verified
15 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • good_slopes_point_directionsThe unit directions a for which the linear form y + a x is injective on a finite set of points over the residues modulo n.
Used by 1

The proof, explained

The proof first establishes by exhaustive finite computation that ℤ/55ℤ has 40 units and that progressions with step 11 (mod 5) or step 5 (mod 11) contain at least 4 units. For any collision p.2 + a * p.1 = q.2 + a * q.1 between distinct points p, q ∈ S with nonunit difference d = q.1 - p.1 ≠ 0, any direction b with (b - a) * d = 0 also collides on {p, q} and cannot be good. Because d is a nonunit, its integer value is divisible by 5 or 11; the corresponding progression yields at least 4 bad units that annihilate d. Subtracting these from the 40 total units bounds the number of good directions by 36.

  1. There are exactly 40 units in the ring ℤ/55ℤ. automation

    The ring ℤ/55ℤ is a finite ring whose elements can be checked directly by computation (`decide`). The number of units is the value of Euler's totient function φ(55) = φ(5) · φ(11) = 4 · 10 = 40.

    lines 1–3

    lemma good_slopes_fiber55_nonunit_collision_gap_card_units :
        (Finset.univ.filter (fun b : ZMod 55 => IsUnit b)).card = 40 := by decide
    
  2. For any unit a in ℤ/55ℤ, the 5-element arithmetic progression {a + 11k | 0 ≤ k < 5} contains at least 4 units. automation

    This universal statement over all units in the finite ring ℤ/55ℤ is verified by exhaustive computation via `decide`.

    lines 4–8

    lemma good_slopes_fiber55_nonunit_collision_gap_five :
        ∀ a : ZMod 55, IsUnit a →
          4 ≤ (((Finset.range 5).image (fun k : ℕ => a + (11:ZMod 55) * (k:ZMod 55))).filter (fun b => IsUnit b)).card := by
      decide
    
  3. For any unit a in ℤ/55ℤ, the 11-element arithmetic progression {a + 5k | 0 ≤ k < 11} contains at least 4 units. automation

    This universal statement over all units in the finite ring ℤ/55ℤ is verified by exhaustive computation via `decide`.

    lines 9–13

    lemma good_slopes_fiber55_nonunit_collision_gap_eleven :
        ∀ a : ZMod 55, IsUnit a →
          4 ≤ (((Finset.range 11).image (fun k : ℕ => a + (5:ZMod 55) * (k:ZMod 55))).filter (fun b => IsUnit b)).card := by
      decide
    
  4. The difference d = q.1 - p.1 between the first coordinates of the collision points is nonzero.

    Assume for contradiction that d = 0. Then q.1 - p.1 = 0, which implies q.1 = p.1 by `sub_eq_zero.mp`. Substituting this into the collision identity p.2 + a * p.1 = q.2 + a * q.1 gives p.2 + a * p.1 = q.2 + a * p.1, which simplifies to p.2 = q.2 by `add_right_cancel`. Combining the two coordinate equalities via `Prod.ext` gives p = q, contradicting the hypothesis that p ≠ q.

    lines 14–21

    uses sub_eq_zero.mp, add_right_cancel, Prod.ext

    theorem good_slopes_fiber55_nonunit_collision_gap (S : Finset (ZMod 55 × ZMod 55)) (a : ZMod 55) (ha : IsUnit a) (p q : ZMod 55 × ZMod 55) (hp : p ∈ S) (hq : q ∈ S) (hpq : p ≠ q) (hcollision : p.2 + a*p.1 = q.2 + a*q.1) (hnonunit : ¬ IsUnit (q.1-p.1)) : (good_slopes_point_directions 55 S).card ≤ 36 := by
      classical
      set d : ZMod 55 := q.1 - p.1 with hd
      have hd0 : d ≠ 0 := by
        intro h
        have h1 : q.1 = p.1 := by rw [hd] at h; exact sub_eq_zero.mp h
        have h2 : p.2 = q.2 := by rw [h1] at hcollision; exact add_right_cancel hcollision
        exact hpq (Prod.ext h1.symm h2)
  5. The difference of the second coordinates satisfies p.2 - q.2 = a * d.

    Expanding a * d = a * (q.1 - p.1) = a * q.1 - a * p.1 using `mul_sub`, the collision equation p.2 + a * p.1 = q.2 + a * q.1 rearranges directly by linear arithmetic to p.2 - q.2 = a * d.

    lines 22–24

    uses mul_sub

      have hcoll : p.2 - q.2 = a * d := by
        rw [hd, mul_sub]
        linear_combination hcollision
  6. Any direction b ∈ ℤ/55ℤ satisfying (b - a) * d = 0 collides on {p, q} and cannot be a good slope direction for S.

    Suppose b were in `good_slopes_point_directions 55 S`. By definition, b must be a unit and the projection (x, y) ↦ y + b * x must be injective on S. Using p.1 - q.1 = -d and p.2 - q.2 = a * d, we compute (p.2 - q.2) + b * (p.1 - q.1) = a * d - b * d = -(b - a) * d = 0, so p.2 + b * p.1 = q.2 + b * q.1. By injectivity, this forces p = q, which contradicts p ≠ q.

    lines 25–38

    uses good_slopes_point_directions, Finset.mem_filter, Finset.mem_univ, true_and, neg_mul, neg_zero, Finset.mem_coe.mpr

      have hbad : ∀ b : ZMod 55, (b - a) * d = 0 → b ∉ good_slopes_point_directions 55 S := by
        intro b hb hbgood
        rw [good_slopes_point_directions] at hbgood
        simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hbgood
        obtain ⟨hjunit, hbinj⟩ := hbgood
        have hval : p.2 + b * p.1 = q.2 + b * q.1 := by
          have hp1 : p.1 - q.1 = -d := by rw [hd]; ring
          have key : (p.2 - q.2) + b * (p.1 - q.1) = 0 := by
            rw [hcoll, hp1]
            have hab : a - b = -(b - a) := by ring
            have hzero : (a - b) * d = 0 := by rw [hab, neg_mul, hb, neg_zero]
            linear_combination hzero
          linear_combination key
        exact hpq (hbinj (Finset.mem_coe.mpr hp) (Finset.mem_coe.mpr hq) hval)
  7. The canonical integer representative d.val is divisible by 5 or by 11.

    Since d is not a unit in ℤ/55ℤ, d.val cannot be coprime to 55 by `ZMod.isUnit_iff_coprime` and `ZMod.natCast_zmod_val`. If neither 5 nor 11 divided d.val, then since 5 and 11 are primes, d.val would be coprime to both 5 and 11 by `Nat.Prime.coprime_iff_not_dvd`. By `Nat.coprime_mul_iff_right`, d.val would then be coprime to 5 * 11 = 55, a contradiction.

    lines 39–52

    uses ZMod.natCast_zmod_val, ZMod.isUnit_iff_coprime, not_or, Nat.coprime_mul_iff_right, Nat.Prime.coprime_iff_not_dvd

      have hnonunit' : ¬ Nat.Coprime d.val 55 := by
        intro hc
        apply hnonunit
        have hv : ((d.val : ℕ) : ZMod 55) = d := ZMod.natCast_zmod_val d
        rw [← hv]
        exact (ZMod.isUnit_iff_coprime d.val 55).mpr hc
      have hcase : 5 ∣ d.val ∨ 11 ∣ d.val := by
        by_contra h
        rw [not_or] at h
        apply hnonunit'
        have hcop : Nat.Coprime d.val (5 * 11) ↔ Nat.Coprime d.val 5 ∧ Nat.Coprime d.val 11 :=
          Nat.coprime_mul_iff_right (m := 5) (n := 11) (k := d.val)
        exact hcop.mpr ⟨((Nat.Prime.coprime_iff_not_dvd (by decide : Nat.Prime 5)).mpr h.1).symm,
                        ((Nat.Prime.coprime_iff_not_dvd (by decide : Nat.Prime 11)).mpr h.2).symm⟩
  8. The set U of all units in ℤ/55ℤ has 40 elements, and all good slope directions for S belong to U.

    The set U of units has cardinality 40 by `good_slopes_fiber55_nonunit_collision_gap_card_units`. By definition (`good_slopes_point_directions`), every good slope direction is a unit, so the set of good directions is a subset of U.

    lines 53–60

    uses good_slopes_fiber55_nonunit_collision_gap_card_units, good_slopes_point_directions, Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_filter.mpr

      set U : Finset (ZMod 55) := Finset.univ.filter (fun b => IsUnit b) with hU
      have hUcard : U.card = 40 := by rw [hU]; exact good_slopes_fiber55_nonunit_collision_gap_card_units
      have hgoodU : good_slopes_point_directions 55 S ⊆ U := by
        intro b hb
        rw [good_slopes_point_directions] at hb
        simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hb
        rw [hU]
        exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hb.1⟩
  9. If 5 divides d.val, then S has at most 36 good slope directions.

    Writing d = 5 * m in ℤ/55ℤ, let T be the set of units in the arithmetic progression {a + 11 * k | 0 ≤ k < 5}. By `good_slopes_fiber55_nonunit_collision_gap_five`, |T| ≥ 4. For every b = a + 11 * k in T, (b - a) * d = 11 * k * (5 * m) = 55 * (k * m) = 0 in ℤ/55ℤ, so b cannot be a good slope direction. Hence T and the good slope directions are disjoint subsets of the 40-element unit set U. Their disjoint union has size at most 40, so by linear integer arithmetic (`omega`), there are at most 40 - 4 = 36 good directions.

    lines 61–97

    uses ZMod.natCast_zmod_val, good_slopes_fiber55_nonunit_collision_gap_five, Finset.mem_filter, Finset.mem_univ, Finset.mem_filter.mpr, Finset.mem_image, ZMod.natCast_self, zero_mul, Finset.disjoint_left, Finset.card_union_eq_card_add_card, Finset.card_le_card, Finset.union_subset

      rcases hcase with h5 | h11
      · obtain ⟨m, hm⟩ := h5
        have hd5 : d = 5 * (m : ZMod 55) := by
          conv_lhs => rw [← ZMod.natCast_zmod_val d]
          rw [hm]; push_cast; ring
        set T : Finset (ZMod 55) := ((Finset.range 5).image (fun k : ℕ => a + (11:ZMod 55)*(k:ZMod 55))).filter (fun b => IsUnit b) with hT
        have hTc : 4 ≤ T.card := by rw [hT]; exact good_slopes_fiber55_nonunit_collision_gap_five a ha
        have hTsub : T ⊆ U := by
          intro b hb
          rw [hT] at hb
          simp only [Finset.mem_filter] at hb
          rw [hU]
          exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hb.2⟩
        have hTbad : ∀ b ∈ T, b ∉ good_slopes_point_directions 55 S := by
          intro b hb
          rw [hT] at hb
          simp only [Finset.mem_filter] at hb
          obtain ⟨hbimg, -⟩ := hb
          rw [Finset.mem_image] at hbimg
          obtain ⟨k, hk, hkb⟩ := hbimg
          rw [← hkb]
          apply hbad
          have hsub : (a + (11:ZMod 55)*(k:ZMod 55)) - a = (11:ZMod 55)*(k:ZMod 55) := by ring
          rw [hsub, hd5]
          have heq : (11:ZMod 55)*(k:ZMod 55)*(5*(m:ZMod 55)) = ((55:ℕ):ZMod 55) * ((k:ZMod 55)*(m:ZMod 55)) := by ring
          rw [heq, ZMod.natCast_self 55, zero_mul]
        have hdisj : Disjoint (good_slopes_point_directions 55 S) T := by
          rw [Finset.disjoint_left]
          intro x hx hxt
          exact hTbad x hxt hx
        have hunion_card : (good_slopes_point_directions 55 S ∪ T).card
            = (good_slopes_point_directions 55 S).card + T.card :=
          (Finset.card_union_eq_card_add_card).mpr hdisj
        have hle : (good_slopes_point_directions 55 S ∪ T).card ≤ 40 := by
          rw [← hUcard]
          exact Finset.card_le_card (Finset.union_subset hgoodU hTsub)
        omega
  10. If 11 divides d.val, then S has at most 36 good slope directions.

    Writing d = 11 * m in ℤ/55ℤ, let T be the set of units in the progression {a + 5 * k | 0 ≤ k < 11}. By `good_slopes_fiber55_nonunit_collision_gap_eleven`, |T| ≥ 4. For every b = a + 5 * k in T, (b - a) * d = 5 * k * (11 * m) = 55 * (k * m) = 0 in ℤ/55ℤ, so b cannot be a good slope direction. Thus T and the good directions are disjoint subsets of U, meaning their union has size at most 40. Linear arithmetic (`omega`) again concludes that there are at most 40 - 4 = 36 good slope directions.

    lines 98–133

    uses ZMod.natCast_zmod_val, good_slopes_fiber55_nonunit_collision_gap_eleven, Finset.mem_filter, Finset.mem_univ, Finset.mem_filter.mpr, Finset.mem_image, ZMod.natCast_self, zero_mul, Finset.disjoint_left, Finset.card_union_eq_card_add_card, Finset.card_le_card, Finset.union_subset

      · obtain ⟨m, hm⟩ := h11
        have hd11 : d = 11 * (m : ZMod 55) := by
          conv_lhs => rw [← ZMod.natCast_zmod_val d]
          rw [hm]; push_cast; ring
        set T : Finset (ZMod 55) := ((Finset.range 11).image (fun k : ℕ => a + (5:ZMod 55)*(k:ZMod 55))).filter (fun b => IsUnit b) with hT
        have hTc : 4 ≤ T.card := by rw [hT]; exact good_slopes_fiber55_nonunit_collision_gap_eleven a ha
        have hTsub : T ⊆ U := by
          intro b hb
          rw [hT] at hb
          simp only [Finset.mem_filter] at hb
          rw [hU]
          exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hb.2⟩
        have hTbad : ∀ b ∈ T, b ∉ good_slopes_point_directions 55 S := by
          intro b hb
          rw [hT] at hb
          simp only [Finset.mem_filter] at hb
          obtain ⟨hbimg, -⟩ := hb
          rw [Finset.mem_image] at hbimg
          obtain ⟨k, hk, hkb⟩ := hbimg
          rw [← hkb]
          apply hbad
          have hsub : (a + (5:ZMod 55)*(k:ZMod 55)) - a = (5:ZMod 55)*(k:ZMod 55) := by ring
          rw [hsub, hd11]
          have heq : (5:ZMod 55)*(k:ZMod 55)*(11*(m:ZMod 55)) = ((55:ℕ):ZMod 55) * ((k:ZMod 55)*(m:ZMod 55)) := by ring
          rw [heq, ZMod.natCast_self 55, zero_mul]
        have hdisj : Disjoint (good_slopes_point_directions 55 S) T := by
          rw [Finset.disjoint_left]
          intro x hx hxt
          exact hTbad x hxt hx
        have hunion_card : (good_slopes_point_directions 55 S ∪ T).card
            = (good_slopes_point_directions 55 S).card + T.card :=
          (Finset.card_union_eq_card_add_card).mpr hdisj
        have hle : (good_slopes_point_directions 55 S ∪ T).card ≤ 40 := by
          rw [← hUcard]
          exact Finset.card_le_card (Finset.union_subset hgoodU hTsub)
        omega
sub_eq_zero.mp
If the difference a - b is 0, then a = b.
add_right_cancel
In an additive structure, a + b = c + b implies a = c.
Prod.ext
Two ordered pairs are equal if their respective components are equal.
mul_sub
Left multiplication distributes over subtraction: a * (b - c) = a * b - a * c.
good_slopes_point_directions
The definition of the finset of good slope directions for S: the units a in ℤ/nℤ such that (x, y) ↦ y + a * x is injective on S.
Finset.mem_filter
An element belongs to a filtered finset if and only if it belongs to the base finset and satisfies the predicate.
Finset.mem_univ
Every element of a finite type belongs to the universal finset `Finset.univ`.
true_and
The proposition (True ∧ p) is logically equivalent to p.
neg_mul
Multiplying the negation of a by b equals the negation of a * b.
neg_zero
The negation of zero is zero: -0 = 0.
Finset.mem_coe.mpr
Membership in a finset implies membership in the set obtained by coercing the finset.
ZMod.natCast_zmod_val
Casting the canonical integer representative a.val back to ℤ/nℤ yields the original element a.
ZMod.isUnit_iff_coprime
An integer m cast to ℤ/nℤ is a unit if and only if m is coprime to n.
not_or
De Morgan's law: ¬(p ∨ q) is equivalent to ¬p ∧ ¬q.
Nat.coprime_mul_iff_right
An integer k is coprime to m * n if and only if k is coprime to m and k is coprime to n.
Nat.Prime.coprime_iff_not_dvd
A prime p is coprime to n if and only if p does not divide n.
good_slopes_fiber55_nonunit_collision_gap_card_units
There are exactly 40 units in the ring ℤ/55ℤ.
Finset.mem_filter.mpr
If an element is in finset s and satisfies predicate p, it belongs to `Finset.filter p s`.
good_slopes_fiber55_nonunit_collision_gap_five
For any unit a in ℤ/55ℤ, the arithmetic progression {a + 11k | 0 ≤ k < 5} contains at least 4 units.
good_slopes_fiber55_nonunit_collision_gap_eleven
For any unit a in ℤ/55ℤ, the arithmetic progression {a + 5k | 0 ≤ k < 11} contains at least 4 units.
Finset.mem_image
An element b is in the image of s under f if and only if b = f(a) for some a in s.
ZMod.natCast_self
The modulus n cast to ℤ/nℤ is 0.
zero_mul
Zero multiplied by any element is zero.
Finset.disjoint_left
Two finsets are disjoint if and only if no element of the first belongs to the second.
Finset.card_union_eq_card_add_card
The cardinality of the union of two disjoint finsets is the sum of their cardinalities.
Finset.card_le_card
If finset s is a subset of finset t, then |s| ≤ |t|.
Finset.union_subset
If s ⊆ u and t ⊆ u, then s ∪ t ⊆ u.

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

lemma good_slopes_fiber55_nonunit_collision_gap_card_units :    (Finset.univ.filter (fun b : ZMod 55 => IsUnit b)).card = 40 := by decidelemma good_slopes_fiber55_nonunit_collision_gap_five :    ∀ a : ZMod 55, IsUnit a →      4 ≤ (((Finset.range 5).image (fun k : ℕ => a + (11:ZMod 55) * (k:ZMod 55))).filter (fun b => IsUnit b)).card := by  decidelemma good_slopes_fiber55_nonunit_collision_gap_eleven :    ∀ a : ZMod 55, IsUnit a →      4 ≤ (((Finset.range 11).image (fun k : ℕ => a + (5:ZMod 55) * (k:ZMod 55))).filter (fun b => IsUnit b)).card := by  decidetheorem good_slopes_fiber55_nonunit_collision_gap (S : Finset (ZMod 55 × ZMod 55)) (a : ZMod 55) (ha : IsUnit a) (p q : ZMod 55 × ZMod 55) (hp : p ∈ S) (hq : q ∈ S) (hpq : p ≠ q) (hcollision : p.2 + a*p.1 = q.2 + a*q.1) (hnonunit : ¬ IsUnit (q.1-p.1)) : (good_slopes_point_directions 55 S).card ≤ 36 := by  classical  set d : ZMod 55 := q.1 - p.1 with hd  have hd0 : d ≠ 0 := by    intro h    have h1 : q.1 = p.1 := by rw [hd] at h; exact sub_eq_zero.mp h    have h2 : p.2 = q.2 := by rw [h1] at hcollision; exact add_right_cancel hcollision    exact hpq (Prod.ext h1.symm h2)  have hcoll : p.2 - q.2 = a * d := by    rw [hd, mul_sub]    linear_combination hcollision  have hbad : ∀ b : ZMod 55, (b - a) * d = 0 → b ∉ good_slopes_point_directions 55 S := by    intro b hb hbgood    rw [good_slopes_point_directions] at hbgood    simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hbgood    obtain ⟨hjunit, hbinj⟩ := hbgood    have hval : p.2 + b * p.1 = q.2 + b * q.1 := by      have hp1 : p.1 - q.1 = -d := by rw [hd]; ring      have key : (p.2 - q.2) + b * (p.1 - q.1) = 0 := by        rw [hcoll, hp1]        have hab : a - b = -(b - a) := by ring        have hzero : (a - b) * d = 0 := by rw [hab, neg_mul, hb, neg_zero]        linear_combination hzero      linear_combination key    exact hpq (hbinj (Finset.mem_coe.mpr hp) (Finset.mem_coe.mpr hq) hval)  have hnonunit' : ¬ Nat.Coprime d.val 55 := by    intro hc    apply hnonunit    have hv : ((d.val : ℕ) : ZMod 55) = d := ZMod.natCast_zmod_val d    rw [← hv]    exact (ZMod.isUnit_iff_coprime d.val 55).mpr hc  have hcase : 5 ∣ d.val ∨ 11 ∣ d.val := by    by_contra h    rw [not_or] at h    apply hnonunit'    have hcop : Nat.Coprime d.val (5 * 11) ↔ Nat.Coprime d.val 5 ∧ Nat.Coprime d.val 11 :=      Nat.coprime_mul_iff_right (m := 5) (n := 11) (k := d.val)    exact hcop.mpr ⟨((Nat.Prime.coprime_iff_not_dvd (by decide : Nat.Prime 5)).mpr h.1).symm,                    ((Nat.Prime.coprime_iff_not_dvd (by decide : Nat.Prime 11)).mpr h.2).symm⟩  set U : Finset (ZMod 55) := Finset.univ.filter (fun b => IsUnit b) with hU  have hUcard : U.card = 40 := by rw [hU]; exact good_slopes_fiber55_nonunit_collision_gap_card_units  have hgoodU : good_slopes_point_directions 55 S ⊆ U := by    intro b hb    rw [good_slopes_point_directions] at hb    simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hb    rw [hU]    exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hb.1⟩  rcases hcase with h5 | h11  · obtain ⟨m, hm⟩ := h5    have hd5 : d = 5 * (m : ZMod 55) := by      conv_lhs => rw [← ZMod.natCast_zmod_val d]      rw [hm]; push_cast; ring    set T : Finset (ZMod 55) := ((Finset.range 5).image (fun k : ℕ => a + (11:ZMod 55)*(k:ZMod 55))).filter (fun b => IsUnit b) with hT    have hTc : 4 ≤ T.card := by rw [hT]; exact good_slopes_fiber55_nonunit_collision_gap_five a ha    have hTsub : T ⊆ U := by      intro b hb      rw [hT] at hb      simp only [Finset.mem_filter] at hb      rw [hU]      exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hb.2⟩    have hTbad : ∀ b ∈ T, b ∉ good_slopes_point_directions 55 S := by      intro b hb      rw [hT] at hb      simp only [Finset.mem_filter] at hb      obtain ⟨hbimg, -⟩ := hb      rw [Finset.mem_image] at hbimg      obtain ⟨k, hk, hkb⟩ := hbimg      rw [← hkb]      apply hbad      have hsub : (a + (11:ZMod 55)*(k:ZMod 55)) - a = (11:ZMod 55)*(k:ZMod 55) := by ring      rw [hsub, hd5]      have heq : (11:ZMod 55)*(k:ZMod 55)*(5*(m:ZMod 55)) = ((55:ℕ):ZMod 55) * ((k:ZMod 55)*(m:ZMod 55)) := by ring      rw [heq, ZMod.natCast_self 55, zero_mul]    have hdisj : Disjoint (good_slopes_point_directions 55 S) T := by      rw [Finset.disjoint_left]      intro x hx hxt      exact hTbad x hxt hx    have hunion_card : (good_slopes_point_directions 55 S ∪ T).card        = (good_slopes_point_directions 55 S).card + T.card :=      (Finset.card_union_eq_card_add_card).mpr hdisj    have hle : (good_slopes_point_directions 55 S ∪ T).card ≤ 40 := by      rw [← hUcard]      exact Finset.card_le_card (Finset.union_subset hgoodU hTsub)    omega  · obtain ⟨m, hm⟩ := h11    have hd11 : d = 11 * (m : ZMod 55) := by      conv_lhs => rw [← ZMod.natCast_zmod_val d]      rw [hm]; push_cast; ring    set T : Finset (ZMod 55) := ((Finset.range 11).image (fun k : ℕ => a + (5:ZMod 55)*(k:ZMod 55))).filter (fun b => IsUnit b) with hT    have hTc : 4 ≤ T.card := by rw [hT]; exact good_slopes_fiber55_nonunit_collision_gap_eleven a ha    have hTsub : T ⊆ U := by      intro b hb      rw [hT] at hb      simp only [Finset.mem_filter] at hb      rw [hU]      exact Finset.mem_filter.mpr ⟨Finset.mem_univ _, hb.2⟩    have hTbad : ∀ b ∈ T, b ∉ good_slopes_point_directions 55 S := by      intro b hb      rw [hT] at hb      simp only [Finset.mem_filter] at hb      obtain ⟨hbimg, -⟩ := hb      rw [Finset.mem_image] at hbimg      obtain ⟨k, hk, hkb⟩ := hbimg      rw [← hkb]      apply hbad      have hsub : (a + (5:ZMod 55)*(k:ZMod 55)) - a = (5:ZMod 55)*(k:ZMod 55) := by ring      rw [hsub, hd11]      have heq : (5:ZMod 55)*(k:ZMod 55)*(11*(m:ZMod 55)) = ((55:ℕ):ZMod 55) * ((k:ZMod 55)*(m:ZMod 55)) := by ring      rw [heq, ZMod.natCast_self 55, zero_mul]    have hdisj : Disjoint (good_slopes_point_directions 55 S) T := by      rw [Finset.disjoint_left]      intro x hx hxt      exact hTbad x hxt hx    have hunion_card : (good_slopes_point_directions 55 S ∪ T).card        = (good_slopes_point_directions 55 S).card + T.card :=      (Finset.card_union_eq_card_add_card).mpr hdisj    have hle : (good_slopes_point_directions 55 S ∪ T).card ≤ 40 := by      rw [← hUcard]      exact Finset.card_le_card (Finset.union_subset hgoodU hTsub)    omega
See it in the graphDiscuss this resultChallenge it