l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      refine' ⟨S, hx, _⟩
      

Proof state:
case mp.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
hS : ∀ t ∈ S, ¬t = [] ∧ rmatch a✝ t = true
⊢ ∀ y ∈ S, y ∈ matches' a✝ ∧ ¬y = []

Next tactic:
intro y
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      refine' ⟨S, hx, _⟩
      intro y
      

Proof state:
case mp.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
hS : ∀ t ∈ S, ¬t = [] ∧ rmatch a✝ t = true
y : List α
⊢ y ∈ S → y ∈ matches' a✝ ∧ ¬y = []

Next tactic:
specialize hS y
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      

Proof state:
case mpr
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
⊢ x ∈ {x | ∃ S, x = join S ∧ ∀ y ∈ S, y ∈ matches' a✝ ∧ ¬y = []} →
    ∃ S, x = join S ∧ ∀ t ∈ S, ¬t = [] ∧ rmatch a✝ t = true

Next tactic:
rintro ⟨S, hx, hS⟩
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      

Proof state:
case mpr.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
hS : ∀ y ∈ S, y ∈ matches' a✝ ∧ ¬y = []
⊢ ∃ S, x = join S ∧ ∀ t ∈ S, ¬t = [] ∧ rmatch a✝ t = true

Next tactic:
refine' ⟨S, hx, _⟩
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      refine' ⟨S, hx, _⟩
      

Proof state:
case mpr.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
hS : ∀ y ∈ S, y ∈ matches' a✝ ∧ ¬y = []
⊢ ∀ t ∈ S, ¬t = [] ∧ rmatch a✝ t = true

Next tactic:
intro y
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      refine' ⟨S, hx, _⟩
      intro y
      

Proof state:
case mpr.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
hS : ∀ y ∈ S, y ∈ matches' a✝ ∧ ¬y = []
y : List α
⊢ y ∈ S → ¬y = [] ∧ rmatch a✝ y = true

Next tactic:
specialize hS y
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      refine' ⟨S, hx, _⟩
      intro y
      specialize hS y
    · 

Proof state:
case mp.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
y : List α
hS : y ∈ S → ¬y = [] ∧ rmatch a✝ y = true
⊢ y ∈ S → y ∈ matches' a✝ ∧ ¬y = []

Next tactic:
rw [← ih y]
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      refine' ⟨S, hx, _⟩
      intro y
      specialize hS y
    · rw [← ih y]
      

Proof state:
case mp.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
y : List α
hS : y ∈ S → ¬y = [] ∧ rmatch a✝ y = true
⊢ y ∈ S → rmatch a✝ y = true ∧ ¬y = []

Next tactic:
tauto
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      refine' ⟨S, hx, _⟩
      intro y
      specialize hS y
    · rw [← ih y]
      tauto
    · 

Proof state:
case mpr.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
y : List α
hS : y ∈ S → y ∈ matches' a✝ ∧ ¬y = []
⊢ y ∈ S → ¬y = [] ∧ rmatch a✝ y = true

Next tactic:
rw [ih y]
@[simp]
theorem rmatch_iff_matches' (P : RegularExpression α) :
    ∀ x : List α, P.rmatch x ↔ x ∈ P.matches' := by
  intro x
  induction P generalizing x
  all_goals
    try rw [zero_def]
    try rw [one_def]
    try rw [plus_def]
    try rw [comp_def]
  case zero =>
    rw [zero_rmatch]
    tauto
  case epsilon =>
    rw [one_rmatch_iff]
    rfl
  case char =>
    rw [char_rmatch_iff]
    rfl
  case plus _ _ ih₁ ih₂ =>
    rw [add_rmatch_iff, ih₁, ih₂]
    rfl
  case comp P Q ih₁ ih₂ =>
    simp only [mul_rmatch_iff, comp_def, Language.mul_def, exists_and_left, Set.mem_image2,
      Set.image_prod]
    constructor
    · rintro ⟨x, y, hsum, hmatch₁, hmatch₂⟩
      rw [ih₁] at hmatch₁
      rw [ih₂] at hmatch₂
      exact ⟨x, y, hmatch₁, hmatch₂, hsum.symm⟩
    · rintro ⟨x, y, hmatch₁, hmatch₂, hsum⟩
      rw [← ih₁] at hmatch₁
      rw [← ih₂] at hmatch₂
      exact ⟨x, y, hsum.symm, hmatch₁, hmatch₂⟩
  case star _ ih =>
    rw [star_rmatch_iff]
    simp only [ne_eq, matches', Language.kstar_def_nonempty, mem_setOf_eq]
    constructor
    all_goals
      rintro ⟨S, hx, hS⟩
      refine' ⟨S, hx, _⟩
      intro y
      specialize hS y
    · rw [← ih y]
      tauto
    · rw [ih y]
      

Proof state:
case mpr.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
a✝ : RegularExpression α
ih : ∀ (x : List α), rmatch a✝ x = true ↔ x ∈ matches' a✝
x : List α
S : List (List α)
hx : x = join S
y : List α
hS : y ∈ S → y ∈ matches' a✝ ∧ ¬y = []
⊢ y ∈ S → ¬y = [] ∧ y ∈ matches' a✝

Next tactic:
tauto
@[simp]
protected theorem map_pow (f : α → β) (P : RegularExpression α) :
    ∀ n : ℕ, map f (P ^ n) = map f P ^ n
  | 0 => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
P : RegularExpression α
⊢ map f (P ^ 0) = map f P ^ 0

Next tactic:
dsimp
@[simp]
protected theorem map_pow (f : α → β) (P : RegularExpression α) :
    ∀ n : ℕ, map f (P ^ n) = map f P ^ n
  | 0 => by dsimp; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
P : RegularExpression α
⊢ 1 = map f P ^ 0

Next tactic:
rfl
@[simp]
theorem map_id : ∀ P : RegularExpression α, P.map id = P
  | 0 => rfl
  | 1 => rfl
  | char a => rfl
  | R + S => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
R S : RegularExpression α
⊢ map id (R + S) = R + S

Next tactic:
simp_rw [map, map_id]
@[simp]
theorem map_id : ∀ P : RegularExpression α, P.map id = P
  | 0 => rfl
  | 1 => rfl
  | char a => rfl
  | R + S => by simp_rw [map, map_id]
  | R * S => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
R S : RegularExpression α
⊢ map id (R * S) = R * S

Next tactic:
simp_rw [map, map_id]
@[simp]
theorem map_id : ∀ P : RegularExpression α, P.map id = P
  | 0 => rfl
  | 1 => rfl
  | char a => rfl
  | R + S => by simp_rw [map, map_id]
  | R * S => by simp_rw [map, map_id]
  | star R => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
R : RegularExpression α
⊢ map id (star R) = star R

Next tactic:
simp_rw [map, map_id]
@[simp]
theorem map_map (g : β → γ) (f : α → β) : ∀ P : RegularExpression α, (P.map f).map g = P.map (g ∘ f)
  | 0 => rfl
  | 1 => rfl
  | char a => rfl
  | R + S => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
g : β → γ
f : α → β
R S : RegularExpression α
⊢ map g (map f (R + S)) = map (g ∘ f) (R + S)

Next tactic:
simp only [map, Function.comp_apply, map_map]
@[simp]
theorem map_map (g : β → γ) (f : α → β) : ∀ P : RegularExpression α, (P.map f).map g = P.map (g ∘ f)
  | 0 => rfl
  | 1 => rfl
  | char a => rfl
  | R + S => by simp only [map, Function.comp_apply, map_map]
  | R * S => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
g : β → γ
f : α → β
R S : RegularExpression α
⊢ map g (map f (R * S)) = map (g ∘ f) (R * S)

Next tactic:
simp only [map, Function.comp_apply, map_map]
@[simp]
theorem map_map (g : β → γ) (f : α → β) : ∀ P : RegularExpression α, (P.map f).map g = P.map (g ∘ f)
  | 0 => rfl
  | 1 => rfl
  | char a => rfl
  | R + S => by simp only [map, Function.comp_apply, map_map]
  | R * S => by simp only [map, Function.comp_apply, map_map]
  | star R => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
g : β → γ
f : α → β
R : RegularExpression α
⊢ map g (map f (star R)) = map (g ∘ f) (star R)

Next tactic:
simp only [map, Function.comp_apply, map_map]
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a✝ b : α
f : α → β
a : α
⊢ matches' (map f (char a)) = (Language.map f) (matches' (char a))

Next tactic:
rw [eq_comm]
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    rw [eq_comm]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a✝ b : α
f : α → β
a : α
⊢ (Language.map f) (matches' (char a)) = matches' (map f (char a))

Next tactic:
exact image_singleton
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    rw [eq_comm]
    exact image_singleton
  -- porting note: the following close with last `rw` but not with `simp`?
  | R + S => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
R S : RegularExpression α
⊢ matches' (map f (R + S)) = (Language.map f) (matches' (R + S))

Next tactic:
simp only [matches'_map, map, matches'_add]
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    rw [eq_comm]
    exact image_singleton
  -- porting note: the following close with last `rw` but not with `simp`?
  | R + S => by simp only [matches'_map, map, matches'_add]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
R S : RegularExpression α
⊢ (Language.map f) (matches' R) + (Language.map f) (matches' S) = (Language.map f) (matches' R + matches' S)

Next tactic:
rw [map_add]
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    rw [eq_comm]
    exact image_singleton
  -- porting note: the following close with last `rw` but not with `simp`?
  | R + S => by simp only [matches'_map, map, matches'_add]; rw [map_add]
  | R * S => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
R S : RegularExpression α
⊢ matches' (map f (R * S)) = (Language.map f) (matches' (R * S))

