Theorem: denoteOpArgs_equiv
Proof state before:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') →
      ∀ ⦃env₂ : SSAEnv Δ⦄, SSAEnv.equiv env env₂ → denoteOpArgs Δ tail env₂ = Except.ok (r, env₂)
env env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
headName : SSAVal
headτ : MLIRType Δ
headR✝ : MLIRType.eval headτ × SSAEnv Δ
headR : MLIRType.eval headτ
headEnv : SSAEnv Δ
Hhead :
  Except.ok
      (match SSAEnv.get headName headτ env with
        | some v => v
        | none => default,
        env) =
    Except.ok (headR, headEnv)
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR✝ : List (TypedArg Δ) × SSAEnv Δ
tailR : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail headEnv =
    Except.ok (tailR, tailEnv)
AOEU : ∀ ⦃env₂ : SSAEnv Δ⦄, SSAEnv.equiv headEnv env₂ → denoteOpArgs Δ tail env₂ = Except.ok (tailR, env₂)
⊢ (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail env₂ with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := headR } :: v.fst, v.snd)) =
    Except.ok ({ fst := headτ, snd := headR } :: (tailR, tailEnv).fst, env₂)
Tactic:
simp at Hhead
Proof state after:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') →
      ∀ ⦃env₂ : SSAEnv Δ⦄, SSAEnv.equiv env env₂ → denoteOpArgs Δ tail env₂ = Except.ok (r, env₂)
env env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
headName : SSAVal
headτ : MLIRType Δ
headR✝ : MLIRType.eval headτ × SSAEnv Δ
headR : MLIRType.eval headτ
headEnv : SSAEnv Δ
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR✝ : List (TypedArg Δ) × SSAEnv Δ
tailR : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail headEnv =
    Except.ok (tailR, tailEnv)
AOEU : ∀ ⦃env₂ : SSAEnv Δ⦄, SSAEnv.equiv headEnv env₂ → denoteOpArgs Δ tail env₂ = Except.ok (tailR, env₂)
Hhead :
  (match SSAEnv.get headName headτ env with
      | some v => v
      | none => default) =
      headR ∧
    env = headEnv
⊢ (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail env₂ with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := headR } :: v.fst, v.snd)) =
    Except.ok ({ fst := headτ, snd := headR } :: (tailR, tailEnv).fst, env₂)