Theorem: LO.FirstOrder.UFormula.inversion_primrec (Logic/FirstOrder/Computability/Formula.lean)

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
⊢ Primrec inversion
Tactic:
have : Primrec (fun x => ((WType.inversion (equivW L μ x)).1, (WType.inversion (equivW L μ x)).2.map (equivW L μ).symm)) :=
  Primrec₂.pair.comp (fst.comp $ w_inversion.comp of_equiv)
  <| list_map (snd.comp $ w_inversion.comp of_equiv) (of_equiv_symm.comp₂ Primrec₂.right)
State after:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
⊢ Primrec inversion

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
⊢ Primrec inversion
Tactic:
apply this.of_eq <| fun p => by
  cases p <;> simp[WType.inversion, inversion, toW_eq_equivW]
  case and => rw[fintypeEquivFin_symm_zero, fintypeEquivFin_symm_one]; simp
  case or => rw[fintypeEquivFin_symm_zero, fintypeEquivFin_symm_one]; simp
  case all p =>
    rw[Equiv.symm_apply_eq]
    exact fintypeArrowEquivFinArrow_app _ _
  case ex =>
    rw[Equiv.symm_apply_eq]
    exact fintypeArrowEquivFinArrow_app _ _
State after:
no goals

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
p : UFormula L μ
⊢ (((equivW L μ) p).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) p).inversion.2) = p.inversion
Tactic:
cases p <;> simp[WType.inversion, inversion, toW_eq_equivW]
State after:
case and
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝¹ a✝ : UFormula L μ
⊢ (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 0)) = a✝¹ ∧
    (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 1)) = a✝

case or
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝¹ a✝ : UFormula L μ
⊢ (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 0)) = a✝¹ ∧
    (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 1)) = a✝

case all
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝ : UFormula L μ
⊢ (equivW L μ).symm (fintypeArrowEquivFinArrow (fun x => (equivW L μ) a✝) 0) = a✝

case ex
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝ : UFormula L μ
⊢ (equivW L μ).symm (fintypeArrowEquivFinArrow (fun x => (equivW L μ) a✝) 0) = a✝

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝¹ a✝ : UFormula L μ
⊢ (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 0)) = a✝¹ ∧
    (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 1)) = a✝
Tactic:
case and => rw[fintypeEquivFin_symm_zero, fintypeEquivFin_symm_one]; simp
State after:
no goals

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝¹ a✝ : UFormula L μ
⊢ (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 0)) = a✝¹ ∧
    (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 1)) = a✝
Tactic:
case or => rw[fintypeEquivFin_symm_zero, fintypeEquivFin_symm_one]; simp
State after:
no goals

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
p : UFormula L μ
⊢ (equivW L μ).symm (fintypeArrowEquivFinArrow (fun x => (equivW L μ) p) 0) = p
Tactic:
case all p =>
  rw[Equiv.symm_apply_eq]
  exact fintypeArrowEquivFinArrow_app _ _
State after:
no goals

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝ : UFormula L μ
⊢ (equivW L μ).symm (fintypeArrowEquivFinArrow (fun x => (equivW L μ) a✝) 0) = a✝
Tactic:
case ex =>
  rw[Equiv.symm_apply_eq]
  exact fintypeArrowEquivFinArrow_app _ _
State after:
no goals

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝¹ a✝ : UFormula L μ
⊢ (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 0)) = a✝¹ ∧
    (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) (fintypeEquivFin.symm 1)) = a✝
Tactic:
rw[fintypeEquivFin_symm_zero, fintypeEquivFin_symm_one]
State after:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝¹ a✝ : UFormula L μ
⊢ (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) false) = a✝¹ ∧
    (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) true) = a✝

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝¹ a✝ : UFormula L μ
⊢ (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) false) = a✝¹ ∧
    (equivW L μ).symm (Bool.rec ((equivW L μ) a✝¹) ((equivW L μ) a✝) true) = a✝
Tactic:
simp
State after:
no goals

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
p : UFormula L μ
⊢ (equivW L μ).symm (fintypeArrowEquivFinArrow (fun x => (equivW L μ) p) 0) = p
Tactic:
rw[Equiv.symm_apply_eq]
State after:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
p : UFormula L μ
⊢ fintypeArrowEquivFinArrow (fun x => (equivW L μ) p) 0 = (equivW L μ) p

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
p : UFormula L μ
⊢ fintypeArrowEquivFinArrow (fun x => (equivW L μ) p) 0 = (equivW L μ) p
Tactic:
exact fintypeArrowEquivFinArrow_app _ _
State after:
no goals

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝ : UFormula L μ
⊢ (equivW L μ).symm (fintypeArrowEquivFinArrow (fun x => (equivW L μ) a✝) 0) = a✝
Tactic:
rw[Equiv.symm_apply_eq]
State after:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝ : UFormula L μ
⊢ fintypeArrowEquivFinArrow (fun x => (equivW L μ) a✝) 0 = (equivW L μ) a✝

State before:
L : Language
μ : Type v
inst✝⁴ : (k : ℕ) → Primcodable (L.Func k)
inst✝³ : (k : ℕ) → Primcodable (L.Rel k)
inst✝² : UniformlyPrimcodable L.Func
inst✝¹ : UniformlyPrimcodable L.Rel
inst✝ : Primcodable μ
this : Primrec fun x => (((equivW L μ) x).inversion.1, List.map (⇑(equivW L μ).symm) ((equivW L μ) x).inversion.2)
a✝ : UFormula L μ
⊢ fintypeArrowEquivFinArrow (fun x => (equivW L μ) a✝) 0 = (equivW L μ) a✝
Tactic:
exact fintypeArrowEquivFinArrow_app _ _
State after:
no goals