@@ -12,6 +12,7 @@ public import Mathlib.ModelTheory.Definability
1212import Mathlib.Algebra.GCDMonoid.Finset
1313import Mathlib.Algebra.GCDMonoid.Nat
1414import Mathlib.Algebra.Group.Submonoid.Finsupp
15+ import Mathlib.LinearAlgebra.Dimension.Basic
1516import Mathlib.LinearAlgebra.Matrix.Notation
1617
1718/-!
@@ -166,27 +167,12 @@ theorem definable₁_iff_ultimately_periodic {s : Set ℕ} :
166167 apply hS at ht
167168 rw [isProperLinearSet_iff] at ht
168169 rcases ht with ⟨a, t, ht, rfl⟩
169- have hcard : t.card ≤ 1 := by
170- by_contra hcard
171- simp only [not_le, Finset.one_lt_card_iff] at hcard
172- rcases hcard with ⟨a, b, ha, hb, hab⟩
173- have hb' : b ≠ 0 := by
174- intro hb'
175- apply ht.zero_notMem_image
176- simp [← hb', hb]
177- revert ht
178- simp only [imp_false, not_linearIndepOn_finset_iffₛ, id_eq]
179- refine ⟨Pi.single a b, Pi.single b a, ?_, a, ha, ?_⟩
180- · simpa [Pi.single_apply, ha, hb] using mul_comm b a
181- · simp [hab, hb']
170+ have hcard : t.card ≤ 1 := by simpa [CommSemiring.rank_self] using ht.cardinal_le_rank
182171 simp_rw [Finset.card_le_one_iff_subset_singleton, Finset.subset_singleton_iff] at hcard
183172 rcases hcard with ⟨b, (rfl | rfl)⟩
184173 · refine ⟨a + 1 , 1 , zero_lt_one, fun x hx => ?_⟩
185174 simp [(Nat.lt_of_succ_le hx).ne', (Nat.lt_of_succ_le (Nat.le_succ_of_le hx)).ne']
186- · have hb : b ≠ 0 := by
187- intro hb
188- apply ht.zero_notMem_image
189- simp [hb]
175+ · have hb : b ≠ 0 := by simpa [ne_comm] using ht.zero_notMem_image
190176 rw [Nat.ne_zero_iff_zero_lt] at hb
191177 refine ⟨a, b, hb, fun x hx => ?_⟩
192178 simp only [Finset.coe_singleton, mem_vadd_set, SetLike.mem_coe,
0 commit comments