chars
int64
40
24k
content_type
stringclasses
9 values
id
stringlengths
13
64
source
stringclasses
5 values
subset
stringclasses
31 values
text
stringlengths
40
24k
162
leanexplore_declaration
leanexplore:386602
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem LTS.mem_pairLang {lts : LTS State Symbol} {s t : State} {xs : List Symbol} : xs ∈ lts.pairLang s t ↔ lts.MTr s xs t := Iff.rfl
326
leanexplore_declaration
leanexplore:386603
leanexplore_sqlite
leanexplore_declarations
/-- `LTS.pairLang s t` is a regular language if there are only finitely many states. -/ @[simp] theorem LTS.pairLang_regular [Finite State] {lts : LTS State Symbol} {s t : State} : (lts.pairLang s t).IsRegular := by rw [IsRegular.iff_nfa] use State, inferInstance, (NA.FinAcc.mk ⟨lts, {s}⟩ {t}) ext simp +ins...
283
leanexplore_declaration
leanexplore:386604
leanexplore_sqlite
leanexplore_declarations
/-- `LTS.pairViaLang via s t` is the language of finite words that can take the LTS from state `s` to state `t` via a state in `via`. -/ def LTS.pairViaLang (lts : LTS State Symbol) (via : Set State) (s t : State) : Language Symbol := ⨆ r ∈ via, lts.pairLang s r * lts.pairLang r t
293
leanexplore_declaration
leanexplore:386605
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem LTS.mem_pairViaLang {lts : LTS State Symbol} {via : Set State} {s t : State} {xs : List Symbol} : xs ∈ lts.pairViaLang via s t ↔ ∃ r ∈ via, ∃ xs1 xs2, lts.MTr s xs1 r ∧ lts.MTr r xs2 t ∧ xs1 ++ xs2 = xs := by simp [LTS.pairViaLang, Language.mem_mul]
351
leanexplore_declaration
leanexplore:386606
leanexplore_sqlite
leanexplore_declarations
/-- `LTS.pairViaLang via s t` is a regular language if there are only finitely many states. -/ @[simp] theorem LTS.pairViaLang_regular [Inhabited Symbol] [Finite State] {lts : LTS State Symbol} {via : Set State} {s t : State} : (lts.pairViaLang via s t).IsRegular := by apply IsRegular.iSup grind [Language.IsReg...
233
leanexplore_declaration
leanexplore:386607
leanexplore_sqlite
leanexplore_declarations
theorem LTS.pairLang_append {lts : LTS State Symbol} {s0 s1 s2 : State} {xs1 xs2 : List Symbol} (h1 : xs1 ∈ lts.pairLang s0 s1) (h2 : xs2 ∈ lts.pairLang s1 s2) : xs1 ++ xs2 ∈ lts.pairLang s0 s2 := by grind [<= LTS.MTr.comp]
280
leanexplore_declaration
leanexplore:386608
leanexplore_sqlite
leanexplore_declarations
theorem LTS.pairLang_split {lts : LTS State Symbol} {s0 s2 : State} {xs1 xs2 : List Symbol} (h : xs1 ++ xs2 ∈ lts.pairLang s0 s2) : ∃ s1, xs1 ∈ lts.pairLang s0 s1 ∧ xs2 ∈ lts.pairLang s1 s2 := by obtain ⟨r, _, _⟩ := LTS.MTr.split <| LTS.mem_pairLang.mp h use r grind
383
leanexplore_declaration
leanexplore:386609
leanexplore_sqlite
leanexplore_declarations
theorem LTS.pairViaLang_append_pairLang {lts : LTS State Symbol} {s0 s1 s2 : State} {xs1 xs2 : List Symbol} {via : Set State} (h1 : xs1 ∈ lts.pairViaLang via s0 s1) (h2 : xs2 ∈ lts.pairLang s1 s2) : xs1 ++ xs2 ∈ lts.pairViaLang via s0 s2 := by obtain ⟨r, _, _, _, _, _, rfl⟩ := LTS.mem_pairViaLang.mp h1 ...
281
leanexplore_declaration
leanexplore:386610
leanexplore_sqlite
leanexplore_declarations
theorem LTS.pairLang_append_pairViaLang {lts : LTS State Symbol} {s0 s1 s2 : State} {xs1 xs2 : List Symbol} {via : Set State} (h1 : xs1 ∈ lts.pairLang s0 s1) (h2 : xs2 ∈ lts.pairViaLang via s1 s2) : xs1 ++ xs2 ∈ lts.pairViaLang via s0 s2 := by grind [<= LTS.MTr.comp]
597
leanexplore_declaration
leanexplore:386611
leanexplore_sqlite
leanexplore_declarations
theorem LTS.pairViaLang_split {lts : LTS State Symbol} {s0 s2 : State} {xs1 xs2 : List Symbol} {via : Set State} (h : xs1 ++ xs2 ∈ lts.pairViaLang via s0 s2) : ∃ s1, xs1 ∈ lts.pairViaLang via s0 s1 ∧ xs2 ∈ lts.pairLang s1 s2 ∨ xs1 ∈ lts.pairLang s0 s1 ∧ xs2 ∈ lts.pairViaLang via s1 s2 := by obtain ⟨...
2,062
leanexplore_declaration
leanexplore:386612
leanexplore_sqlite
leanexplore_declarations
/-- The ω-language accepted by a finite-state Büchi automaton is the finite union of ω-languages of the form `L * M^ω`, where all `L`s and `M`s are regular languages. -/ theorem language_eq_fin_iSup_hmul_omegaPow [Inhabited Symbol] [Finite State] (na : Buchi State Symbol) : language na = ⨆ s ∈ na.start, ⨆ t ∈ n...
249
leanexplore_declaration
leanexplore:386613
leanexplore_sqlite
leanexplore_declarations
/-- The product of an indexed family of nondeterministic automata. -/ @[scoped grind =] def iProd (na : (i : I) → NA (State i) Symbol) : NA (Π i, State i) Symbol where Tr s x t := ∀ i, (na i).Tr (s i) x (t i) start := ⋂ i, (· i) ⁻¹' (na i).start
543
leanexplore_declaration
leanexplore:386614
leanexplore_sqlite
leanexplore_declarations
/-- Every run of the product automaton projects onto runs of its component automata, and vice versa. -/ @[simp, scoped grind =] theorem iProd_run_iff {na : (i : I) → NA (State i) Symbol} {xs : ωSequence Symbol} {ss : ωSequence (Π i, State i)} : (iProd na).Run xs ss ↔ ∀ i, (na i).Run xs (ss.map (· i)) := by rw...
282
leanexplore_declaration
leanexplore:386615
leanexplore_sqlite
leanexplore_declarations
/-- The sum of an indexed family of nondeterministic automata. -/ @[scoped grind =] def iSum (na : (i : I) → NA (State i) Symbol) : NA (Σ i, State i) Symbol where start := ⋃ i, Sigma.mk i '' (na i).start Tr s x t := ∃ i s_i t_i, (na i).Tr s_i x t_i ∧ ⟨i, s_i⟩ = s ∧ ⟨i, t_i⟩ = t
948
leanexplore_declaration
leanexplore:386616
leanexplore_sqlite
leanexplore_declarations
/-- An infinite run of the sum automaton is an infinite run of one of its component automata. -/ @[simp, scoped grind =] theorem iSum_run_iff {na : (i : I) → NA (State i) Symbol} {xs : ωSequence Symbol} {ss : ωSequence (Σ i, State i)} : (iSum na).Run xs ss ↔ ∃ i ss_i, (na i).Run xs ss_i ∧ ss_i.map (Sigma.mk i) ...
673
leanexplore_declaration
leanexplore:386617
leanexplore_sqlite
leanexplore_declarations
/-- The ω-language accepted by the Buchi sum automata is the union of the ω-languages accepted by its component automata. -/ @[simp] theorem iSum_language_eq {na : (i : I) → NA (State i) Symbol} {acc : (i : I) → Set (State i)} : language (Buchi.mk (iSum na) (⋃ i, Sigma.mk i '' (acc i))) = ⋃ i, language (Buchi.m...
179
leanexplore_declaration
leanexplore:386618
leanexplore_sqlite
leanexplore_declarations
/-- Converts an `NA` into a `DA` using the subset construction. -/ @[scoped grind =] def toDA (a : NA State Symbol) : DA (Set State) Symbol := { a.toFLTS with start := a.start }
234
leanexplore_declaration
leanexplore:386619
leanexplore_sqlite
leanexplore_declarations
/-- Converts an `NA.FinAcc` into a `DA.FinAcc` using the subset construction. -/ @[scoped grind =] def toDAFinAcc (a : NA.FinAcc State Symbol) : DA.FinAcc (Set State) Symbol := { a.toDA with accept := { S | ∃ s ∈ S, s ∈ a.accept } }
326
leanexplore_declaration
leanexplore:386620
leanexplore_sqlite
leanexplore_declarations
/-- The `DA` constructed from an `NA` has the same language. -/ @[scoped grind _=_] theorem toDAFinAcc_language_eq {na : NA.FinAcc State Symbol} : language na.toDAFinAcc = language na := by ext xs #adaptation_note /-- A grind regression found moving to nightly-2026-03-31 (changes from lean#13166) -/ grind [Ac...
275
leanexplore_declaration
leanexplore:386621
leanexplore_sqlite
leanexplore_declarations
/-- `NA.totalize` makes the original NA total by replacing its LTS with `LTS.totalize` and its starting states with their lifted non-sink versions. -/ def totalize (na : NA State Symbol) : NA (State ⊕ Unit) Symbol where toLTS := na.toLTS.totalize start := inl '' na.start
706
leanexplore_declaration
leanexplore:386622
leanexplore_sqlite
leanexplore_declarations
/-- In an infinite execution of `NA.totalize`, as long as the NA stays in a non-sink state, the execution so far corresponds to a finite execution of the original NA. -/ theorem totalize_run_mtr {xs : ωSequence Symbol} {ss : ωSequence (State ⊕ Unit)} {n : ℕ} (h : na.totalize.Run xs ss) (hl : (ss n).isLeft) : ∃ ...
454
leanexplore_declaration
leanexplore:386623
leanexplore_sqlite
leanexplore_declarations
/-- Any finite execution of the original NA can be extended to an infinite execution of `NA.totalize`, provided that the alphabet is inbabited. -/ theorem totalize_mtr_run [Inhabited Symbol] {xl : List Symbol} {s t : State} (hs : s ∈ na.start) (hm : na.MTr s xl t) : ∃ xs ss, na.totalize.Run (xl ++ω xs) ss ∧ ss ...
322
leanexplore_declaration
leanexplore:386624
leanexplore_sqlite
leanexplore_declarations
/-- `NA.totalize` and the original NA accept the same language of finite words, as long as the accepting states are also lifted in the obvious way. -/ theorem totalize_language_eq {na : FinAcc State Symbol} : language (FinAcc.mk na.totalize (inl '' na.accept)) = language na := by ext xl simp +instances [totaliz...
925
leanexplore_declaration
leanexplore:386625
leanexplore_sqlite
leanexplore_declarations
/-- Given a Buchi automaton `na`, two finite words `u` and `v` are Buchi-congruent according to `na` iff for every pair of states `s` and `t` of `na`, both of the following two conditions hold: (1) `u` can move `na` from `s` to `t` iff `v` can move `na` from `s` to `t`; (2) `u` can move `na` from `s` to `t` via an acce...
462
leanexplore_declaration
leanexplore:386626
leanexplore_sqlite
leanexplore_declarations
/-- `BuchiCongrParam` is a parameterization of the equivalence classes of `na.BuchiCongruence` using the type `State → State → Prop × Prop`, which is finite if `State` is. -/ noncomputable def BuchiCongrParam (na : Buchi State Symbol) (f : State → State → Prop × Prop) : Quotient na.BuchiCongruence.eq := if h : ∃ ...
467
leanexplore_declaration
leanexplore:386627
leanexplore_sqlite
leanexplore_declarations
/-- `BuchiCongrParam` is surjective. -/ lemma buchiCongrParam_surjective : Surjective na.BuchiCongrParam := by intro q let f s t := (q.out ∈ na.pairLang s t, q.out ∈ na.pairViaLang na.accept s t) have h : ∃ u, ∀ s t, ((f s t).1 ↔ u ∈ na.pairLang s t) ∧ ((f s t).2 ↔ u ∈ na.pairViaLang na.accept s t) := by ...
248
leanexplore_declaration
leanexplore:386628
leanexplore_sqlite
leanexplore_declarations
/-- `na.BuchiCongruence` is of finite index if `na` has only finitely many states. -/ theorem buchiCongruence_fin_index [Finite State] : Finite (Quotient na.BuchiCongruence.eq) := Finite.of_surjective na.BuchiCongrParam buchiCongrParam_surjective
1,106
leanexplore_declaration
leanexplore:386629
leanexplore_sqlite
leanexplore_declarations
/-- If `xl` and `yl` belong to the same equivalence class of `na.BuchiCongruence` and `xl` can move `na` from state `s` to state `t`, then so can `yl` and, furthermore, if `xl` makes `na` go through an accepting state of `na`, then so can `yl`. -/ lemma buchiCongruence_transfer {a : Quotient na.BuchiCongruence.eq} ...
441
leanexplore_declaration
leanexplore:386630
leanexplore_sqlite
leanexplore_declarations
/-- `na.buchiFamily` is a family of ω-languages indexed by a pair of equivalence classes of `na.BuchiCongruence` which will turn out to saturate the ω-language accepted by `na` and cover all possible ω-sequences. -/ def buchiFamily [Inhabited Symbol] (na : Buchi State Symbol) : Quotient na.BuchiCongruence.eq × Quot...
331
leanexplore_declaration
leanexplore:386631
leanexplore_sqlite
leanexplore_declarations
theorem mem_buchiFamily [Inhabited Symbol] {xs : ωSequence Symbol} {a b : Quotient na.BuchiCongruence.eq} : xs ∈ na.buchiFamily (a, b) ↔ ∃ xl, ∃ xls : ωSequence (List Symbol), xl ∈ na.BuchiCongruence.eqvCls a ∧ (∀ k, xls k ∈ na.BuchiCongruence.eqvCls b - 1) ∧ xl ++ω xls.flatten = xs := by grind [b...
1,529
leanexplore_declaration
leanexplore:386632
leanexplore_sqlite
leanexplore_declarations
/-- `na.buchiFamily` is a cover if `na` has only finitely many states. This theorem uses the Ramsey theorem for infinite graphs and does not depend on any details of `na.BuchiCongruence` other than that it is of finite index. -/ theorem buchiFamily_cover [Inhabited Symbol] [Finite State] : ⨆ i, na.buchiFamily i = ⊤...
2,624
leanexplore_declaration
leanexplore:386633
leanexplore_sqlite
leanexplore_declarations
/-- `na.buchiFamily` saturates the ω-language accepted by `na`. -/ theorem buchiFamily_saturation [Inhabited Symbol] : Saturates na.buchiFamily (language na) := by rintro ⟨a, b⟩ ⟨xs, h_xs, h_lang⟩ ys h_ys obtain ⟨xl, xls, h_xl_c, h_xls_c, rfl⟩ := mem_buchiFamily.mp h_xs obtain ⟨yl, yls, h_yl_c, h_yls_c, rfl⟩ := m...
378
leanexplore_declaration
leanexplore:386634
leanexplore_sqlite
leanexplore_declarations
/-- A right congruence is an equivalence relation on finite sequences (represented by lists) that is preserved by concatenation on the right. The equivalence relation is represented by a setoid to to enable ready access to the quotient construction. -/ class RightCongruence (α : Type*) extends eq : Setoid (List α) whe...
197
leanexplore_declaration
leanexplore:386635
leanexplore_sqlite
leanexplore_declarations
/-- The equivalence class (as a language) corresponding to an element of the quotient type. -/ abbrev eqvCls [c : RightCongruence α] (a : Quotient c.eq) : Language α := (Quotient.mk c.eq) ⁻¹' {a}
196
leanexplore_declaration
leanexplore:386636
leanexplore_sqlite
leanexplore_declarations
/-- A sequence `xs` is in `eventually_zero` iff `xs k = 0` for all large `k`. -/ @[scoped grind =] def eventually_zero : ωLanguage (Fin 2) := { xs : ωSequence (Fin 2) | ∀ᶠ k in atTop, xs k = 0 }
312
leanexplore_declaration
leanexplore:386637
leanexplore_sqlite
leanexplore_declarations
/-- `eventually_zero` is accepted by a 2-state nondeterministic Buchi automaton. -/ @[scoped grind =] def eventually_zero_na : NA.Buchi (Fin 2) (Fin 2) where -- Once state 1 is reached, only symbol 0 is accepted and the next state is still 1 Tr s x s' := s = 1 → x = 0 ∧ s' = 1 start := {0} accept := {1}
727
leanexplore_declaration
leanexplore:386638
leanexplore_sqlite
leanexplore_declarations
theorem eventually_zero_accepted_by_na_buchi : language eventually_zero_na = eventually_zero := by ext xs; unfold eventually_zero_na; constructor · rintro ⟨ss, h_run, h_acc⟩ obtain ⟨m, h_m⟩ := Frequently.exists h_acc apply eventually_atTop.mpr use m; intro n h_n obtain ⟨k, rfl⟩ := Nat.exists_eq_...
1,017
leanexplore_declaration
leanexplore:386639
leanexplore_sqlite
leanexplore_declarations
theorem eventually_zero_not_omegaLim : ¬ ∃ l : Language (Fin 2), l↗ω = eventually_zero := by rintro ⟨l, h⟩ let ls := ωSequence.mk (oneSegs h) have h_segs := oneSegs_lemma h have h_pos : ∀ k, (ls k).length > 0 := by grind have h_ev : ls.flatten ∈ eventually_zero := by rw [← h, mem_omegaLim, frequently_...
144
leanexplore_declaration
leanexplore:386640
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem mem_biInf {I : Type*} (s : Set I) (l : I → Language α) (x : List α) : (x ∈ ⨅ i ∈ s, l i) ↔ ∀ i ∈ s, x ∈ l i := mem_iInter₂
217
leanexplore_declaration
leanexplore:386641
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem mem_biSup {I : Type*} (s : Set I) (l : I → Language α) (x : List α) : (x ∈ ⨆ i ∈ s, l i) ↔ ∃ i ∈ s, x ∈ l i where mp h := bex_def.mp (mem_iUnion₂.mp h) mpr h := mem_iUnion₂.mpr (bex_def.mpr h)
74
leanexplore_declaration
leanexplore:386642
leanexplore_sqlite
leanexplore_declarations
theorem le_one_iff_eq : l ≤ 1 ↔ l = 0 ∨ l = 1 := subset_singleton_iff_eq
100
leanexplore_declaration
leanexplore:386643
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem mem_sub_one (x : List α) : x ∈ (l - 1) ↔ x ∈ l ∧ x ≠ [] := Iff.rfl
134
leanexplore_declaration
leanexplore:386644
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem reverse_sub (l m : Language α) : (l - m).reverse = l.reverse - m.reverse := by ext x; simp [mem_sub]
549
leanexplore_declaration
leanexplore:386645
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =] theorem sub_one_mul : (l - 1) * l = l * l - 1 := by ext x; constructor · rintro ⟨u, h_u, v, h_v, rfl⟩ constructor · exact ⟨u, Set.mem_of_mem_inter_left h_u, v, h_v, rfl⟩ · by_contra h have := mem_sub_one u |>.mp h_u have := mem_one (u ++ v) |>.mp h grind [append_eq_ni...
379
leanexplore_declaration
leanexplore:386646
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =] theorem mul_sub_one : l * (l - 1) = l * l - 1 := by calc _ = (l * (l - 1)).reverse.reverse := by rw [reverse_reverse] _ = ((l.reverse - 1) * l.reverse).reverse := by rw [reverse_mul, reverse_sub, reverse_one] _ = (l.reverse * l.reverse - 1).reverse := by rw [sub_one_mul] _ = _ := by ...
567
leanexplore_declaration
leanexplore:386647
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =] theorem kstar_sub_one : l∗ - 1 = (l - 1) * l∗ := by ext x; constructor · rintro ⟨h1, h2⟩ obtain ⟨xl, rfl, h_xl⟩ := kstar_def_nonempty l ▸ h1 have h3 : ¬ xl = [] := by grind [one_def] obtain ⟨x, xl', h_xl'⟩ := exists_cons_of_ne_nil h3 subst h_xl' refine ⟨x, mem_preimage.mp (h_xl...
120
leanexplore_declaration
leanexplore:386648
leanexplore_sqlite
leanexplore_declarations
@[scoped grind =] theorem sub_one_kstar : (l - 1)∗ = l∗ := by ext x grind [mem_kstar, mem_kstar_iff_exists_nonempty]
139
leanexplore_declaration
leanexplore:386649
leanexplore_sqlite
leanexplore_declarations
@[scoped grind .] theorem kstar_iff_mul_add : m = l∗ ↔ m = (l - 1) * m + 1 := by rw [self_eq_mul_add_iff, mul_one, sub_one_kstar] grind
99
leanexplore_declaration
leanexplore:386650
leanexplore_sqlite
leanexplore_declarations
/-- An ω-language is a set of strings over an alphabet. -/ def ωLanguage (α) := Set (ωSequence α)
128
leanexplore_declaration
leanexplore:386651
leanexplore_sqlite
leanexplore_declarations
instance instCompleteAtomicBooleanAlgebra : CompleteAtomicBooleanAlgebra (ωLanguage α) := Set.instCompleteAtomicBooleanAlgebra
62
leanexplore_declaration
leanexplore:386652
leanexplore_sqlite
leanexplore_declarations
instance : Membership (ωSequence α) (ωLanguage α) := ⟨Set.Mem⟩
67
leanexplore_declaration
leanexplore:386653
leanexplore_sqlite
leanexplore_declarations
instance : Singleton (ωSequence α) (ωLanguage α) := ⟨Set.singleton⟩
61
leanexplore_declaration
leanexplore:386654
leanexplore_sqlite
leanexplore_declarations
instance : Insert (ωSequence α) (ωLanguage α) := ⟨Set.insert⟩
47
leanexplore_declaration
leanexplore:386655
leanexplore_sqlite
leanexplore_declarations
instance : HasSubset (ωLanguage α) := ⟨(· ≤ ·)⟩
51
leanexplore_declaration
leanexplore:386656
leanexplore_sqlite
leanexplore_declarations
instance : Inhabited (ωLanguage α) := ⟨(∅ : Set _)⟩
111
leanexplore_declaration
leanexplore:386657
leanexplore_sqlite
leanexplore_declarations
theorem le_def (p q : ωLanguage α) : p ≤ q ↔ (p : Set (ωSequence α)) ⊆ (q : Set (ωSequence α)) := Iff.rfl
70
leanexplore_declaration
leanexplore:386658
leanexplore_sqlite
leanexplore_declarations
theorem bot_def : (⊥ : ωLanguage α) = (∅ : Set (ωSequence α)) := rfl
73
leanexplore_declaration
leanexplore:386659
leanexplore_sqlite
leanexplore_declarations
theorem top_def : (⊤ : ωLanguage α) = (univ : Set (ωSequence α)) := rfl
82
leanexplore_declaration
leanexplore:386660
leanexplore_sqlite
leanexplore_declarations
theorem sup_def (p q : ωLanguage α) : p ⊔ q = (p ∪ q : Set (ωSequence α)) := rfl
82
leanexplore_declaration
leanexplore:386661
leanexplore_sqlite
leanexplore_declarations
theorem inf_def (p q : ωLanguage α) : p ⊓ q = (p ∩ q : Set (ωSequence α)) := rfl
76
leanexplore_declaration
leanexplore:386662
leanexplore_sqlite
leanexplore_declarations
theorem compl_def (p : ωLanguage α) : pᶜ = (pᶜ : Set (ωSequence α)) := rfl
82
leanexplore_declaration
leanexplore:386663
leanexplore_sqlite
leanexplore_declarations
theorem iSup_def {ι : Sort v} {p : ι → ωLanguage α} : ⨆ i, p i = ⋃ i, p i := rfl
82
leanexplore_declaration
leanexplore:386664
leanexplore_sqlite
leanexplore_declarations
theorem iInf_def {ι : Sort v} {p : ι → ωLanguage α} : ⨅ i, p i = ⋂ i, p i := rfl
225
leanexplore_declaration
leanexplore:386665
leanexplore_sqlite
leanexplore_declarations
/-- The concatenation of a language l and an ω-language `p` is the ω-language made of infinite sequences `x ++ω y` where `x ∈ l` and `y ∈ p`. -/ instance : HMul (Language α) (ωLanguage α) (ωLanguage α) := ⟨image2 (· ++ω ·)⟩
91
leanexplore_declaration
leanexplore:386666
leanexplore_sqlite
leanexplore_declarations
theorem hmul_def (l : Language α) (p : ωLanguage α) : l * p = image2 (· ++ω ·) l p := rfl
239
leanexplore_declaration
leanexplore:386667
leanexplore_sqlite
leanexplore_declarations
/-- Concatenation of infinitely many copies of a languages, resulting in an ω-language. A.k.a. ω-power. -/ def omegaPow [Inhabited α] (l : Language α) : ωLanguage α := { s | ∃ xs : ωSequence (List α), xs.flatten = s ∧ ∀ k, xs k ∈ l - 1 }
165
leanexplore_declaration
leanexplore:386668
leanexplore_sqlite
leanexplore_declarations
/-- Notation class for `omegaPow`. -/ @[notation_class] class OmegaPow (α : Type*) (β : outParam (Type*)) where /-- The `omegaPow` operation. -/ omegaPow : α → β
90
leanexplore_declaration
leanexplore:386669
leanexplore_sqlite
leanexplore_declarations
/-- Use the postfix notation ^ω` for `omegaPow`. -/ postfix:1024 "^ω" => OmegaPow.omegaPow
76
leanexplore_declaration
leanexplore:386670
leanexplore_sqlite
leanexplore_declarations
instance [Inhabited α] : OmegaPow (Language α) (ωLanguage α) := ⟨omegaPow⟩
142
leanexplore_declaration
leanexplore:386671
leanexplore_sqlite
leanexplore_declarations
theorem omegaPow_def [Inhabited α] (l : Language α) : l^ω = { s | ∃ xs : ωSequence (List α), xs.flatten = s ∧ ∀ k, xs k ∈ l - 1 } := rfl
231
leanexplore_declaration
leanexplore:386672
leanexplore_sqlite
leanexplore_declarations
/-- The ω-limit of a language `l` is the ω-language of infinite sequences each of which contains infinitely many distinct prefixes in `l`. -/ def omegaLim (l : Language α) : ωLanguage α := { s | ∃ᶠ m in atTop, s.extract 0 m ∈ l }
165
leanexplore_declaration
leanexplore:386673
leanexplore_sqlite
leanexplore_declarations
/-- Notation class for `omegaLim`. -/ @[notation_class] class OmegaLim (α : Type*) (β : outParam (Type*)) where /-- The `omegaLim` operation. -/ omegaLim : α → β
90
leanexplore_declaration
leanexplore:386674
leanexplore_sqlite
leanexplore_declarations
/-- Use the postfix notation ↗ω` for `omegaLim`. -/ postfix:1024 "↗ω" => OmegaLim.omegaLim
75
leanexplore_declaration
leanexplore:386675
leanexplore_sqlite
leanexplore_declarations
instance instOmegaLim : OmegaLim (Language α) (ωLanguage α) := ⟨omegaLim⟩
99
leanexplore_declaration
leanexplore:386676
leanexplore_sqlite
leanexplore_declarations
theorem omegaLim_def (l : Language α) : l↗ω = { s | ∃ᶠ m in atTop, s.extract 0 m ∈ l } := rfl
178
leanexplore_declaration
leanexplore:386677
leanexplore_sqlite
leanexplore_declarations
/-- transform an ω-language `p` over `α` into an ω-language over `β` by mapping through `f : α → β`. -/ def map (f : α → β) : ωLanguage α → ωLanguage β := image (ωSequence.map f)
96
leanexplore_declaration
leanexplore:386678
leanexplore_sqlite
leanexplore_declarations
theorem map_def (f : α → β) (p : ωLanguage α) : p.map f = image (ωSequence.map f) p := rfl
82
leanexplore_declaration
leanexplore:386679
leanexplore_sqlite
leanexplore_declarations
@[ext] theorem ext (h : ∀ (s : ωSequence α), s ∈ p ↔ s ∈ q) : p = q := Set.ext h
70
leanexplore_declaration
leanexplore:386680
leanexplore_sqlite
leanexplore_declarations
@[ext] theorem ext (h : ∀ (s : ωSequence α), s ∈ p ↔ s ∈ q) : p = q :=
81
leanexplore_declaration
leanexplore:386681
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem mem_top (s : ωSequence α) : s ∈ (⊤ : ωLanguage α) := by trivial
76
leanexplore_declaration
leanexplore:386682
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem notMem_bot (s : ωSequence α) : s ∉ (⊥ : ωLanguage α) := id
118
leanexplore_declaration
leanexplore:386683
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem mem_sup (p q : ωLanguage α) (s : ωSequence α) : s ∈ p ⊔ q ↔ s ∈ p ∨ s ∈ q := Iff.rfl
118
leanexplore_declaration
leanexplore:386684
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem mem_inf (p q : ωLanguage α) (s : ωSequence α) : s ∈ p ⊓ q ↔ s ∈ p ∧ s ∈ q := Iff.rfl
109
leanexplore_declaration
leanexplore:386685
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem mem_compl (p : ωLanguage α) (s : ωSequence α) : s ∈ pᶜ ↔ ¬ s ∈ p := Iff.rfl
129
leanexplore_declaration
leanexplore:386686
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem mem_iSup {ι : Sort v} {p : ι → ωLanguage α} {s : ωSequence α} : (s ∈ ⨆ i, p i) ↔ ∃ i, s ∈ p i := mem_iUnion
129
leanexplore_declaration
leanexplore:386687
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem mem_iInf {ι : Sort v} {p : ι → ωLanguage α} {s : ωSequence α} : (s ∈ ⨅ i, p i) ↔ ∀ i, s ∈ p i := mem_iInter
100
leanexplore_declaration
leanexplore:386688
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem mem_hmul : s ∈ l * p ↔ ∃ x ∈ l, ∃ t ∈ p, x ++ω t = s := mem_image2
80
leanexplore_declaration
leanexplore:386689
leanexplore_sqlite
leanexplore_declarations
theorem append_mem_hmul : x ∈ l → s ∈ p → x ++ω s ∈ l * p := mem_image2_of_mem
149
leanexplore_declaration
leanexplore:386690
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem mem_omegaPow [Inhabited α] : s ∈ l^ω ↔ ∃ xs : ωSequence (List α), xs.flatten = s ∧ ∀ k, xs k ∈ l - 1 := Iff.rfl
139
leanexplore_declaration
leanexplore:386691
leanexplore_sqlite
leanexplore_declarations
theorem flatten_mem_omegaPow [Inhabited α] {xs : ωSequence (List α)} (h_xs : ∀ k, xs k ∈ l - 1) : xs.flatten ∈ l^ω := ⟨xs, rfl, h_xs⟩
106
leanexplore_declaration
leanexplore:386692
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem mem_omegaLim : s ∈ l↗ω ↔ ∃ᶠ m in atTop, s.extract 0 m ∈ l := Iff.rfl
86
leanexplore_declaration
leanexplore:386693
leanexplore_sqlite
leanexplore_declarations
theorem mul_hmul : (l * m) * p = l * (m * p) := image2_assoc append_append_ωSequence
91
leanexplore_declaration
leanexplore:386694
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem zero_hmul : (0 : Language α) * p = ⊥ := image2_empty_left
92
leanexplore_declaration
leanexplore:386695
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem hmul_bot : l * (⊥ : ωLanguage α) = ⊥ := image2_empty_right
109
leanexplore_declaration
leanexplore:386696
leanexplore_sqlite
leanexplore_declarations
@[simp, scoped grind =] theorem one_hmul : (1 : Language α) * p = p := by simp [hmul_def, Language.one_def]
70
leanexplore_declaration
leanexplore:386697
leanexplore_sqlite
leanexplore_declarations
theorem hmul_sup : l * (p ⊔ q) = l * p ⊔ l * q := image2_union_right
69
leanexplore_declaration
leanexplore:386698
leanexplore_sqlite
leanexplore_declarations
theorem add_hmul : (l + m) * p = l * p ⊔ m * p := image2_union_left
135
leanexplore_declaration
leanexplore:386699
leanexplore_sqlite
leanexplore_declarations
theorem iSup_hmul {ι : Sort v} (l : ι → Language α) (p : ωLanguage α) : (⨆ i, l i) * p = ⨆ i, l i * p := image2_iUnion_left _ _ _
136
leanexplore_declaration
leanexplore:386700
leanexplore_sqlite
leanexplore_declarations
theorem hmul_iSup {ι : Sort v} (p : ι → ωLanguage α) (l : Language α) : (l * ⨆ i, p i) = ⨆ i, l * p i := image2_iUnion_right _ _ _
182
leanexplore_declaration
leanexplore:386701
leanexplore_sqlite
leanexplore_declarations
theorem le_hmul_congr {l1 l2 : Language α} {p1 p2 : ωLanguage α} (hl : l1 ≤ l2) (hp : p1 ≤ p2) : l1 * p1 ≤ l2 * p2 := by intros _ simp_all only [hmul_def, mem_image2] tauto