Next tactic:
simp only [matches'_map, map, matches'_mul]
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    rw [eq_comm]
    exact image_singleton
  -- porting note: the following close with last `rw` but not with `simp`?
  | R + S => by simp only [matches'_map, map, matches'_add]; rw [map_add]
  | R * S => by simp only [matches'_map, map, matches'_mul]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
R S : RegularExpression α
⊢ (Language.map f) (matches' R) * (Language.map f) (matches' S) = (Language.map f) (matches' R * matches' S)

Next tactic:
rw [map_mul]
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    rw [eq_comm]
    exact image_singleton
  -- porting note: the following close with last `rw` but not with `simp`?
  | R + S => by simp only [matches'_map, map, matches'_add]; rw [map_add]
  | R * S => by simp only [matches'_map, map, matches'_mul]; rw [map_mul]
  | star R => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
R : RegularExpression α
⊢ matches' (map f (star R)) = (Language.map f) (matches' (star R))

Next tactic:
simp_rw [map, matches', matches'_map]
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    rw [eq_comm]
    exact image_singleton
  -- porting note: the following close with last `rw` but not with `simp`?
  | R + S => by simp only [matches'_map, map, matches'_add]; rw [map_add]
  | R * S => by simp only [matches'_map, map, matches'_mul]; rw [map_mul]
  | star R => by
    simp_rw [map, matches', matches'_map]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
R : RegularExpression α
⊢ ((Language.map f) (matches' R))∗ = (Language.map f) (matches' R)∗

Next tactic:
rw [Language.kstar_eq_iSup_pow, Language.kstar_eq_iSup_pow]
/-- The language of the map is the map of the language. -/
@[simp]
theorem matches'_map (f : α → β) :
    ∀ P : RegularExpression α, (P.map f).matches' = Language.map f P.matches'
  | 0 => (map_zero _).symm
  | 1 => (map_one _).symm
  | char a => by
    rw [eq_comm]
    exact image_singleton
  -- porting note: the following close with last `rw` but not with `simp`?
  | R + S => by simp only [matches'_map, map, matches'_add]; rw [map_add]
  | R * S => by simp only [matches'_map, map, matches'_mul]; rw [map_mul]
  | star R => by
    simp_rw [map, matches', matches'_map]
    rw [Language.kstar_eq_iSup_pow, Language.kstar_eq_iSup_pow]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
dec : DecidableEq α
a b : α
f : α → β
R : RegularExpression α
⊢ ⨆ i, (Language.map f) (matches' R) ^ i = (Language.map f) (⨆ i, matches' R ^ i)

Next tactic:
simp_rw [← map_pow]