l3lab/ntp-mathlib huggingface dataset:
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    

Proof state:
case refine'_3
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
h : List.drop (↑n) (List.take (↑m) x) = []
hlen' : min (↑m) (List.length x) - ↑n = 0
⊢ False

Next tactic:
rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
    · 

Proof state:
case refine'_3
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
h : List.drop (↑n) (List.take (↑m) x) = []
hlen' : ↑m ≤ ↑n
⊢ False

Next tactic:
apply hneq
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
    · apply hneq
      

Proof state:
case refine'_3
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
h : List.drop (↑n) (List.take (↑m) x) = []
hlen' : ↑m ≤ ↑n
⊢ n = m

Next tactic:
apply le_antisymm
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
    · apply hneq
      apply le_antisymm
      

Proof state:
case refine'_3.a
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
h : List.drop (↑n) (List.take (↑m) x) = []
hlen' : ↑m ≤ ↑n
⊢ n ≤ m
case refine'_3.a
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
h : List.drop (↑n) (List.take (↑m) x) = []
hlen' : ↑m ≤ ↑n
⊢ m ≤ n

Next tactic:
assumption'
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
    · apply hneq
      apply le_antisymm
      assumption'
    

Proof state:
case refine'_3
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
h : List.drop (↑n) (List.take (↑m) x) = []
hlen' : min (↑m) (List.length x) - ↑n = 0
⊢ ↑m ≤ List.length x

Next tactic:
exact hm.trans hlen
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
    · apply hneq
      apply le_antisymm
      assumption'
    exact hm.trans hlen
  

Proof state:
case refine'_4
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
⊢ evalFrom M (evalFrom M s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑n) (List.take (↑m) x)) =
      evalFrom M s (List.take (↑n) (List.take (↑m) x)) ∧
    evalFrom M (evalFrom M s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑m) x) = t

Next tactic:
have hq : M.evalFrom (M.evalFrom s ((x.take m).take n)) ((x.take m).drop n) =
      M.evalFrom s ((x.take m).take n) := by
    rw [List.take_take, min_eq_left hle, ← evalFrom_of_append, heq, ← min_eq_left hle, ←
      List.take_take, min_eq_left hle, List.take_append_drop]
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
    · apply hneq
      apply le_antisymm
      assumption'
    exact hm.trans hlen
  have hq : M.evalFrom (M.evalFrom s ((x.take m).take n)) ((x.take m).drop n) =
      M.evalFrom s ((x.take m).take n) := by
    

Proof state:
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
⊢ evalFrom M (evalFrom M s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑n) (List.take (↑m) x)) =
    evalFrom M s (List.take (↑n) (List.take (↑m) x))

Next tactic:
rw [List.take_take, min_eq_left hle, ← evalFrom_of_append, heq, ← min_eq_left hle, ←
      List.take_take, min_eq_left hle, List.take_append_drop]
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
    · apply hneq
      apply le_antisymm
      assumption'
    exact hm.trans hlen
  have hq : M.evalFrom (M.evalFrom s ((x.take m).take n)) ((x.take m).drop n) =
      M.evalFrom s ((x.take m).take n) := by
    rw [List.take_take, min_eq_left hle, ← evalFrom_of_append, heq, ← min_eq_left hle, ←
      List.take_take, min_eq_left hle, List.take_append_drop]
  

Proof state:
case refine'_4
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
hq :
  evalFrom M (evalFrom M s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑n) (List.take (↑m) x)) =
    evalFrom M s (List.take (↑n) (List.take (↑m) x))
⊢ evalFrom M (evalFrom M s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑n) (List.take (↑m) x)) =
      evalFrom M s (List.take (↑n) (List.take (↑m) x)) ∧
    evalFrom M (evalFrom M s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑m) x) = t

Next tactic:
use hq
theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t := by
  obtain ⟨n, m, hneq, heq⟩ :=
    Fintype.exists_ne_map_eq_of_card_lt
      (fun n : Fin (Fintype.card σ + 1) => M.evalFrom s (x.take n)) (by norm_num)
  wlog hle : (n : ℕ) ≤ m
  · exact this _ hlen hx _ _ hneq.symm heq.symm (le_of_not_le hle)
  have hm : (m : ℕ) ≤ Fintype.card σ := Fin.is_le m
  refine'
    ⟨M.evalFrom s ((x.take m).take n), (x.take m).take n, (x.take m).drop n, x.drop m, _, _, _, by
      rfl, _⟩
  · rw [List.take_append_drop, List.take_append_drop]
  · simp only [List.length_drop, List.length_take]
    rw [min_eq_left (hm.trans hlen), min_eq_left hle, add_tsub_cancel_of_le hle]
    exact hm
  · intro h
    have hlen' := congr_arg List.length h
    simp only [List.length_drop, List.length, List.length_take] at hlen'
    rw [min_eq_left, tsub_eq_zero_iff_le] at hlen'
    · apply hneq
      apply le_antisymm
      assumption'
    exact hm.trans hlen
  have hq : M.evalFrom (M.evalFrom s ((x.take m).take n)) ((x.take m).drop n) =
      M.evalFrom s ((x.take m).take n) := by
    rw [List.take_take, min_eq_left hle, ← evalFrom_of_append, heq, ← min_eq_left hle, ←
      List.take_take, min_eq_left hle, List.take_append_drop]
  use hq
  

