Skip to content

Commit f1ea3d5

Browse files
committed
Fix grind failures in Automata/NA/Concat.lean
1 parent 65f8b27 commit f1ea3d5

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

Cslib/Computability/Automata/NA/Concat.lean

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,22 +159,31 @@ theorem finConcat_language_eq [Inhabited Symbol] :
159159
obtain ⟨xs, ss, h_ωtr, rfl, rfl⟩ := LTS.Total.extend_omegaExecution h_mtr
160160
have hc : (finConcat na1 na2).Run (xl ++ω xs) ss := by grind [Run]
161161
have hr : (ss xl.length).isRight := by grind
162-
obtain ⟨n, _⟩ := concat_run_proj hc hr
162+
obtain ⟨n, _, _, ss2, h_run2, _⟩ := concat_run_proj hc hr
163163
refine ⟨xl.take n, ?_, xl.drop n, ?_, ?_⟩
164164
· grind [totalize_language_eq, take_append_of_le_length]
165165
· have : ss xl.length = (ss.drop n) (xl.length - n) := by grind
166-
grind [drop_append_of_le_length, take_append_of_le_length, totalize_run_mtr]
166+
#adaptation_note
167+
/-- A grind regression found moving to nightly-2026-03-31 (changes from lean#13166) -/
168+
have : ss xl.length = inr (ss2 (xl.length - n)) := by grind
169+
have hl : (ss2 (xl.length - n)).isLeft := by grind
170+
obtain ⟨s2, t2, h_mtr2, _, _, _⟩ := totalize_run_mtr h_run2 hl
171+
refine ⟨s2, ?_, t2, ?_, ?_⟩ <;> grind [drop_append_of_le_length, take_append_of_le_length]
167172
· exact xl.take_append_drop n
168173
· rintro ⟨xl1, h_xl1, xl2, h_xl2, rfl⟩
169174
rw [← totalize_language_eq] at h_xl1
170175
obtain ⟨_, h_s2, _, _, h_mtr2⟩ := h_xl2
171-
obtain ⟨_, _, h_run2, _, _⟩ := totalize_mtr_run h_s2 h_mtr2
176+
obtain ⟨_, ss2, h_run2, _, _⟩ := totalize_mtr_run h_s2 h_mtr2
172177
obtain ⟨ss, ⟨_, h_ωtr⟩, _⟩ := concat_run_exists h_xl1 h_run2
173-
grind [
174-
finConcat, List.length_append, take_append_of_le_length,
175-
extract_eq_drop_take, =_ append_append_ωSequence, get_drop xl2.length xl1.length ss,
176-
LTS.OmegaExecution.extract_mTr h_ωtr (zero_le (xl1.length + xl2.length))
177-
]
178+
#adaptation_note
179+
/-- A grind regression found moving to nightly-2026-03-31 (changes from lean#13166) -/
180+
have h_mtr := LTS.OmegaExecution.extract_mTr h_ωtr (zero_le (xl1.length + xl2.length))
181+
simp [← append_append_ωSequence, extract_eq_drop_take,
182+
take_append_of_le_length, ← List.length_append] at h_mtr
183+
have : ss (xl1.length + xl2.length) = (ss.drop xl1.length) xl2.length := by grind
184+
have : ss (xl1.length + xl2.length) = inr (ss2 xl2.length) := by grind
185+
refine ⟨ss 0, ?_, ss (xl1.length + xl2.length), ?_, ?_⟩ <;>
186+
grind [finConcat, List.length_append]
178187

179188
end FinAcc
180189

0 commit comments

Comments
 (0)