File size: 884 Bytes
760f90e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import OAI.Computability.StarHeight.Recognition

namespace OAI

namespace GeneralizedStarHeight

universe u

theorem main {Alphabet : Type u} [Finite Alphabet] (L : Language Alphabet) (hL : L.IsRegular) :
    HasHeightAtMost L 3 := by
  classical
  rcases isEmpty_or_nonempty Alphabet with h|h
  · let : IsEmpty Alphabet := h
    apply HasHeightAtMost.finite L _ 3
    apply (Set.finite_singleton ([] : List Alphabet)).subset
    intro w _
    cases w with
    | nil => rfl
    | cons a w => exact isEmptyElim a
  · let : Nonempty Alphabet := h
    obtain ⟨M,hM,hfin,T,F,hTF⟩ := FiniteRecognition.of_regular hL
    let : Monoid M := hM
    let : Fintype M := hfin
    have heq : L=({w | T (FreeMonoid.ofList w)∈F} : Language Alphabet) := by
      ext w
      exact hTF w
    rw [heq]
    exact FiniteRecognition.recognized_height_three T F

end GeneralizedStarHeight

end OAI