Proof state:
case right
α✝ : Type u
σ✝ : Type v
M✝ : DFA α✝ σ✝
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ List.length x
hx : evalFrom M s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : evalFrom M s (List.take (↑n) x) = evalFrom M s (List.take (↑m) x)
hle : ↑n ≤ ↑m
hm : ↑m ≤ Fintype.card σ
hq :
  evalFrom M (evalFrom M s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑n) (List.take (↑m) x)) =
    evalFrom M s (List.take (↑n) (List.take (↑m) x))
⊢ evalFrom M (evalFrom M s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑m) x) = t

Next tactic:
rwa [← hq, ← evalFrom_of_append, ← evalFrom_of_append, ← List.append_assoc,
    List.take_append_drop, List.take_append_drop]
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  

Proof state:
α : Type u
σ : Type v
M : DFA α σ
x y : List α
s : σ
hx : evalFrom M s x = s
hy : y ∈ {x}∗
⊢ evalFrom M s y = s

Next tactic:
rw [Language.mem_kstar] at hy
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  

Proof state:
α : Type u
σ : Type v
M : DFA α σ
x y : List α
s : σ
hx : evalFrom M s x = s
hy : ∃ L, y = List.join L ∧ ∀ y ∈ L, y ∈ {x}
⊢ evalFrom M s y = s

Next tactic:
rcases hy with ⟨S, rfl, hS⟩
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  rcases hy with ⟨S, rfl, hS⟩
  

Proof state:
case intro.intro
α : Type u
σ : Type v
M : DFA α σ
x : List α
s : σ
hx : evalFrom M s x = s
S : List (List α)
hS : ∀ y ∈ S, y ∈ {x}
⊢ evalFrom M s (List.join S) = s

Next tactic:
induction' S with a S ih
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  rcases hy with ⟨S, rfl, hS⟩
  induction' S with a S ih
  · 

Proof state:
case intro.intro.nil
α : Type u
σ : Type v
M : DFA α σ
x : List α
s : σ
hx : evalFrom M s x = s
hS : ∀ y ∈ [], y ∈ {x}
⊢ evalFrom M s (List.join []) = s

Next tactic:
rfl
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  rcases hy with ⟨S, rfl, hS⟩
  induction' S with a S ih
  · rfl
  · 

Proof state:
case intro.intro.cons
α : Type u
σ : Type v
M : DFA α σ
x : List α
s : σ
hx : evalFrom M s x = s
a : List α
S : List (List α)
ih : (∀ y ∈ S, y ∈ {x}) → evalFrom M s (List.join S) = s
hS : ∀ y ∈ a :: S, y ∈ {x}
⊢ evalFrom M s (List.join (a :: S)) = s

Next tactic:
have ha := hS a (List.mem_cons_self _ _)
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  rcases hy with ⟨S, rfl, hS⟩
  induction' S with a S ih
  · rfl
  · have ha := hS a (List.mem_cons_self _ _)
    

Proof state:
case intro.intro.cons
α : Type u
σ : Type v
M : DFA α σ
x : List α
s : σ
hx : evalFrom M s x = s
a : List α
S : List (List α)
ih : (∀ y ∈ S, y ∈ {x}) → evalFrom M s (List.join S) = s
hS : ∀ y ∈ a :: S, y ∈ {x}
ha : a ∈ {x}
⊢ evalFrom M s (List.join (a :: S)) = s

Next tactic:
rw [Set.mem_singleton_iff] at ha
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  rcases hy with ⟨S, rfl, hS⟩
  induction' S with a S ih
  · rfl
  · have ha := hS a (List.mem_cons_self _ _)
    rw [Set.mem_singleton_iff] at ha
    

Proof state:
case intro.intro.cons
α : Type u
σ : Type v
M : DFA α σ
x : List α
s : σ
hx : evalFrom M s x = s
a : List α
S : List (List α)
ih : (∀ y ∈ S, y ∈ {x}) → evalFrom M s (List.join S) = s
hS : ∀ y ∈ a :: S, y ∈ {x}
ha : a = x
⊢ evalFrom M s (List.join (a :: S)) = s

Next tactic:
rw [List.join, evalFrom_of_append, ha, hx]
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  rcases hy with ⟨S, rfl, hS⟩
  induction' S with a S ih
  · rfl
  · have ha := hS a (List.mem_cons_self _ _)
    rw [Set.mem_singleton_iff] at ha
    rw [List.join, evalFrom_of_append, ha, hx]
    

Proof state:
case intro.intro.cons
α : Type u
σ : Type v
M : DFA α σ
x : List α
s : σ
hx : evalFrom M s x = s
a : List α
S : List (List α)
ih : (∀ y ∈ S, y ∈ {x}) → evalFrom M s (List.join S) = s
hS : ∀ y ∈ a :: S, y ∈ {x}
ha : a = x
⊢ evalFrom M s (List.join S) = s

