Da concat ptr2 exists
Automata.da_concat_ptr2_exists
Project documentation
The copy i of M2 being asserted to exist by this theorem is activated at step n and persists ever after. But i may not stay constant over time.
Exact Lean statement
theorem da_concat_ptr2_exists (as : Stream' A) (n : ℕ) (h_n : M1.DetRun as n ∈ acc1) (k : ℕ) :
∃ i, ((M1.Concat acc1 M2).DetRun as (n + k + 1)).2 i = some (M2.DetRun (as.drop n) (k + 1)) ∧
if k = 0 then
((M1.Concat acc1 M2).DetRun as (n + k)).2 i = none ∧
∀ j < i, (((M1.Concat acc1 M2).DetRun as (n + k)).2 j).isSome
else
((M1.Concat acc1 M2).DetRun as (n + k)).2 i = some (M2.DetRun (as.drop n) k) ∧
∀ j < i, ((M1.Concat acc1 M2).DetRun as (n + k)).2 j ≠ ((M1.Concat acc1 M2).DetRun as (n + k)).2 iFormal artifact
Lean source
theorem da_concat_ptr2_exists (as : Stream' A) (n : ℕ) (h_n : M1.DetRun as n ∈ acc1) (k : ℕ) : ∃ i, ((M1.Concat acc1 M2).DetRun as (n + k + 1)).2 i = some (M2.DetRun (as.drop n) (k + 1)) ∧ if k = 0 then ((M1.Concat acc1 M2).DetRun as (n + k)).2 i = none ∧ ∀ j < i, (((M1.Concat acc1 M2).DetRun as (n + k)).2 j).isSome else ((M1.Concat acc1 M2).DetRun as (n + k)).2 i = some (M2.DetRun (as.drop n) k) ∧ ∀ j < i, ((M1.Concat acc1 M2).DetRun as (n + k)).2 j ≠ ((M1.Concat acc1 M2).DetRun as (n + k)).2 i := by induction' k with k h_ind . let I := {i | ((M1.Concat acc1 M2).DetRun as n).2 i = none} have h_fin : I.Finite := by exact toFinite I have h_ne : I.Nonempty := by exact da_concat_det_run_cnt2 M1 acc1 M2 as n obtain ⟨i, h_i, h_min⟩ := Finite.exists_minimal h_fin h_ne simp [I] at h_i h_min use i simp [h_i, DA.DetRun, da_concat_next_2, da_concat_det_run_1, h_n, get_drop', ← ne_none_iff_isSome] intro j h_j h_contra ; have := h_min h_contra ; fin_omega obtain ⟨i, h_i, _⟩ := h_ind let I := {j | ((M1.Concat acc1 M2).DetRun as (n + k + 1)).2 j = some (M2.DetRun (as.drop n) (k + 1))} have h_fin : I.Finite := by exact toFinite I have h_ne : I.Nonempty := by use i ; simp [I, h_i] obtain ⟨j, h_j, h_min⟩ := Finite.exists_minimal h_fin h_ne simp [I] at h_j h_min use j simp [h_j, ← add_assoc] rw [DA.DetRun] simp [da_concat_next_2, h_j] have h_min' : ∀ j' < j, ¬((M1.Concat acc1 M2).DetRun as (n + k + 1)).2 j' = some (M2.DetRun (as.drop n) (k + 1)) := by intro j' h_j' h_contra ; have := h_min h_contra ; fin_omega constructorm* _ ∧ _ · grind · simp [DA.DetRun, get_drop', (show n + (k + 1) = n + k + 1 by omega)] · grind- Project
- Automata Theory
- License
- Apache-2.0
- Commit
- f196548710ce
- Source
- AutomataTheory/Automata/DetConcat.lean:153-185
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Acc lang congr
acc_lang_congr
Plain-language statement
The language accepted by c.toDA with a unique accepting state s is exactly the equivalence class of s.
Source project: Automata Theory
Person-level attribution pending.
Acc lang concat e
Automata.acc_lang_concat_e
Plain-language statement
The language of the concatenation NA that is accepted by M0's accepting states is the language accepted by M0.
Source project: Automata Theory
Person-level attribution pending.
Acc lang concat ne
Automata.acc_lang_concat_ne
Plain-language statement
The language of the concatenation NA that is accepted by M1's accepting states is the language accepted by M0 concatenated with the language accepted by M1 minus the empty word.
Source project: Automata Theory
Person-level attribution pending.