internlm/Lean-Github huggingface dataset:
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
H :
  (match head :: tail with
      | [] => pure []
      | [stmt] => denoteOp Δ stmt
      | stmt :: stmts' => do
        let __discr ← denoteOp Δ stmt
        let x : TypedArgs Δ := __discr
        denoteOps Δ stmts')
      env =
    Except.ok (res, env')
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ (head :: tail) env₂ = Except.ok (res, env₂')
Tactic:
simp_monad at H
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
H :
  (match head :: tail with
      | [] => fun s => Except.ok ([], s)
      | [stmt] => denoteOp Δ stmt
      | stmt :: stmts' => fun s =>
        match denoteOp Δ stmt s with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ stmts' v.snd)
      env =
    Except.ok (res, env')
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ (head :: tail) env₂ = Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
H :
  (match head :: tail with
      | [] => fun s => Except.ok ([], s)
      | [stmt] => denoteOp Δ stmt
      | stmt :: stmts' => fun s =>
        match denoteOp Δ stmt s with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ stmts' v.snd)
      env =
    Except.ok (res, env')
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ (head :: tail) env₂ = Except.ok (res, env₂')
Tactic:
match TAIL: tail with
| .nil =>
  apply denoteOp_equiv <;> assumption
| .cons head2 tail2 =>
  simp [denoteOps] at *; simp_monad at *
  split at H <;> try contradiction
  case h_2 headR HHeadR =>
  have ⟨headR, headEnv⟩ := headR; simp at *
  have ⟨envHead, HenvHead, HdenoteHead⟩ := denoteOp_equiv HHeadR Henv₂
  simp [HdenoteHead]
  rw [←TAIL] at H; rw [←TAIL]
  apply denoteOps_equiv H HenvHead
Proof state after:
no goals
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
H :
  (match [head] with
      | [] => fun s => Except.ok ([], s)
      | [stmt] => denoteOp Δ stmt
      | stmt :: stmts' => fun s =>
        match denoteOp Δ stmt s with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ stmts' v.snd)
      env =
    Except.ok (res, env')
TAIL : tail = []
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ [head] env₂ = Except.ok (res, env₂')
Tactic:
apply denoteOp_equiv <;> assumption
Proof state after:
no goals
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
H :
  (match head :: head2 :: tail2 with
      | [] => fun s => Except.ok ([], s)
      | [stmt] => denoteOp Δ stmt
      | stmt :: stmts' => fun s =>
        match denoteOp Δ stmt s with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ stmts' v.snd)
      env =
    Except.ok (res, env')
TAIL : tail = head2 :: tail2
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ (head :: head2 :: tail2) env₂ = Except.ok (res, env₂')
Tactic:
simp [denoteOps] at *
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
H :
  (match denoteOp Δ head env with
    | Except.error err => Except.error err
    | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
    Except.ok (res, env')
TAIL : tail = head2 :: tail2
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      bind (denoteOp Δ head) (fun __discr => denoteOps Δ (head2 :: tail2)) env₂ = Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
H :
  (match denoteOp Δ head env with
    | Except.error err => Except.error err
    | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
    Except.ok (res, env')
TAIL : tail = head2 :: tail2
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      bind (denoteOp Δ head) (fun __discr => denoteOps Δ (head2 :: tail2)) env₂ = Except.ok (res, env₂')
Tactic:
simp_monad at *
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
H :
  (match denoteOp Δ head env with
    | Except.error err => Except.error err
    | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
    Except.ok (res, env')
TAIL : tail = head2 :: tail2
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
H :
  (match denoteOp Δ head env with
    | Except.error err => Except.error err
    | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
    Except.ok (res, env')
TAIL : tail = head2 :: tail2
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Tactic:
split at H <;> try contradiction
Proof state after:
case h_2
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
v✝ : List (TypedArg Δ) × SSAEnv Δ
heq✝ : denoteOp Δ head env = Except.ok v✝
H : denoteOps Δ (head2 :: tail2) v✝.snd = Except.ok (res, env')
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR : List (TypedArg Δ) × SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok headR
H : denoteOps Δ (head2 :: tail2) headR.snd = Except.ok (res, env')
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Tactic:
case h_2 headR HHeadR =>
have ⟨headR, headEnv⟩ := headR; simp at *
have ⟨envHead, HenvHead, HdenoteHead⟩ := denoteOp_equiv HHeadR Henv₂
simp [HdenoteHead]
rw [←TAIL] at H; rw [←TAIL]
apply denoteOps_equiv H HenvHead
Proof state after:
no goals
Theorem: denoteOps_equiv
Proof state before:
case h_1
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
err✝ : String × SSAEnv Δ
heq✝ : denoteOp Δ head env = Except.error err✝
H : Except.error err✝ = Except.ok (res, env')
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Tactic:
contradiction
Proof state after:
no goals
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR : List (TypedArg Δ) × SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok headR
H : denoteOps Δ (head2 :: tail2) headR.snd = Except.ok (res, env')
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Tactic:
have ⟨headR, headEnv⟩ := headR
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ (head2 :: tail2) (headR, headEnv).snd = Except.ok (res, env')
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ (head2 :: tail2) (headR, headEnv).snd = Except.ok (res, env')
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Tactic:
simp at *
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ (head2 :: tail2) headEnv = Except.ok (res, env')
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ (head2 :: tail2) headEnv = Except.ok (res, env')
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Tactic:
have ⟨envHead, HenvHead, HdenoteHead⟩ := denoteOp_equiv HHeadR Henv₂
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ (head2 :: tail2) headEnv = Except.ok (res, env')
envHead : SSAEnv Δ
HenvHead : SSAEnv.equiv headEnv envHead
HdenoteHead : denoteOp Δ head env₂ = Except.ok (headR, envHead)
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ (head2 :: tail2) headEnv = Except.ok (res, env')
envHead : SSAEnv Δ
HenvHead : SSAEnv.equiv headEnv envHead
HdenoteHead : denoteOp Δ head env₂ = Except.ok (headR, envHead)
⊢ ∃ env₂',
    SSAEnv.equiv env' env₂' ∧
      (match denoteOp Δ head env₂ with
        | Except.error err => Except.error err
        | Except.ok v => denoteOps Δ (head2 :: tail2) v.snd) =
        Except.ok (res, env₂')
Tactic:
simp [HdenoteHead]
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ (head2 :: tail2) headEnv = Except.ok (res, env')
envHead : SSAEnv Δ
HenvHead : SSAEnv.equiv headEnv envHead
HdenoteHead : denoteOp Δ head env₂ = Except.ok (headR, envHead)
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ (head2 :: tail2) envHead = Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ (head2 :: tail2) headEnv = Except.ok (res, env')
envHead : SSAEnv Δ
HenvHead : SSAEnv.equiv headEnv envHead
HdenoteHead : denoteOp Δ head env₂ = Except.ok (headR, envHead)
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ (head2 :: tail2) envHead = Except.ok (res, env₂')
Tactic:
rw [←TAIL] at H
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ tail headEnv = Except.ok (res, env')
envHead : SSAEnv Δ
HenvHead : SSAEnv.equiv headEnv envHead
HdenoteHead : denoteOp Δ head env₂ = Except.ok (headR, envHead)
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ (head2 :: tail2) envHead = Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ tail headEnv = Except.ok (res, env')
envHead : SSAEnv Δ
HenvHead : SSAEnv.equiv headEnv envHead
HdenoteHead : denoteOp Δ head env₂ = Except.ok (headR, envHead)
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ (head2 :: tail2) envHead = Except.ok (res, env₂')
Tactic:
rw [←TAIL]
Proof state after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ tail headEnv = Except.ok (res, env')
envHead : SSAEnv Δ
HenvHead : SSAEnv.equiv headEnv envHead
HdenoteHead : denoteOp Δ head env₂ = Except.ok (headR, envHead)
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ tail envHead = Except.ok (res, env₂')
Theorem: denoteOps_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
head : Op Δ
tail : List (Op Δ)
env : SSAEnv Δ
res : TypedArgs Δ
env' env₂ : SSAEnv Δ
Henv₂ : SSAEnv.equiv env env₂
head2 : Op Δ
tail2 : List (Op Δ)
TAIL : tail = head2 :: tail2
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
headR✝ : List (TypedArg Δ) × SSAEnv Δ
headR : List (TypedArg Δ)
headEnv : SSAEnv Δ
HHeadR : denoteOp Δ head env = Except.ok (headR, headEnv)
H : denoteOps Δ tail headEnv = Except.ok (res, env')
envHead : SSAEnv Δ
HenvHead : SSAEnv.equiv headEnv envHead
HdenoteHead : denoteOp Δ head env₂ = Except.ok (headR, envHead)
⊢ ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteOps Δ tail envHead = Except.ok (res, env₂')
Tactic:
apply denoteOps_equiv H HenvHead
Proof state after:
no goals
Theorem: denoteRegion_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
region : Region Δ
⊢ ∀ ⦃args : TypedArgs Δ⦄ ⦃env : SSAEnv Δ⦄ ⦃res : TypedArgs Δ⦄ ⦃env' : SSAEnv Δ⦄,
    denoteRegion Δ region args env = Except.ok (res, env') →
      ∀ ⦃env₂ : SSAEnv Δ⦄,
        SSAEnv.equiv env env₂ →
          ∃ env₂', SSAEnv.equiv env' env₂' ∧ denoteRegion Δ region args env₂ = Except.ok (res, env₂')
Tactic:
cases region
Proof state after:
case mk
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
name✝ : String
args✝ : List (TypedSSAVal Δ)
ops✝ : List (Op Δ)
⊢ ∀ ⦃args : TypedArgs Δ⦄ ⦃env : SSAEnv Δ⦄ ⦃res : TypedArgs Δ⦄ ⦃env' : SSAEnv Δ⦄,
    denoteRegion Δ (Region.mk name✝ args✝ ops✝) args env = Except.ok (res, env') →
      ∀ ⦃env₂ : SSAEnv Δ⦄,
        SSAEnv.equiv env env₂ →
          ∃ env₂',
            SSAEnv.equiv env' env₂' ∧ denoteRegion Δ (Region.mk name✝ args✝ ops✝) args env₂ = Except.ok (res, env₂')
Theorem: denoteRegion_equiv
Proof state before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
Δ : Dialect α σ ε
S : Semantics Δ
rName : String
rArgs : List (TypedSSAVal Δ)
rOps : List (Op Δ)
⊢ ∀ ⦃args : TypedArgs Δ⦄ ⦃env : SSAEnv Δ⦄ ⦃res : TypedArgs Δ⦄ ⦃env' : SSAEnv Δ⦄,
    denoteRegion Δ (Region.mk rName rArgs rOps) args env = Except.ok (res, env') →
      ∀ ⦃env₂ : SSAEnv Δ⦄,
        SSAEnv.equiv env env₂ →
          ∃ env₂',
            SSAEnv.equiv env' env₂' ∧ denoteRegion Δ (Region.mk rName rArgs rOps) args env₂ = Except.ok (res, env₂')
Tactic:
case mk rName rArgs rOps =>
intros args env res env' H env₂ Henv₂
simp [denoteRegion] at *; simp_monad at *
(split at H <;> try contradiction); rename_i argsR HargsR
have ⟨argsR, argsEnv⟩ := argsR; cases argsR
have ⟨argsEnv₂, HargsEnv₂, HdenoteArgs⟩ := denoteTypedArgs_equiv HargsR Henv₂
rw [HdenoteArgs]; simp at *
apply denoteOps_equiv (by assumption) (by assumption)
Proof state after:
no goals