Next tactic:
apply ih
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  rcases hy with ⟨S, rfl, hS⟩
  induction' S with a S ih
  · rfl
  · have ha := hS a (List.mem_cons_self _ _)
    rw [Set.mem_singleton_iff] at ha
    rw [List.join, evalFrom_of_append, ha, hx]
    apply ih
    

Proof state:
case intro.intro.cons
α : Type u
σ : Type v
M : DFA α σ
x : List α
s : σ
hx : evalFrom M s x = s
a : List α
S : List (List α)
ih : (∀ y ∈ S, y ∈ {x}) → evalFrom M s (List.join S) = s
hS : ∀ y ∈ a :: S, y ∈ {x}
ha : a = x
⊢ ∀ y ∈ S, y ∈ {x}

Next tactic:
intro z hz
theorem evalFrom_of_pow {x y : List α} {s : σ} (hx : M.evalFrom s x = s)
    (hy : y ∈ ({x} : Language α)∗) : M.evalFrom s y = s := by
  rw [Language.mem_kstar] at hy
  rcases hy with ⟨S, rfl, hS⟩
  induction' S with a S ih
  · rfl
  · have ha := hS a (List.mem_cons_self _ _)
    rw [Set.mem_singleton_iff] at ha
    rw [List.join, evalFrom_of_append, ha, hx]
    apply ih
    intro z hz
    

Proof state:
case intro.intro.cons
α : Type u
σ : Type v
M : DFA α σ
x : List α
s : σ
hx : evalFrom M s x = s
a : List α
S : List (List α)
ih : (∀ y ∈ S, y ∈ {x}) → evalFrom M s (List.join S) = s
hS : ∀ y ∈ a :: S, y ∈ {x}
ha : a = x
z : List α
hz : z ∈ S
⊢ z ∈ {x}

Next tactic:
exact hS z (List.mem_cons_of_mem a hz)
theorem pumping_lemma [Fintype σ] {x : List α} (hx : x ∈ M.accepts)
    (hlen : Fintype.card σ ≤ List.length x) :
    ∃ a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧ b ≠ [] ∧ {a} * {b}∗ * {c} ≤ M.accepts := by
  

Proof state:
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
hx : x ∈ accepts M
hlen : Fintype.card σ ≤ List.length x
⊢ ∃ a b c, x = a ++ b ++ c ∧ List.length a + List.length b ≤ Fintype.card σ ∧ b ≠ [] ∧ {a} * {b}∗ * {c} ≤ accepts M

Next tactic:
obtain ⟨_, a, b, c, hx, hlen, hnil, rfl, hb, hc⟩ := M.evalFrom_split hlen rfl
theorem pumping_lemma [Fintype σ] {x : List α} (hx : x ∈ M.accepts)
    (hlen : Fintype.card σ ≤ List.length x) :
    ∃ a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧ b ≠ [] ∧ {a} * {b}∗ * {c} ≤ M.accepts := by
  obtain ⟨_, a, b, c, hx, hlen, hnil, rfl, hb, hc⟩ := M.evalFrom_split hlen rfl
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
hx✝ : x ∈ accepts M
hlen✝ : Fintype.card σ ≤ List.length x
a b c : List α
hx : x = a ++ b ++ c
hlen : List.length a + List.length b ≤ Fintype.card σ
hnil : b ≠ []
hb : evalFrom M (evalFrom M ?m.8429 a) b = evalFrom M ?m.8429 a
hc : evalFrom M (evalFrom M ?m.8429 a) c = evalFrom M ?m.8429 x
⊢ ∃ a b c, x = a ++ b ++ c ∧ List.length a + List.length b ≤ Fintype.card σ ∧ b ≠ [] ∧ {a} * {b}∗ * {c} ≤ accepts M

Next tactic:
use a, b, c, hx, hlen, hnil
theorem pumping_lemma [Fintype σ] {x : List α} (hx : x ∈ M.accepts)
    (hlen : Fintype.card σ ≤ List.length x) :
    ∃ a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧ b ≠ [] ∧ {a} * {b}∗ * {c} ≤ M.accepts := by
  obtain ⟨_, a, b, c, hx, hlen, hnil, rfl, hb, hc⟩ := M.evalFrom_split hlen rfl
  use a, b, c, hx, hlen, hnil
  

Proof state:
case right
α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
hx✝ : x ∈ accepts M
hlen✝ : Fintype.card σ ≤ List.length x
a b c : List α
hx : x = a ++ b ++ c
hlen : List.length a + List.length b ≤ Fintype.card σ
hnil : b ≠ []
hb : evalFrom M (evalFrom M ?m.8429 a) b = evalFrom M ?m.8429 a
hc : evalFrom M (evalFrom M ?m.8429 a) c = evalFrom M ?m.8429 x
⊢ {a} * {b}∗ * {c} ≤ accepts M

Next tactic:
intro y hy