Type Systems

9. References: Typing Mutable References🔗

Most real languages include impure features ("computational effects")...

  • mutable pointer structures

  • non-local control constructs (exceptions, continuations, etc.)

  • inter-process synchronization and communication

  • etc.

Goal for this chapter: Formalize pointers.

9.1. Definitions🔗

In most real-world programming languages, the mechanisms of name binding and storage allocation are (intentionally) confused: every name refers to a mutable piece of storage.

Conceptually, it's cleaner to separate the two:

  • use the mechanisms we already have for name binding (abstraction, let);

  • introduce new operations for allocating, changing, and looking up the contents of references (pointers).

9.1.1. Syntax🔗

namespace STLCRef open scoped MyGetElem

The basic operations on references are allocation, dereferencing, and assignment.

  • To allocate a reference, we use the ref operator, providing an initial value for the new cell.

    For example, ref 5 creates a new cell containing the value 5 and reduces to a reference to that cell.

  • To read the current value of this cell, we use the dereferencing operator !.

    For example, !(ref 5) reduces to 5.

  • To change the value stored in a cell, we use the assignment operator.

    If r is a reference, r := 7 will store the value 7 in the cell referenced by r.

9.1.2. Types🔗

If τ is a type, then Ref τ is the type of references to cells holding values of type τ.

τ::=Nat
|Unit
|τ → τ
|Ref τ
inductive Ty : Type `inductive ... :=` has been deprecated in favor of `inductive ... where` Note: This linter can be disabled with `set_option linter.deprecated false`:= | nat : Ty | unit : Ty | arrow : Ty → Ty → Ty | ref : Ty → Ty

9.1.3. Terms🔗

Besides the usual variables, abstractions, applications, terms related to natural numbers, and unit, we need four more sorts of terms to handle mutable references:

t::=ref t(reference)
|! t(dereference)
|t := t(assignment)
|l(location)
inductive Tm : Type `inductive ... :=` has been deprecated in favor of `inductive ... where` Note: This linter can be disabled with `set_option linter.deprecated false`:= -- STLC with numbers: | var : String → Tm | app : Tm → Tm → Tm | abs : String → Ty → Tm → Tm | const : Nat → Tm | succ : Tm → Tm | pred : Tm → Tm | mult : Tm → Tm → Tm | ite0 : Tm → Tm → Tm → Tm -- New terms: | unit : Tm | ref : Tm → Tm | deref : Tm → Tm | assign : Tm → Tm → Tm | loc : Nat → Tm
Notationscoped syntax:max num : stlcTm scoped syntax:60 stlcTm:60 " * " stlcTm:61 : stlcTm scoped syntax:50 "if0 " stlcTm:51 " then " stlcTm:50 " else " stlcTm:50 : stlcTm scoped syntax:60 stlcTm:60 " := " stlcTm:61 : stlcTm scoped syntax:60 "Ref " stlcTy:61 : stlcTy scoped syntax:60 "ref " stlcTm:61 : stlcTm scoped syntax:60 "loc " stlcTm:61 : stlcTm scoped syntax:60 "!" stlcTm:61 : stlcTm scoped syntax:55 stlcTm:56 " ; " stlcTm:55 : stlcTm scoped syntax stlcCtx " / " term:max " ⊢ " stlcTm " ⦂ " stlcTy : stlcQuoted abbrev Tm.tseq t₁ t₂ := Tm.app (.abs "X" .unit t₂) t₁ namespace Elab open StlcCommon open Lean Meta Elab Term def language : Language where tyType := ``Ty tmType := ``Tm arrowCtor := ``Ty.arrow varCtor := ``Tm.var appCtor := ``Tm.app absCtor := ``Tm.abs -- defined later subst := `STLCRef.subst hasType := `STLCRef.HasType def extendedTyHandler : TyElabHandler := fun recur k T => do match T with | `(stlcTy| Nat) => return mkConst ``Ty.nat | `(stlcTy| Unit) => return mkConst ``Ty.unit | `(stlcTy| Ref $τ:stlcTy) => do let τ ← recur τ return mkApp (mkConst ``Ty.ref) τ | _ => k T def tyHandlers : TyElabHandler := extendedTyHandler.orElse (commonTyHandler language) partial def elabTy : TyElab := tyHandlers elabTy <| unsupportedTy language def extendedTmHandler : TmElabHandler := fun recur k Γ free t => do match t with | `(stlcTm| $n:num) => do return (mkApp (mkConst ``Tm.const) (mkNatLit n.getNat), free ) | `(stlcTm| Nat) => do throwError "`Nat` is not a valid term." | `(stlcTm| succ $t:stlcTm) => do let (t, free) ← recur Γ free t return (mkApp (mkConst ``Tm.succ) t, free) | `(stlcTm| pred $t:stlcTm) => do let (t, free) ← recur Γ free t return (mkApp (mkConst ``Tm.pred) t, free) | `(stlcTm| $t₁:stlcTm * $t₂:stlcTm) => do let (t₁, free) ← recur Γ free t₁ let (t₂, free) ← recur Γ free t₂ return (mkApp2 (mkConst ``Tm.mult) t₁ t₂, free) | `(stlcTm| if0 $c:stlcTm then $t:stlcTm else $e:stlcTm) => do let (c, free) ← recur Γ free c let (t, free) ← recur Γ free t let (e, free) ← recur Γ free e return (mkApp3 (mkConst ``Tm.ite0) c t e, free) | `(stlcTm| Unit) => do throwError "`Unit` is not a valid term." | `(stlcTm| unit) => do return (mkConst ``Tm.unit, free) | `(stlcTm| ref $t:stlcTm) => do let (t, free) ← recur Γ free t return (mkApp (mkConst ``Tm.ref) t, free) | `(stlcTm| !$t:stlcTm) => do let (t, free) ← recur Γ free t return (mkApp (mkConst ``Tm.deref) t, free) | `(stlcTm| loc $n:num) => do return (mkApp (mkConst ``Tm.loc) (mkNatLit n.getNat), free ) | `(stlcTm| $t₁:stlcTm := $t₂:stlcTm) => do let (t₁, free) ← recur Γ free t₁ let (t₂, free) ← recur Γ free t₂ return (mkApp2 (mkConst ``Tm.assign) t₁ t₂, free) | `(stlcTm| $t₁:stlcTm ; $t₂:stlcTm) => do let (t₁, free) ← recur Γ free t₁ let (t₂, free) ← recur Γ free t₂ return (mkApp2 (mkConst ``Tm.tseq) t₁ t₂, free) | _ => k Γ free t def tmHandlers : TmElabHandler := extendedTmHandler.orElse (commonTmHandler language elabTy) partial def elabTm : TmElab := tmHandlers elabTm unsupportedTm def elabCtx : CtxElab := elabCtxCommon language elabTy -- `HasType` takes the store typing as an extra first argument, -- so we build typing judgments here instead of in `elabQuoted`. def mkHasType (δ Γ t T : Expr) : TermElabM Expr := do let some hasType ← resolveId? (mkIdent language.hasType) | throwError "unknown declaration `{language.hasType}`" return mkApp4 hasType δ Γ t T @[scoped term_elab StlcCommon.bracket] def elabBracket : TermElab := fun stx expectedType? => do match stx with | `(<{ $Γ:stlcCtx / $δ:term ⊢ $t:stlcTm ⦂ $T:stlcTy }>) => do let (Γ, scope) ← elabCtx Γ let (t, _) ← elabTm scope [] t let T ← elabTy T let δ ← elabTermEnsuringType δ (mkApp (mkConst ``List [`Lean.levelZero` has been deprecated: Use `Lean.Level.zero` instead Note: The updated constant is in a different namespace. Dot notation may need to be changed (e.g., from `x.levelZero` to `Level.zero x`).levelZero]) (mkConst ``Ty)) mkHasType δ Γ t T | `(<{ $_:stlcCtx ⊢ $_:stlcTm ⦂ $_:stlcTy }>) => throwError "typing judgments need a store typing: write `Γ / δ ⊢ t ⦂ τ`" | `(<{ $q:stlcQuoted }>) => elabQuoted language elabTy elabTm elabCtx q expectedType? | _ => throwUnsupportedSyntax end Elab open scoped Elab namespace Delab open StlcCommon Elab Delab open Lean PrettyPrinter Delaborator @[app_unexpander Ty.nat] private def Ty.unexpandNat : Unexpander | stx => do let Nat := mkObjectIdentFrom stx "Nat" let T ← `(stlcTy| $Nat:ident) `(<{ $T:stlcTy }>) @[app_unexpander Ty.unit] private def Ty.unexpandUnit : Unexpander | stx => do let Unit := mkObjectIdentFrom stx "Unit" let T ← `(stlcTy| $Unit:ident) `(<{ $T:stlcTy }>) @[app_unexpander Ty.arrow] private def Ty.unexpandArrow : Unexpander := Delab.unexpandArrow @[app_unexpander Ty.ref] private def Ty.unexpandRef : Unexpander | `($_ $T) => do let T' := getTy T `(<{ Ref $T':stlcTy }>) | _ => throw () private def reservedNames : String → Bool | "Nat" | "Unit" | "succ" | "pred" | "if0" | "ref" | "loc" | "Ref" | "unit" => true | _ => false @[app_unexpander Tm.var] private def Tm.unexpandVar : Unexpander := Delab.unexpandVar reservedNames ``Tm.var @[app_delab Tm.var] private def Tm.delabVar : Delab := Delab.delabVar ``Tm.var @[app_unexpander Tm.app] private def Tm.unexpandApp : Unexpander := Delab.unexpandApp @[app_unexpander Tm.abs] private def Tm.unexpandAbs : Unexpander := Delab.unexpandAbs @[app_unexpander Tm.const] private def Tm.unexpandConst : Unexpander | `($_ $n:num) => `(<{ $n:num }>) | _ => throw () @[app_unexpander Tm.succ] private def Tm.unexpandSucc : Unexpander | stx@`($_ $t) => do let succ := mkObjectIdentFrom stx "succ" let t' := getTm t `(<{ $succ:ident $t':stlcTm }>) | _ => throw () @[app_unexpander Tm.pred] private def Tm.unexpandPred : Unexpander | stx@`($_ $t) => do let pred := mkObjectIdentFrom stx "pred" let t' := getTm t `(<{ $pred:ident $t':stlcTm }>) | _ => throw () @[app_unexpander Tm.mult] private def Tm.unexpandMult : Unexpander | `($_ $t₁ $t₂) => do let t₁' := getTm t₁ let t₂' := getTm t₂ `(<{ $t₁':stlcTm * $t₂':stlcTm }>) | _ => throw () @[app_unexpander Tm.tseq] private def Tm.unexpandTseq : Unexpander | `($_ $t₁ $t₂) => do let t₁' := getTm t₁ let t₂' := getTm t₂ `(<{ $t₁':stlcTm ; $t₂':stlcTm }>) | _ => throw () @[app_unexpander Tm.ite0] private def Tm.unexpandIte0 : Unexpander | `($_ $c $t $e) => do let c' := getTm c let t' := getTm t let e' := getTm e `(<{ if0 $c':stlcTm then $t':stlcTm else $e':stlcTm }>) | _ => throw () @[app_unexpander Tm.unit] private def Tm.unexpandUnit : Unexpander | stx => do let unit := mkObjectIdentFrom stx "unit" let t ← `(stlcTm| $unit:ident) `(<{ $t:stlcTm }>) @[app_unexpander Tm.assign] private def Tm.unexpandAssign : Unexpander | `($_ $t₁ $t₂) => do let t₁' := getTm t₁ let t₂' := getTm t₂ `(<{ $t₁':stlcTm := $t₂':stlcTm }>) | _ => throw () @[app_unexpander Tm.ref] private def Tm.unexpandRef : Unexpander | `($_ $t₁) => do let t₁' := getTm t₁ `(<{ ref $t₁':stlcTm }>) | _ => throw () @[app_unexpander Tm.deref] private def Tm.unexpandDeref : Unexpander | `($_ $t₁) => do let t₁' := getTm t₁ `(<{ !$t₁':stlcTm }>) | _ => throw () @[app_unexpander Tm.loc] private def Tm.unexpandLoc : Unexpander | `($_ $n:num) => `(<{ loc $n:num }>) | _ => throw () end Delab

9.1.4. Typing (Preview)🔗

Informally, the typing rules for allocation, dereferencing, and assignment look roughly like this:

      Γ ⊢ t₁ ⦂ τ₁
---------------------  (ref)
  Γ ⊢ ref t₁ ⦂ Ref τ₁

      Γ ⊢ t₁ ⦂ Ref τ₁
---------------------  (deref)
     Γ ⊢ !t₁ ⦂ τ₁

      Γ ⊢ t₁ ⦂ Ref τ₂
      Γ ⊢ t₂ ⦂ τ₂
---------------------  (assign)
Γ ⊢ t₁ := t₂ ⦂ Unit

The rule for locations will require a bit more machinery, and this will motivate some changes to the other rules; we'll come back to this later.

9.1.5. Values and Substitution🔗

Besides abstractions, numbers, and the unit value, we have one new type of value: locations.

A location is a concrete pointer value — think of it like an address in memory. Locations should never be written directly by programmers; they are used to keep track of the intermediate states of programs involving references. In particular, the result of a ref expression is a location.

inductive Tm.IsValue : Tm → Prop `inductive ... :=` has been deprecated in favor of `inductive ... where` Note: This linter can be disabled with `set_option linter.deprecated false`:= | abs : forall x τ₂ t₁, IsValue <{λx : τ₂. t₁}> | nat : forall (n : Nat), IsValue (.const n) | unit : IsValue <{ unit }> | loc_ : forall (l : Nat), IsValue (.loc l) attribute [StlcRefEval] Tm.IsValue.abs Tm.IsValue.nat Tm.IsValue.unit Tm.IsValue.loc_

Extending substitution to handle the new syntax of terms is straightforward: substituting into a pointer leaves it unchanged.

def subst (x : String) (s : Tm) (t : Tm) : Tm := match t with -- pure STLC | .var y => if x = y then s else t | .abs y τ t₁ => if x = y then t else <{ λ y : τ . [x := s] t₁ }> | .app t₁ t₂ => <{ ([x := s] t₁) ([x := s] t₂) }> -- numbers | .const _ => t | .succ t₁ => <{ succ ([x := s] t₁) }> | .pred t₁ => <{ pred ([x := s] t₁) }> | .mult t₁ t₂ => <{ ([x := s] t₁) * ([x := s] t₂) }> | .ite0 t₁ t₂ t₃ => <{ if0 [x := s] t₁ then [x := s] t₂ else [x := s] t₃ }> -- unit | .unit => <{ unit }> -- references | .ref t₁ => <{ ref ([x := s] t₁) }> | .deref t₁ => <{ !([x := s] t₁) }> | .loc n => .loc n | .assign t₁ t₂ => <{ ([x := s] t₁) := ([x := s] t₂) }>
Notation encodingopen Lean PrettyPrinter in @[app_unexpander subst] def unexpandSubst : Unexpander := StlcCommon.Delab.unexpandSubst

9.2. Pragmatics🔗

9.2.1. Side Effects and Sequencing🔗

We can write (for example)

R := succ (!R); !R

as an abbreviation for

(λX:Unit. !R) (r := succ(!R)).
abbrev Tm.tseq (t₁ t₂ : Tm) : Tm := Tm.app (.abs "X" .unit t₂) t₁/-- info: <{ R := succ (!R) ; !R }> : Tm -/ #guard_msgs in #check Tm.tseq <{R := succ (!R)}> <{!R}>

9.2.2. References and Aliasing🔗

It is important to bear in mind the difference between the reference that is bound to some variable r and the cell in the store that is pointed to by this reference.

If we make a copy of r, for example by binding its value to another variable s, what gets copied is only the reference, not the contents of the cell itself.

For example, after reducing

let R = ref 5 in
let S = R in
S := 82;
(!R)+1

the cell referenced by R will contain the value 82, while the result of the whole expression will be 83. The references R and S are said to be aliases for the same cell.

The possibility of aliasing can make programs with references quite tricky to reason about. For example, the expression

R := 5; R := !S

assigns 5 to R and then immediately overwrites it with S's current value; this has exactly the same effect as the single assignment

R := !S

unless we happen to do it in a context where R and S are aliases for the same cell!

let R = ref 0 in
let S = R in
R := 5; R := !S

9.2.3. Shared State🔗

Of course, aliasing is also a large part of what makes references useful. In particular, it allows us to set up "implicit communication channels" — shared state — between different parts of a program. For example, suppose we define a reference cell and two functions that manipulate its contents:

let C = ref 0 in
let Incc = λ_:Unit. (C := succ (!C); !C) in
let Decc = λ_:Unit. (C := pred (!C); !C) in
  ...

The Unit-abstractions ("thunks") are used here to prevent reduction until later.

9.2.4. Objects🔗

We can go a step further and write a function that creates C, Incc, and Decc, packages Incc and Decc together into a record, and returns this record:

Newcounter =
  λ_:Unit.
      let C = ref 0 in
      let Incc = λ_:Unit. (C := succ (!C); !C) in
      let Decc = λ_:Unit. (C := pred (!C); !C) in
      {i=Incc, d=Decc}

Now, each time we call Newcounter, we get a new record of functions that share access to the same storage cell C. The caller of Newcounter can't get at this storage cell directly, but can affect it indirectly by calling the two functions. In other words, we've created a simple form of object.

let C₁ = newcounter unit in
let C₂ = newcounter unit in
// we've allocated two separate storage cells now!
let R₁ = C₁.i unit in
let R₂ = C₂.i unit in
R₂  // yields 1, not 2!

9.2.5. References to Compound Types🔗

A reference cell need not contain just a number: the primitives we've defined above allow us to create references to values of any type, including functions. For example, we can use references to functions to give a(n inefficient) implementation of arrays of numbers as follows.

Write NatArray for the type Ref (Nat→Nat).

To build a new array, we allocate a reference cell and fill it with a function that, when given an index, always returns 0.

Newarray = λ_:Unit. ref (λN:Nat.0)

To look up an element of an array, we apply the function to the desired index.

Lookup = λA:NatArray, λN:Nat. (!A) N

The interesting part of the encoding is the Update function. It takes an array, an index, and a new value to be stored at that index, and it does its job by creating (and storing in the reference) a new function that, when it is asked for the value at this very index, returns the new value that was given to Update, while on all other indices it passes the lookup to the function that was previously stored in the reference.

Update = \A:NatArray, \M:Nat, \V:Nat,
  let Oldf = !A in
  A := (λN:Nat. if Equal M N then V else Oldf N);

References to values containing other references can also be very useful, allowing us to define data structures such as mutable lists and trees.

9.2.6. Null References🔗

One more difference between our references and C-style mutable variables: null pointers.

  • In C, a pointer variable can contain either a valid pointer into the heap or the special value NULL.

  • A source of many errors and much tricky reasoning:

    • (any pointer may potentially be "not there")

    • but occasionally useful

  • Nullable pointers are easy to implement using references plus options (which can be built out of disjoint sum types):

Option τ       =  Unit + τ
NullableRef τ  =  Ref (Option τ)

9.2.7. Garbage Collection🔗

A last issue that we should mention before we move on with formalizing references is storage de-allocation. We have not provided any primitives for freeing reference cells when they are no longer needed. Instead, like many modern languages (including OCaml, Haskell, Java, etc.), we rely on the run-time system to perform garbage collection, automatically identifying and reusing cells that can no longer be reached by the program.

This is not just a question of taste in language design: it is extremely difficult to achieve type safety in the presence of an explicit deallocation operation; only the Rust language has made this practical, at the cost of significantly constraining the creation and use of aliases.

One reason for this difficulty is the familiar dangling reference problem: we allocate a cell holding a number, save a reference to it in some data structure, use it for a while, then deallocate it and allocate a new cell holding a boolean, possibly reusing the same storage. Now we can have two names for the same storage cell — one with type Ref Nat and the other with type Ref Bool.

9.3. Operational Semantics🔗

9.3.1. Locations🔗

A reference names a location in the store (a.k.a. heap).

What is the store?

  • Concretely: An array of 8-bit bytes, indexed by 32-bit integers.

  • More abstractly: a list or array of values

  • Even more abstractly: a partial function from locations to values.

We'll choose the middle way here: A store is a list of values, and a location is a natural-number index into this list.

9.3.2. Stores🔗

A store is just a list of values. (This more concrete representation will be more convenient for proofs than the functional representation we used in Imp.) We will use the Greek letter ρ to represent stores.

abbrev Store := List Tm

We use ρ[n] to retrieve the value of the reference cell at location n in the store ρ. Note that we must give a default value to nth in case we try looking up an index which is too large. (In fact, we never actually do this, but proving that we don't will require a bit of work.)

open scoped MyGetElem instance : MyGetElem Store Nat Tm where getElem ρ n := ρ.getD n <{unit}> @[simp] theorem Store_get_succ_tl (hd : Tm) (tl : Store) (n : Nat) : (hd :: tl)[n + 1] = tl[n] := hd:Tmtl:Storen:Nat⊢ (hd :: tl)[n + 1] = tl[n] All goals completed! 🐙 @[simp] theorem Store_get_zero_hd (hd : Tm) (tl : Store) : (hd :: tl)[0] = hd := hd:Tmtl:Store⊢ (hd :: tl)[0] = hd All goals completed! 🐙

To update the store, we use the List.set function, which replaces the contents of a cell at a particular index.

def List.set : (l : List α) → (n : Nat) → (a : α) → List α
  | cons _ as, 0,          b => cons b as
  | cons a as, Nat.succ n, b => cons a (set as n b)
  | nil,       _,          _ => nil

As might be expected, we will also need some technical lemmas; they are straightforward to prove.

theorem Store_get_set_eq (ρ : Store) (l : Nat) (x : Tm) (h : l < ρ.length) : (ρ.set l x)[l] = x := ρ:Storel:Natx:Tmh:l < List.length ρ⊢ (List.set ρ l x)[l] = x induction ρ generalizing l with x:Tml:Nath:l < [].length⊢ ([].set l x)[l] = x All goals completed! 🐙 x:Tmhd:Tmtl:List Tmih:∀ (l : Nat), l < tl.length → (tl.set l x)[l] = xl:Nath:l < (hd :: tl).length⊢ ((hd :: tl).set l x)[l] = x x:Tmhd:Tmtl:List Tmih:∀ (l : Nat), l < tl.length → (tl.set l x)[l] = xh:0 < (hd :: tl).length⊢ ((hd :: tl).set 0 x)[0] = xx:Tmhd:Tmtl:List Tmih:∀ (l : Nat), l < tl.length → (tl.set l x)[l] = xn✝:Nath:n✝ + 1 < (hd :: tl).length⊢ ((hd :: tl).set (n✝ + 1) x)[n✝ + 1] = x x:Tmhd:Tmtl:List Tmih:∀ (l : Nat), l < tl.length → (tl.set l x)[l] = xh:0 < (hd :: tl).length⊢ ((hd :: tl).set 0 x)[0] = xx:Tmhd:Tmtl:List Tmih:∀ (l : Nat), l < tl.length → (tl.set l x)[l] = xn✝:Nath:n✝ + 1 < (hd :: tl).length⊢ ((hd :: tl).set (n✝ + 1) x)[n✝ + 1] = x All goals completed! 🐙 theorem Store_get_set_neq (l₁ l₂ : Nat) (t : Tm) (ρ : Store) : l₁ ≠ l₂ -> (ρ.set l₂ t)[l₁] = ρ[l₁] := l₁:Natl₂:Natt:Tmρ:Store⊢ l₁ ≠ l₂ → (List.set ρ l₂ t)[l₁] = ρ[l₁] induction ρ generalizing l₁ l₂ with t:Tml₁:Natl₂:Nat⊢ l₁ ≠ l₂ → ([].set l₂ t)[l₁] = [][l₁] All goals completed! 🐙 t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]l₁:Natl₂:Nat⊢ l₁ ≠ l₂ → ((hd :: tl).set l₂ t)[l₁] = (hd :: tl)[l₁] t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]l₂:Nat⊢ 0 ≠ l₂ → ((hd :: tl).set l₂ t)[0] = (hd :: tl)[0]t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]l₂:Natn✝:Nat⊢ n✝ + 1 ≠ l₂ → ((hd :: tl).set l₂ t)[n✝ + 1] = (hd :: tl)[n✝ + 1] t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]l₂:Nat⊢ 0 ≠ l₂ → ((hd :: tl).set l₂ t)[0] = (hd :: tl)[0]t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]l₂:Natn✝:Nat⊢ n✝ + 1 ≠ l₂ → ((hd :: tl).set l₂ t)[n✝ + 1] = (hd :: tl)[n✝ + 1] t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]n✝:Nat⊢ n✝ + 1 ≠ 0 → ((hd :: tl).set 0 t)[n✝ + 1] = (hd :: tl)[n✝ + 1]t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]n✝¹:Natn✝:Nat⊢ n✝¹ + 1 ≠ n✝ + 1 → ((hd :: tl).set (n✝ + 1) t)[n✝¹ + 1] = (hd :: tl)[n✝¹ + 1] t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]⊢ 0 ≠ 0 → ((hd :: tl).set 0 t)[0] = (hd :: tl)[0]t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]n✝:Nat⊢ 0 ≠ n✝ + 1 → ((hd :: tl).set (n✝ + 1) t)[0] = (hd :: tl)[0]t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]n✝:Nat⊢ n✝ + 1 ≠ 0 → ((hd :: tl).set 0 t)[n✝ + 1] = (hd :: tl)[n✝ + 1]t:Tmhd:Tmtl:List Tmih:∀ (l₁ l₂ : Nat), l₁ ≠ l₂ → (tl.set l₂ t)[l₁] = tl[l₁]n✝¹:Natn✝:Nat⊢ n✝¹ + 1 ≠ n✝ + 1 → ((hd :: tl).set (n✝ + 1) t)[n✝¹ + 1] = (hd :: tl)[n✝¹ + 1] All goals completed! 🐙

9.3.3. Reduction🔗

First, we augment existing reduction rules with stores:

            v₂.IsValue
------------------------------------ (appAbs)
(λx:τ₂. t₁) v₂ / ρ ⟶ [x:=v₂] t₁ / ρ

            t₁ / ρ ⟶ t₁' / ρ'
---------------------------------    (app₁)
         t₁ t₂ / ρ ⟶ t₁' t₂ / ρ'

           v₁.IsValue
            t₂ / ρ ⟶ t₂' / ρ'
---------------------------------    (app₂)
         v₁ t₂ / ρ ⟶ v₁ t₂' / ρ'

Now we can give the rules for the new constructs:

------------------------------------    (refValue)
     ref v / ρ ⟶ loc ρ.length / ρ,v

        t₁ / ρ ⟶ t₁' / ρ'
------------------------------          (ref)
    ref t₁ / ρ ⟶ ref t₁' / ρ'

      l < ρ.length
--------------------------              (derefLoc)
  !(loc l) / ρ ⟶ ρ[l] / ρ

        t₁ / ρ ⟶ t₁' / ρ'
---------------------------             (deref)
       !t₁ / ρ ⟶ !t₁' / ρ'

             l < ρ.length
--------------------------------------- (assign)
loc l := v / ρ ⟶ unit / List.set ρ l v

        t₁ / ρ ⟶ t₁' / ρ'
--------------------------------        (assign₁)
  t₁ := t₂ / ρ ⟶ t₁' := t₂ / ρ'

        t₂ / ρ ⟶ t₂' / ρ'
--------------------------------        (assign₂)
  v₁ := t₂ / ρ ⟶ v₁ := t₂' / ρ'
Notationsection set_option hygiene false in local notation:40 t:71 " / " ρ:41 " ⟶ " t':71 " / " ρ':41 => Step (t, ρ) (t', ρ')
inductive Step : Tm × Store → Tm × Store → Prop where -- pure STLC | appAbs {x : String} {τ₂ : Ty} {t₁ v₂ : Tm} {ρ : Store} (h : v₂.IsValue) : <{(λ x : τ₂ . t₁) v₂}> / ρ ⟶ <{ [x := v₂] t₁ }> / ρ | app₁ {t₁ t₁' t₂ : Tm} {ρ ρ' : Store} (h : t₁ / ρ ⟶ t₁' / ρ') : <{t₁ t₂}> / ρ ⟶ <{t₁' t₂}> / ρ' | app₂ {v₁ t₂ t₂' : Tm} {ρ ρ' : Store} (h₁ : v₁.IsValue) (h₂ : t₂ / ρ ⟶ t₂' / ρ') : <{v₁ t₂}> / ρ ⟶ <{v₁ t₂'}> / ρ' -- numbers | succNat {n : Nat} {ρ : Store} : <{ succ ~(Tm.const n) }> / ρ ⟶ Tm.const (n + 1) / ρ | succ {t₁ t₁' : Tm} {ρ ρ' : Store} (h : t₁ / ρ ⟶ t₁' / ρ') : <{ succ t₁ }> / ρ ⟶ <{ succ t₁' }> / ρ' | predConst {n : Nat} {ρ : Store} : <{ pred ~(Tm.const n) }> / ρ ⟶ Tm.const (n - 1) / ρ | pred {t₁ t₁' : Tm} {ρ ρ' : Store} (h : t₁ / ρ ⟶ t₁' / ρ') : <{ pred t₁ }> / ρ ⟶ <{ pred t₁' }> / ρ' | multConst {n₁ n₂ : Nat} {ρ : Store} : <{ ~(Tm.const n₁) * ~(Tm.const n₂) }> / ρ ⟶ Tm.const (n₁ * n₂) / ρ | mult₁ {t₁ t₁' t₂ : Tm} {ρ ρ' : Store} (h : t₁ / ρ ⟶ t₁' / ρ') : <{ t₁ * t₂ }> / ρ ⟶ <{ t₁' * t₂ }> / ρ' | mult₂ {v₁ t₂ t₂' : Tm} {ρ ρ' : Store} (h₁ : v₁.IsValue) (h₂ : t₂ / ρ ⟶ t₂' / ρ') : <{ v₁ * t₂ }> / ρ ⟶ <{ v₁ * t₂' }> / ρ' | if0Step {t₁ t₁' t₂ t₃ : Tm} {ρ ρ' : Store} (h : t₁ / ρ ⟶ t₁' / ρ') : <{ if0 t₁ then t₂ else t₃ }> / ρ ⟶ <{ if0 t₁' then t₂ else t₃ }> / ρ' | if0Zero {t₂ t₃ : Tm} {ρ : Store} : <{ if0 0 then t₂ else t₃ }> / ρ ⟶ t₂ / ρ | if0Nonzero {n : Nat} {t₂ t₃ : Tm} {ρ : Store} : <{ if0 ~(Tm.const (n + 1)) then t₂ else t₃ }> / ρ ⟶ t₃ / ρ -- references | refValue {v : Tm} {ρ : Store} (h : v.IsValue) : <{ ref v }> / ρ ⟶ Tm.loc ρ.length / ρ.concat v | ref_ {t₁ t₁' : Tm} {ρ ρ' : Store} (h : t₁ / ρ ⟶ t₁' / ρ') : <{ ref t₁ }> / ρ ⟶ <{ ref t₁' }> / ρ' | derefLoc {l : Nat} {ρ : Store} (h : l < ρ.length) : <{ !~(Tm.loc l) }> / ρ ⟶ ρ[l] / ρ | deref {t₁ t₁' : Tm} {ρ ρ' : Store} (h : t₁ / ρ ⟶ t₁' / ρ') : <{ !t₁ }> / ρ ⟶ <{ !t₁' }> / ρ' | assign {v : Tm} {l : Nat} {ρ : Store} (h₁ : v.IsValue) (h₂ : l < ρ.length) : <{ ~(Tm.loc l) := v }> / ρ ⟶ <{ unit }> / ρ.set l v | assign₁ {t₁ t₁' t₂ : Tm} {ρ ρ' : Store} (h : t₁ / ρ ⟶ t₁' / ρ') : <{ t₁ := t₂ }> / ρ ⟶ <{ t₁' := t₂ }> / ρ' | assign₂ {v₁ t₂ t₂' : Tm} {ρ ρ' : Store} (h₁ : v₁.IsValue) (h₂ : t₂ / ρ ⟶ t₂' / ρ') : <{ v₁ := t₂ }> / ρ ⟶ <{ v₁ := t₂' }> / ρ' end attribute [StlcRefEval] Step.appAbs Step.app₁ Step.app₂ Step.succ Step.succNat Step.pred Step.predConst Step.multConst Step.mult₁ Step.mult₂ Step.if0Step Step.if0Zero Step.if0Nonzero Step.refValue Step.ref_ Step.derefLoc Step.deref Step.assign Step.assign₁ Step.assign₂
Notationscoped notation:40 t:71 " / " ρ:41 " ⟶ " t':71 " / " ρ':41 => Step (t, ρ) (t', ρ') scoped notation:40 t:71 " / " ρ:41 " ⟶* " t':71 " / " ρ':41 => Multi Step (t, ρ) (t', ρ')

9.4. Typing🔗

The contexts assigning types to free variables are exactly the same as for the STLC: partial maps from identifiers to types.

abbrev Context := PartialMap String Ty

9.4.1. Store typings🔗

Naturally, the key question is, "What is the type of a location?"

As a first try, observe that the type of a location is connected to the contents of the store ρ.

 Γ ⊢ ρ[l] : τ₁
------------------
Γ ⊢ loc l : Ref τ₁

But where does ρ come from?

We could try adding ρ to the judgment: Γ; ρ ⊢ t : τ, which gives us this rule:

 Γ; ρ ⊢ ρ[l] : τ₁
---------------------
Γ; ρ ⊢ loc l : Ref τ₁

But that means the whole store ρ, including all dynamically created values, is needed during typechecking. This does not seem like something we want.

Worse yet, it doesn't work at all for cyclic stores.

For example, what is the type of location 0 in the following store?

λX:Nat. (!(loc 1)) X, λX:Nat. (!(loc 0)) X

Instead, we establish an invariant that the type of value stored in a location never changes.

This static representation of the store contents is called a store typing:

abbrev StoreTy := List Ty

Here we represent locations as indices into a list of types so the type at index i is the type of the values stored in cell i.

open scoped MyGetElem instance : MyGetElem StoreTy Nat Ty where getElem δ n := δ.getD n <{Unit}> @[simp] theorem StoreTy_get_succ_tl (hd : Ty) (tl : StoreTy) (n : Nat) : (hd :: tl)[n + 1] = tl[n] := hd:Tytl:StoreTyn:Nat⊢ (hd :: tl)[n + 1] = tl[n] All goals completed! 🐙 @[simp] theorem StoreTy_get_zero_hd (hd : Ty) (tl : StoreTy) : (hd :: tl)[0] = hd := hd:Tytl:StoreTy⊢ (hd :: tl)[0] = hd All goals completed! 🐙

We can use the store typing δ to give a type to any location l like this:

     l < δ.length
-----------------------
Γ; δ ⊢ loc l : Ref δ[l]

That is, as long as l is a valid location, we can compute the type of l just by looking it up in δ. Typing is again a four-place relation, but it is parameterized on a store typing rather than a concrete store. The rest of the typing rules are analogously augmented with store typings.

9.4.2. The Typing Relation🔗

     l < δ.length
-----------------------  (loc)
Γ; δ ⊢ loc l : Ref δ[l]

    Γ; δ ⊢ t₁ : τ₁
----------------------   (ref)
Γ; δ ⊢ ref t₁ : Ref τ₁

  Γ; δ ⊢ t₁ : Ref τ₁
  ------------------     (deref)
  Γ; δ ⊢ !t₁ : τ₁

  Γ; δ ⊢ t₁ : Ref τ₂
    Γ; δ ⊢ t₂ : τ₂
----------------------   (assign)
Γ; δ ⊢ t₁ := t₂ : Unit
inductive HasType (δ : StoreTy) : Context → Tm → Ty → Prop where -- pure STLC | var {Γ : Context} {x : String} {τ₁ : Ty} (h : Γ[x] = some τ₁) : <{ Γ / δ ⊢ ~(Tm.var x) ⦂ τ₁ }> | abs {Γ : Context} {x : String} {τ₁ τ₂ : Ty} {t₁ : Tm} (h : <{ x ↦ τ₂ ; Γ / δ ⊢ t₁ ⦂ τ₁ }>) : <{ Γ / δ ⊢ λ x : τ₂ . t₁ ⦂ τ₂ → τ₁ }> | app {Γ : Context} {τ₁ τ₂ : Ty} {t₁ t₂ : Tm} (h₁ : <{ Γ / δ ⊢ t₁ ⦂ τ₂ → τ₁ }>) (h₂ : <{ Γ / δ ⊢ t₂ ⦂ τ₂ }>) : <{ Γ / δ ⊢ t₁ t₂ ⦂ τ₁ }> -- numbers | const {Γ : Context} {n : Nat} : <{ Γ / δ ⊢ ~(Tm.const n) ⦂ Nat }> | succ {Γ : Context} {t₁ : Tm} (h : <{ Γ / δ ⊢ t₁ ⦂ Nat }>) : <{ Γ / δ ⊢ succ t₁ ⦂ Nat }> | pred {Γ : Context} {t₁ : Tm} (h : <{ Γ / δ ⊢ t₁ ⦂ Nat }>) : <{ Γ / δ ⊢ pred t₁ ⦂ Nat }> | mult {Γ : Context} {t₁ t₂ : Tm} (h₁ : <{ Γ / δ ⊢ t₁ ⦂ Nat }>) (h₂ : <{ Γ / δ ⊢ t₂ ⦂ Nat }>) : <{ Γ / δ ⊢ t₁ * t₂ ⦂ Nat }> | ite0 {Γ : Context} {t₁ t₂ t₃ : Tm} {τ : Ty} (h₁ : <{ Γ / δ ⊢ t₁ ⦂ Nat }>) (h₂ : <{ Γ / δ ⊢ t₂ ⦂ τ }>) (h₃ : <{ Γ / δ ⊢ t₃ ⦂ τ }>) : <{ Γ / δ ⊢ if0 t₁ then t₂ else t₃ ⦂ τ }> -- unit | unit {Γ : Context} : <{ Γ / δ ⊢ unit ⦂ Unit }> -- references | loc_ {Γ : Context} {l : Nat} (h : l < δ.length) : <{ Γ / δ ⊢ ~(Tm.loc l) ⦂ Ref ~(δ[l]) }> | ref_ {Γ : Context} {t₁ : Tm} {τ₁ : Ty} (h : <{ Γ / δ ⊢ t₁ ⦂ τ₁ }>) : <{ Γ / δ ⊢ ref t₁ ⦂ Ref τ₁ }> | deref {Γ : Context} {t₁ : Tm} {τ₁ : Ty} (h : <{ Γ / δ ⊢ t₁ ⦂ Ref τ₁ }>) : <{ Γ / δ ⊢ !t₁ ⦂ τ₁ }> | assign {Γ : Context} {t₁ t₂ : Tm} {τ₂ : Ty} (h₁ : <{ Γ / δ ⊢ t₁ ⦂ Ref τ₂ }>) (h₂ : <{ Γ / δ ⊢ t₂ ⦂ τ₂ }>) : <{ Γ / δ ⊢ t₁ := t₂ ⦂ Unit }> attribute [StlcRefTyping] HasType.var HasType.abs HasType.app HasType.const HasType.succ HasType.pred HasType.mult HasType.ite0 HasType.unit HasType.loc_ HasType.ref_ HasType.deref HasType.assign
Notation encodingopen Lean PrettyPrinter StlcCommon.Delab in @[app_unexpander HasType] def HasType.unexpand : Unexpander | `($_ $δ $Γ $t $T) => do let Γ' ← unexpandCtx Γ `(<{ $Γ':stlcCtx / $δ ⊢ $(getTm t):stlcTm ⦂ $(getTy T):stlcTy }>) | _ => throw ()

9.5. Properties🔗

Standard theorems...

  • Progress — pretty much same as always

  • Preservation — needs to be stated more carefully!

9.5.1. Well-Typed Stores🔗

The evaluation and typing relations take more parameters now, but nothing yet relates them...

theorem progress_wrong (δ : StoreTy) (t : Tm) (τ : Ty) (ρ : Store) (hTy : <{ ∅ / δ ⊢ t ⦂ τ }>) : (t.IsValue ∨ ∃ t' ρ', t / ρ ⟶ t' / ρ') := unsolved goals δ:StoreTyt:Tmτ:Tyρ:StorehTy:<{ ∅ / δ ⊢ t ⦂ τ }>⊢ t.IsValue ∨ ∃ t' ρ', t / ρ ⟶ t' / ρ'by

Obviously wrong: no relation between assumed store typing and provided store!

We need a way of saying "this store satisfies the assumptions of that store typing"...

def StoreWellTyped (δ:StoreTy) (ρ:Store) := δ.length = ρ.length ∧ (∀ (l : Nat), l < ρ.length → <{ ∅ / δ ⊢ ~(ρ[l]) ⦂ ~(δ[l]) }>)

Informally, we will write δ ⊢ ρ for StoreWellTyped δ ρ.

scoped notation:40 δ:41 " ⊢ " ρ:41 => StoreWellTyped δ ρ

Intuitively, a store ρ is consistent with a store typing δ if every value in the store has the type predicted by the store typing. The only subtle point is the fact that, when typing the values in the store, we supply the very same store typing to the typing relation. This allows us to type circular stores like the one we saw above.

9.5.2. Progress🔗

The Progress proof is very similar to the one for the STLC, with a few new cases for the new syntactic constructs. The deref and assign cases are where hStoreTy comes in.

theorem progress (δ : StoreTy) (t : Tm) (τ : Ty) (ρ : Store) (hTy : <{ ∅ / δ ⊢ t ⦂ τ }>) (hStoreTy : δ ⊢ ρ) : (t.IsValue ∨ ∃ t' ρ', t / ρ ⟶ t' / ρ') := δ:StoreTyt:Tmτ:Tyρ:StorehTy:<{ ∅ / δ ⊢ t ⦂ τ }>hStoreTy:δ ⊢ ρ⊢ t.IsValue ∨ ∃ t' ρ', t / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehTy:<{ ∅ / δ ⊢ t ⦂ τ }>hStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ t.IsValue ∨ ∃ t' ρ', t / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextheq:∅ = ΓhTy:<{ Γ / δ ⊢ t ⦂ τ }>⊢ t.IsValue ∨ ∃ t' ρ', t / ρ ⟶ t' / ρ' induction hTy with (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextl✝:Nath✝:l✝ < List.length δ⊢ (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'; first | δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextl✝:Nath✝:l✝ < List.length δ⊢ (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ' -- discharge cases where `t` is obviously a value | try (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextl✝:Nath✝:l✝ < List.length δ⊢ (Tm.loc l✝).IsValue; All goals completed! 🐙; done)) δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'⊢ <{ t₁✝ t₂✝ }>.IsValue ∨ ∃ t' ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ'; cases ih₁ (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'⊢ ∅ = ∅ All goals completed! 🐙) with -- t₁ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValue⊢ ∃ t' ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ' cases ih₂ (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValue⊢ ∅ = ∅ All goals completed! 🐙) with -- t₂ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehv₂:t₂✝.IsValue⊢ ∃ t' ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝¹:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ τ₂✝¹ → τ₁✝ }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ (λ ~x✝ : τ₂✝ . t₁✝) t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuen✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ τ₂✝ → τ₁✝ }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValueh₁:<{ ∅ / δ ⊢ unit ⦂ τ₂✝ → τ₁✝ }>ih₁:∅ = ∅ → <{ unit }>.IsValue ∨ ∃ t' ρ', <{ unit }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ unit t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuel✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ τ₂✝ → τ₁✝ }>ih₁:∅ = ∅ → (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.loc l✝) t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝¹:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ τ₂✝¹ → τ₁✝ }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ (λ ~x✝ : τ₂✝ . t₁✝) t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuen✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ τ₂✝ → τ₁✝ }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValueh₁:<{ ∅ / δ ⊢ unit ⦂ τ₂✝ → τ₁✝ }>ih₁:∅ = ∅ → <{ unit }>.IsValue ∨ ∃ t' ρ', <{ unit }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ unit t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuel✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ τ₂✝ → τ₁✝ }>ih₁:∅ = ∅ → (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.loc l✝) t₂✝ }> / ρ ⟶ t' / ρ' try All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝¹:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ τ₂✝¹ → τ₁✝ }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ ρ', <{ (λ ~x✝ : τ₂✝ . t₁✝) t₂✝ }> / ρ ⟶ ?app.inl.inl.abs.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝¹:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ τ₂✝¹ → τ₁✝ }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝¹:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ τ₂✝¹ → τ₁✝ }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ <{ (λ ~x✝ : τ₂✝ . t₁✝) t₂✝ }> / ρ ⟶ ?app.inl.inl.abs.w / ?app.inl.inl.abs.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝¹:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ τ₂✝¹ → τ₁✝ }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝¹:Tyt₂✝:Tmh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ τ₂✝¹ → τ₁✝ }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ Tm; All goals completed! 🐙 -- t₂ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ ∃ t' ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ ∃ ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ ?app.inl.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ <{ t₁✝ t₂✝ }> / ρ ⟶ ?app.inl.inr.w / ?app.inl.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ Tm; All goals completed! 🐙 -- t₁ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ t' ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ ρ', <{ t₁✝ t₂✝ }> / ρ ⟶ ?app.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ <{ t₁✝ t₂✝ }> / ρ ⟶ ?app.inr.w / ?app.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ <{ succ t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ succ t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ <{ pred t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ pred t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ <{ pred t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ pred t₁✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ <{ succ t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ succ t₁✝ }> / ρ ⟶ t' / ρ' -- these two cases are the same δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred t₁✝ }> / ρ ⟶ t' / ρ'; cases ih (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∅ = ∅ All goals completed! 🐙) with -- t₁ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ ∃ t' ρ', <{ pred t₁✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ ∃ t' ρ', <{ succ t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextx✝:Stringτ₂✝:Tyt₁✝:Tmh:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ Nat }>ih:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred (λ ~x✝ : τ₂✝ . t₁✝) }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred ~(Tm.const n✝) }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contexth:<{ ∅ / δ ⊢ unit ⦂ Nat }>ih:∅ = ∅ → <{ unit }>.IsValue ∨ ∃ t' ρ', <{ unit }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred unit }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextl✝:Nath:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred ~(Tm.loc l✝) }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextx✝:Stringτ₂✝:Tyt₁✝:Tmh:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ Nat }>ih:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred (λ ~x✝ : τ₂✝ . t₁✝) }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred ~(Tm.const n✝) }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contexth:<{ ∅ / δ ⊢ unit ⦂ Nat }>ih:∅ = ∅ → <{ unit }>.IsValue ∨ ∃ t' ρ', <{ unit }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred unit }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextl✝:Nath:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred ~(Tm.loc l✝) }> / ρ ⟶ t' / ρ' try All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ ρ', <{ pred ~(Tm.const n✝) }> / ρ ⟶ ?pred.inl.nat.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ <{ pred ~(Tm.const n✝) }> / ρ ⟶ ?pred.inl.nat.w / ?pred.inl.nat.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ Tm; All goals completed! 🐙 -- t₁ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ pred t₁✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ succ t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ t' ρ', <{ pred t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ ρ', <{ pred t₁✝ }> / ρ ⟶ ?pred.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ <{ pred t₁✝ }> / ρ ⟶ ?pred.inr.w / ?pred.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmh:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'⊢ <{ t₁✝ * t₂✝ }>.IsValue ∨ ∃ t' ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ'; cases ih₁ (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'⊢ ∅ = ∅ All goals completed! 🐙) with -- t₁ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValue⊢ ∃ t' ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ' cases ih₂ (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValue⊢ ∅ = ∅ All goals completed! 🐙) with -- t₂ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehv₂:t₂✝.IsValue⊢ ∃ t' ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ Nat }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ (λ ~x✝ : τ₂✝ . t₁✝) * t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuen✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) * t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValueh₁:<{ ∅ / δ ⊢ unit ⦂ Nat }>ih₁:∅ = ∅ → <{ unit }>.IsValue ∨ ∃ t' ρ', <{ unit }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ unit * t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuel✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.loc l✝) * t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuex✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ Nat }>ih₁:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ (λ ~x✝ : τ₂✝ . t₁✝) * t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuen✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) * t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValueh₁:<{ ∅ / δ ⊢ unit ⦂ Nat }>ih₁:∅ = ∅ → <{ unit }>.IsValue ∨ ∃ t' ρ', <{ unit }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ unit * t₂✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₂:t₂✝.IsValuel✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.loc l✝) * t₂✝ }> / ρ ⟶ t' / ρ' try All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'x✝:Stringτ₂✝:Tyt₁✝:Tmh₂:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ Nat }>ih₂:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) * (λ ~x✝ : τ₂✝ . t₁✝) }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝¹:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'n✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝¹) * ~(Tm.const n✝) }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'h₂:<{ ∅ / δ ⊢ unit ⦂ Nat }>ih₂:∅ = ∅ → <{ unit }>.IsValue ∨ ∃ t' ρ', <{ unit }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) * unit }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'l✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) * ~(Tm.loc l✝) }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'x✝:Stringτ₂✝:Tyt₁✝:Tmh₂:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ Nat }>ih₂:∅ = ∅ → <{ λ ~x✝ : τ₂✝ . t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) * (λ ~x✝ : τ₂✝ . t₁✝) }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝¹:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'n✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝¹) * ~(Tm.const n✝) }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'h₂:<{ ∅ / δ ⊢ unit ⦂ Nat }>ih₂:∅ = ∅ → <{ unit }>.IsValue ∨ ∃ t' ρ', <{ unit }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) * unit }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'l✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.loc l✝).IsValue ∨ ∃ t' ρ', Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ~(Tm.const n✝) * ~(Tm.loc l✝) }> / ρ ⟶ t' / ρ' try All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝¹:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'n✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ ∃ ρ', <{ ~(Tm.const n✝¹) * ~(Tm.const n✝) }> / ρ ⟶ ?mult.inl.inl.nat.nat.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝¹:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'n✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝¹:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'n✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ <{ ~(Tm.const n✝¹) * ~(Tm.const n✝) }> / ρ ⟶ ?mult.inl.inl.nat.nat.w / ?mult.inl.inl.nat.nat.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝¹:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'n✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextn✝¹:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'n✝:Nath₂:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih₂:∅ = ∅ → (Tm.const n✝).IsValue ∨ ∃ t' ρ', Tm.const n✝ / ρ ⟶ t' / ρ'⊢ Tm; All goals completed! 🐙 -- t₂ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ ∃ t' ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ ∃ ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ ?mult.inl.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ <{ t₁✝ * t₂✝ }> / ρ ⟶ ?mult.inl.inr.w / ?mult.inl.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂✝:∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ't₂':Tmρ':Storehs₂:t₂✝ / ρ ⟶ t₂' / ρ'⊢ Tm; All goals completed! 🐙 -- t₁ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ t' ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ ρ', <{ t₁✝ * t₂✝ }> / ρ ⟶ ?mult.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ <{ t₁✝ * t₂✝ }> / ρ ⟶ ?mult.inr.w / ?mult.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'⊢ <{ if0 t₁✝ then t₂✝ else t₃✝ }>.IsValue ∨ ∃ t' ρ', <{ if0 t₁✝ then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ if0 t₁✝ then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ'; cases ih₁ (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'⊢ ∅ = ∅ All goals completed! 🐙) with -- t₁ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValue⊢ ∃ t' ρ', <{ if0 t₁✝ then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ' cases hv₁ with (try All goals completed! 🐙) δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'n:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const n).IsValue ∨ ∃ t' ρ', Tm.const n / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ if0 ~(Tm.const n) then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'h₁:<{ ∅ / δ ⊢ 0 ⦂ Nat }>ih₁:∅ = ∅ → <{ 0 }>.IsValue ∨ ∃ t' ρ', <{ 0 }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ if0 0 then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'n✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const (n✝ + 1)).IsValue ∨ ∃ t' ρ', Tm.const (n✝ + 1) / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ if0 ~(Tm.const (n✝ + 1)) then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'h₁:<{ ∅ / δ ⊢ 0 ⦂ Nat }>ih₁:∅ = ∅ → <{ 0 }>.IsValue ∨ ∃ t' ρ', <{ 0 }> / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ if0 0 then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'n✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const (n✝ + 1)).IsValue ∨ ∃ t' ρ', Tm.const (n✝ + 1) / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ if0 ~(Tm.const (n✝ + 1)) then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ' (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'n✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const (n✝ + 1)).IsValue ∨ ∃ t' ρ', Tm.const (n✝ + 1) / ρ ⟶ t' / ρ'⊢ ∃ ρ', <{ if0 ~(Tm.const (n✝ + 1)) then t₂✝ else t₃✝ }> / ρ ⟶ ?ite0.inl.nat.succ.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'n✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const (n✝ + 1)).IsValue ∨ ∃ t' ρ', Tm.const (n✝ + 1) / ρ ⟶ t' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'n✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const (n✝ + 1)).IsValue ∨ ∃ t' ρ', Tm.const (n✝ + 1) / ρ ⟶ t' / ρ'⊢ <{ if0 ~(Tm.const (n✝ + 1)) then t₂✝ else t₃✝ }> / ρ ⟶ ?ite0.inl.nat.succ.w / ?ite0.inl.nat.succ.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'n✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const (n✝ + 1)).IsValue ∨ ∃ t' ρ', Tm.const (n✝ + 1) / ρ ⟶ t' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'n✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>ih₁:∅ = ∅ → (Tm.const (n✝ + 1)).IsValue ∨ ∃ t' ρ', Tm.const (n✝ + 1) / ρ ⟶ t' / ρ'⊢ Tm; All goals completed! 🐙) -- t₁ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'hs₁:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ if0 t₁✝ then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ t' ρ', <{ if0 t₁✝ then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ ρ', <{ if0 t₁✝ then t₂✝ else t₃✝ }> / ρ ⟶ ?ite0.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ <{ if0 t₁✝ then t₂✝ else t₃✝ }> / ρ ⟶ ?ite0.inr.w / ?ite0.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂✝:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃✝:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'h₂_ih✝:∅ = ∅ → t₂✝.IsValue ∨ ∃ t' ρ', t₂✝ / ρ ⟶ t' / ρ'h₃_ih✝:∅ = ∅ → t₃✝.IsValue ∨ ∃ t' ρ', t₃✝ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ <{ ref t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ ref t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ref t₁✝ }> / ρ ⟶ t' / ρ'; cases ih (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∅ = ∅ All goals completed! 🐙) with -- t₁ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ ∃ t' ρ', <{ ref t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ ∃ ρ', <{ ref t₁✝ }> / ρ ⟶ ?ref_.inl.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ <{ ref t₁✝ }> / ρ ⟶ ?ref_.inl.w / ?ref_.inl.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ Tm; All goals completed! 🐙 -- t₁ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ ref t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ t' ρ', <{ ref t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ ρ', <{ ref t₁✝ }> / ρ ⟶ ?ref_.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ <{ ref t₁✝ }> / ρ ⟶ ?ref_.inr.w / ?ref_.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ <{ !t₁✝ }>.IsValue ∨ ∃ t' ρ', <{ !t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ !t₁✝ }> / ρ ⟶ t' / ρ'; cases ih (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∅ = ∅ All goals completed! 🐙) with -- t₁ is a value; its typing tells us `l < δ.length`, and -- `hLen` turns this into `l < ρ.length`, so `ρ[l]` is -- actually defined and we can step to it δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hv:t₁✝.IsValue⊢ ∃ t' ρ', <{ !t₁✝ }> / ρ ⟶ t' / ρ' cases hv with (All goals completed! 🐙) δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextl:Natih:∅ = ∅ → (Tm.loc l).IsValue ∨ ∃ t' ρ', Tm.loc l / ρ ⟶ t' / ρ'h✝:l < List.length δ⊢ ∃ t' ρ', <{ !~(Tm.loc l) }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextl:Natih:∅ = ∅ → (Tm.loc l).IsValue ∨ ∃ t' ρ', Tm.loc l / ρ ⟶ t' / ρ'h✝:l < List.length δ⊢ <{ !~(Tm.loc l) }> / ρ ⟶ ρ[l] / ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextl:Natih:∅ = ∅ → (Tm.loc l).IsValue ∨ ∃ t' ρ', Tm.loc l / ρ ⟶ t' / ρ'h✝:l < List.length δ⊢ l < List.length ρ; All goals completed! 🐙 -- t₁ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ !t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ t' ρ', <{ !t₁✝ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ ρ', <{ !t₁✝ }> / ρ ⟶ ?deref.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ <{ !t₁✝ }> / ρ ⟶ ?deref.inr.w / ?deref.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'hs✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'⊢ <{ t₁✝ := t₂ }>.IsValue ∨ ∃ t' ρ', <{ t₁✝ := t₂ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ := t₂ }> / ρ ⟶ t' / ρ'; cases ih₁ (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'⊢ ∅ = ∅ All goals completed! 🐙) with -- t₁ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValue⊢ ∃ t' ρ', <{ t₁✝ := t₂ }> / ρ ⟶ t' / ρ' cases ih₂ (δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValue⊢ ∅ = ∅ All goals completed! 🐙) with -- t₂ is a value δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehv₂:t₂.IsValue⊢ ∃ t' ρ', <{ t₁✝ := t₂ }> / ρ ⟶ t' / ρ' -- as in `deref`, `hLen` turns `l < δ.length` into -- `l < ρ.length`, so `ρ.set l t₂` is well defined cases hv₁ with (All goals completed! 🐙) δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂:Tmih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₂:t₂.IsValuel:Natih₁:∅ = ∅ → (Tm.loc l).IsValue ∨ ∃ t' ρ', Tm.loc l / ρ ⟶ t' / ρ'h✝:l < List.length δh₂✝:<{ ∅ / δ ⊢ t₂ ⦂ ~δ[l] }>⊢ ∃ t' ρ', <{ ~(Tm.loc l) := t₂ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂:Tmih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₂:t₂.IsValuel:Natih₁:∅ = ∅ → (Tm.loc l).IsValue ∨ ∃ t' ρ', Tm.loc l / ρ ⟶ t' / ρ'h✝:l < List.length δh₂✝:<{ ∅ / δ ⊢ t₂ ⦂ ~δ[l] }>⊢ <{ ~(Tm.loc l) := t₂ }> / ρ ⟶ <{ unit }> / List.set ρ l t₂; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₂:Tmih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₂:t₂.IsValuel:Natih₁:∅ = ∅ → (Tm.loc l).IsValue ∨ ∃ t' ρ', Tm.loc l / ρ ⟶ t' / ρ'h✝:l < List.length δh₂✝:<{ ∅ / δ ⊢ t₂ ⦂ ~δ[l] }>⊢ l < List.length ρ; All goals completed! 🐙 -- t₂ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ := t₂ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂ / ρ ⟶ t' / ρ'w✝¹:Tmw✝:Storeh✝:t₂ / ρ ⟶ w✝¹ / w✝⊢ ∃ t' ρ', <{ t₁✝ := t₂ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂ / ρ ⟶ t' / ρ'w✝¹:Tmw✝:Storeh✝:t₂ / ρ ⟶ w✝¹ / w✝⊢ ∃ ρ', <{ t₁✝ := t₂ }> / ρ ⟶ ?assign.inl.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂ / ρ ⟶ t' / ρ'w✝¹:Tmw✝:Storeh✝:t₂ / ρ ⟶ w✝¹ / w✝⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂ / ρ ⟶ t' / ρ'w✝¹:Tmw✝:Storeh✝:t₂ / ρ ⟶ w✝¹ / w✝⊢ <{ t₁✝ := t₂ }> / ρ ⟶ ?assign.inl.inr.w / ?assign.inl.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂ / ρ ⟶ t' / ρ'w✝¹:Tmw✝:Storeh✝:t₂ / ρ ⟶ w✝¹ / w✝⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hv₁:t₁✝.IsValuehs₂:∃ t' ρ', t₂ / ρ ⟶ t' / ρ'w✝¹:Tmw✝:Storeh✝:t₂ / ρ ⟶ w✝¹ / w✝⊢ Tm; All goals completed! 🐙 -- t₁ steps δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hs₁:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'⊢ ∃ t' ρ', <{ t₁✝ := t₂ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ t' ρ', <{ t₁✝ := t₂ }> / ρ ⟶ t' / ρ' δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ ∃ ρ', <{ t₁✝ := t₂ }> / ρ ⟶ ?assign.inr.w / ρ'δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ <{ t₁✝ := t₂ }> / ρ ⟶ ?assign.inr.w / ?assign.inr.h.wδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Storeδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρhLen:List.length δ = List.length ρright✝:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmt₂:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂✝:<{ ∅ / δ ⊢ t₂ ⦂ τ₂✝ }>ih₁:∅ = ∅ → t₁✝.IsValue ∨ ∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ'ih₂:∅ = ∅ → t₂.IsValue ∨ ∃ t' ρ', t₂ / ρ ⟶ t' / ρ'hs₁✝:∃ t' ρ', t₁✝ / ρ ⟶ t' / ρ't₁':Tmρ':Storehs₁:t₁✝ / ρ ⟶ t₁' / ρ'⊢ Tm; All goals completed! 🐙

9.5.3. Extending Store Typings🔗

Having proved progress, let's turn our attention to preservation. Here is a first attempt at stating it, using the StoreWellTyped relation we just defined:

theorem preservation_wrong (δ : StoreTy) (τ : Ty) (t t' : Tm) (ρ ρ' : Store) : <{ ∅ / δ ⊢ t ⦂ τ }> → t / ρ ⟶ t' / ρ' → δ ⊢ ρ → <{ ∅ / δ ⊢ t' ⦂ τ }> := unsolved goals δ:StoreTyτ:Tyt t':Tmρ ρ':Store⊢ <{ ∅ / δ ⊢ t ⦂ τ }> → t / ρ ⟶ t' / ρ' → δ ⊢ ρ → <{ ∅ / δ ⊢ t' ⦂ τ }>by

This works... for all but one of the reduction rules! (Which?)

The refValue rule is the problem

-------------------------- (refValue)
ref v / ρ ⟶ loc |ρ| / ρ,v

It allocates a fresh location l and adds it to the store, but the store typing δ doesn't know about l, so t' won't be typeable under δ.

For example, the term ref 5 is typeable in the ∅ context and ∅ store typing, but it steps to loc 0, which is not typeable with an ∅ store typing.

Intuition: Since the store can grow during reduction, we need to let the store typing grow too...

inductive Extends : StoreTy → StoreTy → Prop where | nil (δ' : StoreTy) : Extends δ' [] | cons (τ : Ty) {δ' δ : StoreTy} (h : Extends δ' δ) : Extends (τ::δ') (τ::δ) attribute [StlcRefTyping] Extends.nil Extends.cons

For example, the store typing [Nat] with a single location of type Nat extends the empty store typing.

We'll need a few technical lemmas about extended contexts. First, looking up a type in an extended store typing yields the same result as in the original:

theorem extends_lookup {l : Nat} {δ δ' : StoreTy} (h₁ : l < δ.length) (h₂ : Extends δ' δ) : δ'[l] = δ[l] := l:Natδ:StoreTyδ':StoreTyh₁:l < List.length δh₂:Extends δ' δ⊢ δ'[l] = δ[l] induction δ generalizing l δ' with l:Natδ':StoreTyh₁:l < [].lengthh₂:Extends δ' []⊢ δ'[l] = [][l] All goals completed! 🐙 hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]l:Natδ':StoreTyh₁:l < (hd :: tl).lengthh₂:Extends δ' (hd :: tl)⊢ δ'[l] = (hd :: tl)[l] cases δ' with hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]l:Nath₁:l < (hd :: tl).lengthh₂:Extends [] (hd :: tl)⊢ [][l] = (hd :: tl)[l] All goals completed! 🐙 hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]l:Nath₁:l < (hd :: tl).lengthhd':Tytl':List Tyh₂:Extends (hd' :: tl') (hd :: tl)⊢ (hd' :: tl')[l] = (hd :: tl)[l] hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]l:Nath₁:l < (hd :: tl).lengthtl':List Tyh✝:Extends tl' tl⊢ (hd :: tl')[l] = (hd :: tl)[l] cases l with hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]tl':List Tyh✝:Extends tl' tlh₁:0 < (hd :: tl).length⊢ (hd :: tl')[0] = (hd :: tl)[0] All goals completed! 🐙 hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]tl':List Tyh✝:Extends tl' tll:Nath₁:l + 1 < (hd :: tl).length⊢ (hd :: tl')[l + 1] = (hd :: tl)[l + 1] hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]tl':List Tyh✝:Extends tl' tll:Nath₁:l + 1 < (hd :: tl).length⊢ tl'[l] = tl[l]; hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]tl':List Tyh✝:Extends tl' tll:Nath₁:l + 1 < (hd :: tl).length⊢ l < tl.lengthhd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]tl':List Tyh✝:Extends tl' tll:Nath₁:l + 1 < (hd :: tl).length⊢ Extends tl' tl hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]tl':List Tyh✝:Extends tl' tll:Nath₁:l + 1 < (hd :: tl).length⊢ l < tl.length All goals completed! 🐙 hd:Tytl:List Tyih:∀ {l : Nat} {δ' : StoreTy}, l < tl.length → Extends δ' tl → δ'[l] = tl[l]tl':List Tyh✝:Extends tl' tll:Nath₁:l + 1 < (hd :: tl).length⊢ Extends tl' tl All goals completed! 🐙

Next, if δ' extends δ, the length of δ' is at least that of δ.

theorem length_extends {l : Nat} {δ δ' : StoreTy} (h₁ : l < δ.length) (h₂ : Extends δ' δ) : l < δ'.length := l:Natδ:StoreTyδ':StoreTyh₁:l < List.length δh₂:Extends δ' δ⊢ l < List.length δ' induction h₂ generalizing l with δ:StoreTyδ':StoreTyδ'✝:StoreTyl:Nath₁:l < [].length⊢ l < List.length δ'✝ All goals completed! 🐙 δ:StoreTyδ':StoreTyτ:Tyδ'✝:StoreTyδ✝:StoreTyh:Extends δ'✝ δ✝ih:∀ {l : Nat}, l < List.length δ✝ → l < List.length δ'✝l:Nath₁:l < (τ :: δ✝).length⊢ l < (τ :: δ'✝).length δ:StoreTyδ':StoreTyτ:Tyδ'✝:StoreTyδ✝:StoreTyh:Extends δ'✝ δ✝ih:∀ {l : Nat}, l < List.length δ✝ → l < List.length δ'✝l:Nath₁:l < (τ :: δ✝).length⊢ l < List.length δ'✝ + 1 cases l with δ:StoreTyδ':StoreTyτ:Tyδ'✝:StoreTyδ✝:StoreTyh:Extends δ'✝ δ✝ih:∀ {l : Nat}, l < List.length δ✝ → l < List.length δ'✝h₁:0 < (τ :: δ✝).length⊢ 0 < List.length δ'✝ + 1 All goals completed! 🐙 δ:StoreTyδ':StoreTyτ:Tyδ'✝:StoreTyδ✝:StoreTyh:Extends δ'✝ δ✝ih:∀ {l : Nat}, l < List.length δ✝ → l < List.length δ'✝l':Nath₁:l' + 1 < (τ :: δ✝).length⊢ l' + 1 < List.length δ'✝ + 1 δ:StoreTyδ':StoreTyτ:Tyδ'✝:StoreTyδ✝:StoreTyh:Extends δ'✝ δ✝ih:∀ {l : Nat}, l < List.length δ✝ → l < List.length δ'✝l':Nath₁:l' + 1 < (τ :: δ✝).length⊢ l' < List.length δ'✝; δ:StoreTyδ':StoreTyτ:Tyδ'✝:StoreTyδ✝:StoreTyh:Extends δ'✝ δ✝ih:∀ {l : Nat}, l < List.length δ✝ → l < List.length δ'✝l':Nath₁:l' + 1 < (τ :: δ✝).length⊢ l' < List.length δ✝ All goals completed! 🐙

Finally, δ ++ δ' extends δ, and Extends is reflexive.

theorem extends_app (δ δ' : StoreTy) : Extends (δ ++ δ') δ := δ:StoreTyδ':StoreTy⊢ Extends (δ ++ δ') δ δ':StoreTy⊢ Extends ([] ++ δ') []head✝:Tytail✝:List Tytail_ih✝:∀ (δ' : StoreTy), Extends (tail✝ ++ δ') tail✝δ':StoreTy⊢ Extends (head✝ :: tail✝ ++ δ') (head✝ :: tail✝) δ':StoreTy⊢ Extends ([] ++ δ') []head✝:Tytail✝:List Tytail_ih✝:∀ (δ' : StoreTy), Extends (tail✝ ++ δ') tail✝δ':StoreTy⊢ Extends (head✝ :: tail✝ ++ δ') (head✝ :: tail✝) All goals completed! 🐙 theorem extends_refl (δ : StoreTy) : Extends δ δ := δ:StoreTy⊢ Extends δ δ ⊢ Extends [] []head✝:Tytail✝:List Tytail_ih✝:Extends tail✝ tail✝⊢ Extends (head✝ :: tail✝) (head✝ :: tail✝) ⊢ Extends [] []head✝:Tytail✝:List Tytail_ih✝:Extends tail✝ tail✝⊢ Extends (head✝ :: tail✝) (head✝ :: tail✝) All goals completed! 🐙

9.5.4. Preservation🔗

We can now give the correct statement of the type preservation property:

def preservation_theorem {δ : StoreTy} {t t' : Tm} {τ : Ty} {ρ ρ' : Store} := (hTy : <{ ∅ / δ ⊢ t ⦂ τ }>) → (hStoreTy : δ ⊢ ρ) → (hEval : t / ρ ⟶ t' / ρ') → ∃ δ', Extends δ' δ ∧ (<{ ∅ / δ' ⊢ t' ⦂ τ }>) ∧ (δ' ⊢ ρ')

This gives us just what we need to "turn the crank" when applying the theorem to multi-step reduction sequences.

9.5.4.1. Substitution Lemma🔗

To prove preservation, we need to re-develop the rest of the machinery that we saw for the pure STLC (plus a couple of new things about store typings and extension)...

theorem weakening {Γ Γ' : Context} {δ : StoreTy} {t : Tm} {τ: Ty} (hi : Γ ⊆ Γ') (ht : <{ Γ / δ ⊢ t ⦂ τ }>) : <{ Γ' / δ ⊢ t ⦂ τ }> := Γ:ContextΓ':Contextδ:StoreTyt:Tmτ:Tyhi:Γ ⊆ Γ'ht:<{ Γ / δ ⊢ t ⦂ τ }>⊢ <{ Γ' / δ ⊢ t ⦂ τ }> induction ht generalizing Γ' with (All goals completed! 🐙) theorem weakening_empty {Γ : Context} {δ : StoreTy} {t : Tm} {τ: Ty} (ht :<{ ∅ / δ ⊢ t ⦂ τ }>) : <{ Γ / δ ⊢ t ⦂ τ }> := Γ:Contextδ:StoreTyt:Tmτ:Tyht:<{ ∅ / δ ⊢ t ⦂ τ }>⊢ <{ Γ / δ ⊢ t ⦂ τ }> Γ:Contextδ:StoreTyt:Tmτ:Tyht:<{ ∅ / δ ⊢ t ⦂ τ }>⊢ ∅ ⊆ ΓΓ:Contextδ:StoreTyt:Tmτ:Tyht:<{ ∅ / δ ⊢ t ⦂ τ }>⊢ <{ ∅ / δ ⊢ t ⦂ τ }> Γ:Contextδ:StoreTyt:Tmτ:Tyht:<{ ∅ / δ ⊢ t ⦂ τ }>⊢ ∅ ⊆ Γ Γ:Contextδ:StoreTyt:Tmτ:Tyht:<{ ∅ / δ ⊢ t ⦂ τ }>x:Stringb:Tycontra:∅[x] = some b⊢ Γ[x] = some b All goals completed! 🐙 Γ:Contextδ:StoreTyt:Tmτ:Tyht:<{ ∅ / δ ⊢ t ⦂ τ }>⊢ <{ ∅ / δ ⊢ t ⦂ τ }> All goals completed! 🐙 theorem substitution_preserves_typing (Γ : Context) (δ : StoreTy) (x : String) (τ₁ : Ty) (t v : Tm) (τ : Ty) (ht : <{ x ↦ τ₁ ; Γ / δ⊢ t ⦂ τ }>) (hv : <{ ∅ / δ ⊢ v ⦂ τ₁ }>) : <{ Γ / δ ⊢ [x := v] t ⦂ τ }> := Γ:Contextδ:StoreTyx:Stringτ₁:Tyt:Tmv:Tmτ:Tyht:<{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ t ⦂ τ }>hv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>⊢ <{ Γ / δ ⊢ [~x := v] t ⦂ τ }> induction t generalizing Γ τ with ( δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>a✝:NatΓ:Contextτ:Tyht:<{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ ~(Tm.loc a✝) ⦂ τ }>⊢ <{ Γ / δ ⊢ ~(Tm.loc a✝) ⦂ τ }>; try (δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>a✝:NatΓ:Contexth✝:a✝ < List.length δ⊢ <{ Γ / δ ⊢ ~(Tm.loc a✝) ⦂ Ref ~δ[a✝] }>; All goals completed! 🐙; done)) δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyht:<{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ ~(STLCRef.Tm.var y) ⦂ τ }>⊢ <{ Γ / δ ⊢ ~(if x = y then v else STLCRef.Tm.var y) ⦂ τ }> inversion ht with δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:(x →ₚ τ₁ ; Γ)[y] = some τ⊢ <{ Γ / δ ⊢ ~(if x = y then v else STLCRef.Tm.var y) ⦂ τ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:(x →ₚ τ₁ ; Γ)[y] = some τh₁:x = y⊢ <{ Γ / δ ⊢ ~(if x = y then v else STLCRef.Tm.var y) ⦂ τ }>δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:(x →ₚ τ₁ ; Γ)[y] = some τh₁:¬x = y⊢ <{ Γ / δ ⊢ ~(if x = y then v else STLCRef.Tm.var y) ⦂ τ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:(x →ₚ τ₁ ; Γ)[y] = some τh₁:x = y⊢ <{ Γ / δ ⊢ ~(if x = y then v else STLCRef.Tm.var y) ⦂ τ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>Γ:Contextτ:Tyh:(x →ₚ τ₁ ; Γ)[x] = some τ⊢ <{ Γ / δ ⊢ ~(if x = x then v else STLCRef.Tm.var x) ⦂ τ }>; δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>Γ:Contextτ:Tyh:τ₁ = τ⊢ <{ Γ / δ ⊢ ~(if x = x then v else STLCRef.Tm.var x) ⦂ τ }>; δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>Γ:Context⊢ <{ Γ / δ ⊢ ~(if x = x then v else STLCRef.Tm.var x) ⦂ τ₁ }>; δ:StoreTyx:Stringτ₁:Tyv:Tmhv✝:<{ ∅ / δ ⊢ v ⦂ τ₁ }>Γ:Contexthv:<{ ~?Γ / δ ⊢ v ⦂ τ₁ }>⊢ <{ Γ / δ ⊢ ~(if x = x then v else STLCRef.Tm.var x) ⦂ τ₁ }>δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>Γ:Context⊢ Context δ:StoreTyx:Stringτ₁:Tyv:Tmhv✝:<{ ∅ / δ ⊢ v ⦂ τ₁ }>Γ:Contexthv:<{ ~?Γ / δ ⊢ v ⦂ τ₁ }>⊢ <{ Γ / δ ⊢ v ⦂ τ₁ }>δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>Γ:Context⊢ Context; All goals completed! 🐙 δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:(x →ₚ τ₁ ; Γ)[y] = some τh₁:¬x = y⊢ <{ Γ / δ ⊢ ~(if x = y then v else STLCRef.Tm.var y) ⦂ τ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:Γ[y] = some τh₁:¬x = y⊢ <{ Γ / δ ⊢ ~(if x = y then v else STLCRef.Tm.var y) ⦂ τ }>δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:(x →ₚ τ₁ ; Γ)[y] = some τh₁:¬x = y⊢ x ≠ y δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:Γ[y] = some τh₁:¬x = y⊢ <{ Γ / δ ⊢ ~(if x = y then v else STLCRef.Tm.var y) ⦂ τ }>δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:StringΓ:Contextτ:Tyh:(x →ₚ τ₁ ; Γ)[y] = some τh₁:¬x = y⊢ x ≠ y All goals completed! 🐙 All goals completed! 🐙 δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ:Tyht:<{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ λ ~y : a✝¹ . a✝ ⦂ τ }>⊢ <{ Γ / δ ⊢ ~(if x = y then <{ λ ~y : a✝¹ . a✝ }> else <{ λ ~y : a✝¹ . [~x := v] a✝ }>) ⦂ τ }> inversion ht with δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(y →ₚ a✝¹ ; x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>⊢ <{ Γ / δ ⊢ ~(if x = y then <{ λ ~y : a✝¹ . a✝ }> else <{ λ ~y : a✝¹ . [~x := v] a✝ }>) ⦂ a✝¹ → τ₁✝ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(y →ₚ a✝¹ ; x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:x = y⊢ <{ Γ / δ ⊢ ~(if x = y then <{ λ ~y : a✝¹ . a✝ }> else <{ λ ~y : a✝¹ . [~x := v] a✝ }>) ⦂ a✝¹ → τ₁✝ }>δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(y →ₚ a✝¹ ; x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:¬x = y⊢ <{ Γ / δ ⊢ ~(if x = y then <{ λ ~y : a✝¹ . a✝ }> else <{ λ ~y : a✝¹ . [~x := v] a✝ }>) ⦂ a✝¹ → τ₁✝ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(y →ₚ a✝¹ ; x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:x = y⊢ <{ Γ / δ ⊢ ~(if x = y then <{ λ ~y : a✝¹ . a✝ }> else <{ λ ~y : a✝¹ . [~x := v] a✝ }>) ⦂ a✝¹ → τ₁✝ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:TmΓ:Contextτ₁✝:Tyih:∀ (Γ : Context) (τ : Ty), <{ ~(y →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~y := v] a✝ ⦂ τ }>h:<{ ~(y →ₚ a✝¹ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:x = y⊢ <{ Γ / δ ⊢ λ ~y : a✝¹ . a✝ ⦂ a✝¹ → τ₁✝ }>; All goals completed! 🐙 δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(y →ₚ a✝¹ ; x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:¬x = y⊢ <{ Γ / δ ⊢ ~(if x = y then <{ λ ~y : a✝¹ . a✝ }> else <{ λ ~y : a✝¹ . [~x := v] a✝ }>) ⦂ a✝¹ → τ₁✝ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(x →ₚ τ₁ ; y →ₚ a✝¹ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:¬x = y⊢ <{ Γ / δ ⊢ ~(if x = y then <{ λ ~y : a✝¹ . a✝ }> else <{ λ ~y : a✝¹ . [~x := v] a✝ }>) ⦂ a✝¹ → τ₁✝ }>δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(y →ₚ a✝¹ ; x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:¬x = y⊢ y ≠ x δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(x →ₚ τ₁ ; y →ₚ a✝¹ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:¬x = y⊢ <{ Γ / δ ⊢ ~(if x = y then <{ λ ~y : a✝¹ . a✝ }> else <{ λ ~y : a✝¹ . [~x := v] a✝ }>) ⦂ a✝¹ → τ₁✝ }> δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(x →ₚ τ₁ ; y →ₚ a✝¹ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:¬x = y⊢ <{ Γ / δ ⊢ λ ~y : a✝¹ . [~x := v] a✝ ⦂ a✝¹ → τ₁✝ }>; All goals completed! 🐙 δ:StoreTyx:Stringτ₁:Tyv:Tmhv:<{ ∅ / δ ⊢ v ⦂ τ₁ }>y:Stringa✝¹:Tya✝:Tmih:∀ (Γ : Context) (τ : Ty), <{ ~(x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ }> → <{ Γ / δ ⊢ [~x := v] a✝ ⦂ τ }>Γ:Contextτ₁✝:Tyh:<{ ~(y →ₚ a✝¹ ; x →ₚ τ₁ ; Γ) / δ ⊢ a✝ ⦂ τ₁✝ }>h₁:¬x = y⊢ y ≠ x All goals completed! 🐙

9.5.4.2. Assignment Preserves Store Typing🔗

Next, we must show that replacing the contents of a cell in the store with a new value of appropriate type does not change the overall type of the store. (This is needed for the assign rule.)

theorem assign_pres_store_typing {δ : StoreTy} {ρ : Store} {l : Nat} {t : Tm} (hLen : l < ρ.length) (hStoreTy : δ ⊢ ρ) (hTy : <{ ∅ / δ ⊢ t ⦂ ~(δ[l]) }>) : δ ⊢ ρ.set l t := δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>⊢ δ ⊢ List.set ρ l t δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ δ ⊢ List.set ρ l t δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ List.length δ = (List.set ρ l t).lengthδ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ ∀ (l_1 : Nat), l_1 < (List.set ρ l t).length → <{ ∅ / δ ⊢ ~(List.set ρ l t)[l_1] ⦂ ~δ[l_1] }> δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ List.length δ = (List.set ρ l t).length All goals completed! 🐙 δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ ∀ (l_1 : Nat), l_1 < (List.set ρ l t).length → <{ ∅ / δ ⊢ ~(List.set ρ l t)[l_1] ⦂ ~δ[l_1] }> δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).length⊢ <{ ∅ / δ ⊢ ~(List.set ρ l t)[l'] ⦂ ~δ[l'] }> δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:l' = l⊢ <{ ∅ / δ ⊢ ~(List.set ρ l t)[l'] ⦂ ~δ[l'] }>δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:¬l' = l⊢ <{ ∅ / δ ⊢ ~(List.set ρ l t)[l'] ⦂ ~δ[l'] }> δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:l' = l⊢ <{ ∅ / δ ⊢ ~(List.set ρ l t)[l'] ⦂ ~δ[l'] }> δ:StoreTyρ:Storet:TmhStoreTy:δ ⊢ ρh₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen:l' < List.length ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l'] }>hLen':l' < (List.set ρ l' t).length⊢ <{ ∅ / δ ⊢ ~(List.set ρ l' t)[l'] ⦂ ~δ[l'] }> δ:StoreTyρ:Storet:TmhStoreTy:δ ⊢ ρh₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen:l' < List.length ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l'] }>hLen':l' < (List.set ρ l' t).length⊢ <{ ∅ / δ ⊢ t ⦂ ~δ[l'] }>δ:StoreTyρ:Storet:TmhStoreTy:δ ⊢ ρh₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen:l' < List.length ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l'] }>hLen':l' < (List.set ρ l' t).length⊢ l' < List.length ρ δ:StoreTyρ:Storet:TmhStoreTy:δ ⊢ ρh₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen:l' < List.length ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l'] }>hLen':l' < (List.set ρ l' t).length⊢ <{ ∅ / δ ⊢ t ⦂ ~δ[l'] }>δ:StoreTyρ:Storet:TmhStoreTy:δ ⊢ ρh₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen:l' < List.length ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l'] }>hLen':l' < (List.set ρ l' t).length⊢ l' < List.length ρ All goals completed! 🐙 δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:¬l' = l⊢ <{ ∅ / δ ⊢ ~(List.set ρ l t)[l'] ⦂ ~δ[l'] }> δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:¬l' = l⊢ <{ ∅ / δ ⊢ ~ρ[l'] ⦂ ~δ[l'] }>δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:¬l' = l⊢ l' ≠ l δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:¬l' = l⊢ <{ ∅ / δ ⊢ ~ρ[l'] ⦂ ~δ[l'] }>δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:¬l' = l⊢ l' ≠ l try All goals completed! 🐙 δ:StoreTyρ:Storel:Natt:TmhLen:l < List.length ρhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t ⦂ ~δ[l] }>h₁✝:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l':NathLen':l' < (List.set ρ l t).lengthh₁:¬l' = l⊢ l' < List.length ρ All goals completed! 🐙

9.5.4.3. Weakening for Stores🔗

Finally, we need a lemma on store typings, stating that, if a store typing is extended with a new location, the extended one still allows us to assign the same types to the same terms as the original.

theorem store_weakening {Γ : Context} {δ δ' : StoreTy} {t : Tm} {τ : Ty} (hExt : Extends δ' δ) (hTy : <{ Γ / δ ⊢ t ⦂ τ }>) : <{ Γ / δ' ⊢ t ⦂ τ }> := Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δhTy:<{ Γ / δ ⊢ t ⦂ τ }>⊢ <{ Γ / δ' ⊢ t ⦂ τ }> induction hTy with (try (All goals completed! 🐙; done)) Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ <{ Γ✝ / δ' ⊢ ~(Tm.loc l✝) ⦂ Ref ~δ[l✝] }> Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ <{ Γ✝ / δ' ⊢ ~(Tm.loc l✝) ⦂ Ref ~?m.40[l✝] }>Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ l✝ < List.length δΓ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ Extends ?m.40 δΓ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ StoreTy Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ <{ Γ✝ / δ' ⊢ ~(Tm.loc l✝) ⦂ Ref ~?m.40[l✝] }>Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ l✝ < List.length δΓ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ Extends ?m.40 δΓ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ StoreTy try All goals completed! 🐙 Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ l✝ < List.length δ' Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ l✝ < List.length ?loc_.δΓ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ Extends δ' ?loc_.δΓ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ StoreTy Γ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ l✝ < List.length ?loc_.δΓ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ Extends δ' ?loc_.δΓ:Contextδ:StoreTyδ':StoreTyt:Tmτ:TyhExt:Extends δ' δΓ✝:Contextl✝:Nath:l✝ < List.length δ⊢ StoreTy All goals completed! 🐙

We can use the store_weakening lemma to prove that if a store is well typed with respect to a store typing, then the store extended with a new term τ will still be well typed with respect to the store typing extended with τ's type.

theorem store_well_typed_app {δ : StoreTy} {ρ : Store} {t₁ : Tm} {τ₁ : Ty} (hStoreTy : δ ⊢ ρ) (hTy : <{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>) : (δ.concat τ₁) ⊢ (ρ.concat t₁) := δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>⊢ List.concat δ τ₁ ⊢ List.concat ρ t₁ δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ List.concat δ τ₁ ⊢ List.concat ρ t₁ δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ δ ++ [τ₁] ⊢ ρ ++ [t₁] δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ (δ ++ [τ₁]).length = (ρ ++ [t₁]).lengthδ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ ∀ (l : Nat), l < (ρ ++ [t₁]).length → <{ ∅ / (δ ++ [τ₁]) ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }> δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ (δ ++ [τ₁]).length = (ρ ++ [t₁]).length All goals completed! 🐙 δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ ∀ (l : Nat), l < (ρ ++ [t₁]).length → <{ ∅ / (δ ++ [τ₁]) ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }> δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ ∀ (l : Nat), l < List.length ρ + 1 → <{ ∅ / (δ ++ [τ₁]) ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }> δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l < List.length ρ + 1⊢ <{ ∅ / (δ ++ [τ₁]) ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }> inversion hl with δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ <{ ∅ / (δ ++ [τ₁]) ⊢ ~(ρ ++ [t₁])[List.length ρ] ⦂ ~(δ ++ [τ₁])[List.length ρ] }> δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ Extends (δ ++ [τ₁]) ?refl.δδ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ <{ ∅ / ?refl.δ ⊢ ~(ρ ++ [t₁])[List.length ρ] ⦂ ~(δ ++ [τ₁])[List.length ρ] }>δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ StoreTy δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ Extends (δ ++ [τ₁]) ?refl.δδ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ <{ ∅ / ?refl.δ ⊢ ~(ρ ++ [t₁])[List.length ρ] ⦂ ~(δ ++ [τ₁])[List.length ρ] }>δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ StoreTy try All goals completed! 🐙 δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ <{ ∅ / δ ⊢ ~(ρ ++ [t₁])[List.length ρ] ⦂ ~(δ ++ [τ₁])[List.length ρ] }> All goals completed! 🐙 δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ <{ ∅ / (δ ++ [τ₁]) ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }> δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ Extends (δ ++ [τ₁]) ?step.δδ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ <{ ∅ / ?step.δ ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }>δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ StoreTy δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ Extends (δ ++ [τ₁]) ?step.δδ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ <{ ∅ / ?step.δ ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }>δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ StoreTy try All goals completed! 🐙 δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ Extends (δ ++ [τ₁]) δ All goals completed! 🐙 δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)⊢ <{ ∅ / δ ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }> δ:StoreTyρ:Storet₁:Tmτ₁:TyhStoreTy:δ ⊢ ρhTy:<{ ∅ / δ ⊢ t₁ ⦂ τ₁ }>h₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>l:Nathl:l.succ.le (List.length ρ)hl':l < List.length ρ⊢ <{ ∅ / δ ⊢ ~(ρ ++ [t₁])[l] ⦂ ~(δ ++ [τ₁])[l] }> All goals completed! 🐙

9.5.4.4. The Proof!🔗

Now that we've got everything set up right, the proof of preservation is actually quite straightforward. Where progress's deref and assign cases only needed a location to exist in the store, these cases of preservation need to know that its contents actually have the type δ claims for it.

theorem preservation {δ : StoreTy} {t t' : Tm} {τ : Ty} {ρ ρ' : Store} (hTy : <{ ∅ / δ ⊢ t ⦂ τ }>) (hStoreTy : δ ⊢ ρ) (hEval : t / ρ ⟶ t' / ρ') : ∃ δ', Extends δ' δ ∧ (<{ ∅ / δ' ⊢ t' ⦂ τ }>) ∧ (δ' ⊢ ρ') := δ:StoreTyt:Tmt':Tmτ:Tyρ:Storeρ':StorehTy:<{ ∅ / δ ⊢ t ⦂ τ }>hStoreTy:δ ⊢ ρhEval:t / ρ ⟶ t' / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmt':Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρhEval:t / ρ ⟶ t' / ρ'Γ:Contextheq:∅ = ΓhTy:<{ Γ / δ ⊢ t ⦂ τ }>⊢ ∃ δ', Extends δ' δ ∧ <{ Γ / δ' ⊢ t' ⦂ τ }> ∧ δ' ⊢ ρ' -- discharge the goals where `t` doesn't step induction hTy generalizing t' with (δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nath✝:l✝ < List.length δt':TmhEval:Tm.loc l✝ / ρ ⟶ t' / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ'; try (All goals completed! 🐙; All goals completed! 🐙)) δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmt':TmhEval:<{ t₁✝ t₂✝ }> / ρ ⟶ t' / ρ'h₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' inversion hEval with δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝¹:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringτ₂✝:Tyt₁✝:Tmh₁:<{ ∅ / δ ⊢ λ ~x✝ : τ₂✝ . t₁✝ ⦂ τ₂✝¹ → τ₁✝ }>h✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ → τ₁✝ }> ∧ δ' ⊢ ρ⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ [~x✝ := t₂✝] t₁✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ inversion h₁ with δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringt₁✝:Tmh✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρh:<{ ~(x✝ →ₚ τ₂✝) / δ ⊢ t₁✝ ⦂ τ₁✝ }>⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ [~x✝ := t₂✝] t₁✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringt₁✝:Tmh✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρh:<{ ~(x✝ →ₚ τ₂✝) / δ ⊢ t₁✝ ⦂ τ₁✝ }>⊢ Extends δ δ ∧ <{ ∅ / δ ⊢ [~x✝ := t₂✝] t₁✝ ⦂ τ₁✝ }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringt₁✝:Tmh✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρh:<{ ~(x✝ →ₚ τ₂✝) / δ ⊢ t₁✝ ⦂ τ₁✝ }>⊢ Extends δ δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringt₁✝:Tmh✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρh:<{ ~(x✝ →ₚ τ₂✝) / δ ⊢ t₁✝ ⦂ τ₁✝ }>⊢ <{ ∅ / δ ⊢ [~x✝ := t₂✝] t₁✝ ⦂ τ₁✝ }> ∧ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringt₁✝:Tmh✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρh:<{ ~(x✝ →ₚ τ₂✝) / δ ⊢ t₁✝ ⦂ τ₁✝ }>⊢ <{ ∅ / δ ⊢ [~x✝ := t₂✝] t₁✝ ⦂ τ₁✝ }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringt₁✝:Tmh✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρh:<{ ~(x✝ →ₚ τ₂✝) / δ ⊢ t₁✝ ⦂ τ₁✝ }>⊢ <{ ∅ / δ ⊢ [~x✝ := t₂✝] t₁✝ ⦂ τ₁✝ }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringt₁✝:Tmh✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρh:<{ ~(x✝ →ₚ τ₂✝) / δ ⊢ t₁✝ ⦂ τ₁✝ }>⊢ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₂✝:Tmh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>x✝:Stringt₁✝:Tmh✝:t₂✝.IsValueih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝¹ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ λ ~x✝ : τ₂✝ . t₁✝ }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρh:<{ ~(x✝ →ₚ τ₂✝) / δ ⊢ t₁✝ ⦂ τ₁✝ }>⊢ δ ⊢ ρ All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ t₂✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₂✝ → τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ t₂✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₂✝ → τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ t₂✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₂✝ → τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₂✝ → τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ t₂✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₂✝ → τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ t₂✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₂✝ → τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ t₂✝ ⦂ τ₁✝ }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₂✝ → τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₂✝ → τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ t₂'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ t₂'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ t₂'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ t₂'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ t₂'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ t₂'✝ ⦂ τ₁✝ }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyτ₂✝:Tyt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₂✝ → τ₁✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ → τ₁✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt':TmhEval:<{ succ t₁✝ }> / ρ ⟶ t' / ρ'h✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ' inversion hEval with δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }> ∧ δ' ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δ ∧ <{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }> ∧ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ succ t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ succ t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ succ t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ succ t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ succ t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ succ t₁'✝ ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt':TmhEval:<{ pred t₁✝ }> / ρ ⟶ t' / ρ'h✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ' inversion hEval with δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ ~(Tm.const (n✝ - 1)) ⦂ Nat }> ∧ δ' ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δ ∧ <{ ∅ / δ ⊢ ~(Tm.const (n✝ - 1)) ⦂ Nat }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n✝ - 1)) ⦂ Nat }> ∧ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n✝ - 1)) ⦂ Nat }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n✝ - 1)) ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn✝:Nath✝:<{ ∅ / δ ⊢ ~(Tm.const n✝) ⦂ Nat }>ih:∀ {t' : Tm}, Tm.const n✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ pred t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ pred t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ pred t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ pred t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ pred t₁'✝ ⦂ Nat }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ pred t₁'✝ ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmh✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt':TmhEval:<{ t₁✝ * t₂✝ }> / ρ ⟶ t' / ρ'h₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ' inversion hEval with δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn₁✝:Natn₂✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n₁✝) ⦂ Nat }>h₂:<{ ∅ / δ ⊢ ~(Tm.const n₂✝) ⦂ Nat }>ih₁:∀ {t' : Tm}, Tm.const n₁✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρih₂:∀ {t' : Tm}, Tm.const n₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ ~(Tm.const (n₁✝ * n₂✝)) ⦂ Nat }> ∧ δ' ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn₁✝:Natn₂✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n₁✝) ⦂ Nat }>h₂:<{ ∅ / δ ⊢ ~(Tm.const n₂✝) ⦂ Nat }>ih₁:∀ {t' : Tm}, Tm.const n₁✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρih₂:∀ {t' : Tm}, Tm.const n₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δ ∧ <{ ∅ / δ ⊢ ~(Tm.const (n₁✝ * n₂✝)) ⦂ Nat }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn₁✝:Natn₂✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n₁✝) ⦂ Nat }>h₂:<{ ∅ / δ ⊢ ~(Tm.const n₂✝) ⦂ Nat }>ih₁:∀ {t' : Tm}, Tm.const n₁✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρih₂:∀ {t' : Tm}, Tm.const n₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn₁✝:Natn₂✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n₁✝) ⦂ Nat }>h₂:<{ ∅ / δ ⊢ ~(Tm.const n₂✝) ⦂ Nat }>ih₁:∀ {t' : Tm}, Tm.const n₁✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρih₂:∀ {t' : Tm}, Tm.const n₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n₁✝ * n₂✝)) ⦂ Nat }> ∧ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn₁✝:Natn₂✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n₁✝) ⦂ Nat }>h₂:<{ ∅ / δ ⊢ ~(Tm.const n₂✝) ⦂ Nat }>ih₁:∀ {t' : Tm}, Tm.const n₁✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρih₂:∀ {t' : Tm}, Tm.const n₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n₁✝ * n₂✝)) ⦂ Nat }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn₁✝:Natn₂✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n₁✝) ⦂ Nat }>h₂:<{ ∅ / δ ⊢ ~(Tm.const n₂✝) ⦂ Nat }>ih₁:∀ {t' : Tm}, Tm.const n₁✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρih₂:∀ {t' : Tm}, Tm.const n₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~(Tm.const (n₁✝ * n₂✝)) ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn₁✝:Natn₂✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n₁✝) ⦂ Nat }>h₂:<{ ∅ / δ ⊢ ~(Tm.const n₂✝) ⦂ Nat }>ih₁:∀ {t' : Tm}, Tm.const n₁✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρih₂:∀ {t' : Tm}, Tm.const n₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextn₁✝:Natn₂✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.const n₁✝) ⦂ Nat }>h₂:<{ ∅ / δ ⊢ ~(Tm.const n₂✝) ⦂ Nat }>ih₁:∀ {t' : Tm}, Tm.const n₁✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρih₂:∀ {t' : Tm}, Tm.const n₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ * t₂✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ * t₂✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ * t₂✝ ⦂ Nat }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ * t₂✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ * t₂✝ ⦂ Nat }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ * t₂✝ ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ * t₂'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ * t₂'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ * t₂'✝ ⦂ Nat }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ * t₂'✝ ⦂ Nat }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ * t₂'✝ ⦂ Nat }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ * t₂'✝ ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ Nat }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyt':TmhEval:<{ if0 t₁✝ then t₂✝ else t₃✝ }> / ρ ⟶ t' / ρ'h₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ' inversion hEval with δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ if0 t₁'✝ then t₂✝ else t₃✝ ⦂ τ✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ if0 t₁'✝ then t₂✝ else t₃✝ ⦂ τ✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ if0 t₁'✝ then t₂✝ else t₃✝ ⦂ τ✝ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ if0 t₁'✝ then t₂✝ else t₃✝ ⦂ τ✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ if0 t₁'✝ then t₂✝ else t₃✝ ⦂ τ✝ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ if0 t₁'✝ then t₂✝ else t₃✝ ⦂ τ✝ }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₂✝ ⦂ τ✝ }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₃✝ ⦂ τ✝ }> δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₂✝ ⦂ τ✝ }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmt₃✝:Tmτ✝:Tyh₁✝:<{ ∅ / δ ⊢ t₁✝ ⦂ Nat }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ'h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ'h₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Nat }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₃✝ ⦂ τ✝ }> All goals completed! 🐙 All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₂✝ ⦂ τ✝ }> ∧ δ' ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δ ∧ <{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }> ∧ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>h₁✝:<{ ∅ / δ ⊢ 0 ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, <{ 0 }> / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₃✝ ⦂ τ✝ }> ∧ δ' ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δ ∧ <{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ Extends δ δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }> ∧ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmt₃✝:Tmτ✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ✝ }>h₃:<{ ∅ / δ ⊢ t₃✝ ⦂ τ✝ }>n✝:Nath₁✝:<{ ∅ / δ ⊢ ~(Tm.const (n✝ + 1)) ⦂ Nat }>h₂_ih✝:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρh₃_ih✝:∀ {t' : Tm}, t₃✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ✝ }> ∧ δ' ⊢ ρih₁:∀ {t' : Tm}, Tm.const (n✝ + 1) / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Nat }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyt':TmhEval:<{ ref t₁✝ }> / ρ ⟶ t' / ρ'h:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁ }> ∧ δ' ⊢ ρ' inversion hEval with δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ ~(Tm.loc (List.length ρ)) ⦂ Ref τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ Extends (List.concat δ τ₁) δ ∧ <{ ∅ / (List.concat δ τ₁) ⊢ ~(Tm.loc (List.length ρ)) ⦂ Ref τ₁ }> ∧ List.concat δ τ₁ ⊢ List.concat ρ t₁✝; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ Extends (List.concat δ τ₁) δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ <{ ∅ / (List.concat δ τ₁) ⊢ ~(Tm.loc (List.length ρ)) ⦂ Ref τ₁ }> ∧ List.concat δ τ₁ ⊢ List.concat ρ t₁✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ Extends (List.concat δ τ₁) δ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ Extends (δ ++ [τ₁]) δ; All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ <{ ∅ / (List.concat δ τ₁) ⊢ ~(Tm.loc (List.length ρ)) ⦂ Ref τ₁ }> ∧ List.concat δ τ₁ ⊢ List.concat ρ t₁✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ <{ ∅ / (List.concat δ τ₁) ⊢ ~(Tm.loc (List.length ρ)) ⦂ Ref τ₁ }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ List.concat δ τ₁ ⊢ List.concat ρ t₁✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ <{ ∅ / (List.concat δ τ₁) ⊢ ~(Tm.loc (List.length ρ)) ⦂ Ref τ₁ }> δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh✝¹:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝h:<{ Ref τ₁ }> = <{ Ref ~(List.concat δ τ₁)[List.length ρ] }>⊢ <{ ∅ / (List.concat δ τ₁) ⊢ ~(Tm.loc (List.length ρ)) ⦂ Ref τ₁ }> δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh✝¹:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝h:<{ Ref τ₁ }> = <{ Ref ~(List.concat δ τ₁)[List.length ρ] }>⊢ <{ ∅ / (List.concat δ τ₁) ⊢ ~(Tm.loc (List.length ρ)) ⦂ Ref ~(List.concat δ τ₁)[List.length ρ] }> δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh✝¹:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝h:<{ Ref τ₁ }> = <{ Ref ~(List.concat δ τ₁)[List.length ρ] }>⊢ List.length ρ < (List.concat δ τ₁).length δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:List.length δ = List.length ρ ∧ ∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>Γ:Contextt₁✝:Tmτ₁:Tyh✝¹:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝h:<{ Ref τ₁ }> = <{ Ref ~(List.concat δ τ₁)[List.length ρ] }>⊢ List.length ρ < List.length δ + 1; All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ List.concat δ τ₁ ⊢ List.concat ρ t₁✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ δ ⊢ ρδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ <{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }> δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ δ ⊢ ρδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>h✝:t₁✝.IsValueih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / List.concat ρ t₁✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ List.concat ρ t₁✝⊢ <{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }> All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ ref t₁'✝ ⦂ Ref τ₁ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₁ }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ ref t₁'✝ ⦂ Ref τ₁ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₁ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ ref t₁'✝ ⦂ Ref τ₁ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₁ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₁ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ ref t₁'✝ ⦂ Ref τ₁ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₁ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ ref t₁'✝ ⦂ Ref τ₁ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₁ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ ref t₁'✝ ⦂ Ref τ₁ }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₁ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ τ₁ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ τ₁ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyt':TmhEval:<{ !t₁✝ }> / ρ ⟶ t' / ρ'h:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' inversion hEval with δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextτ₁✝:Tyl✝:Nath:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ Ref τ₁✝ }>hl:l✝ < List.length ρih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ ~ρ[l✝] ⦂ τ₁✝ }> ∧ δ' ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ ~ρ[l✝] ⦂ ~δ[l✝] }> ∧ δ' ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ⊢ Extends δ δ ∧ <{ ∅ / δ ⊢ ~ρ[l✝] ⦂ ~δ[l✝] }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ⊢ Extends δ δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~ρ[l✝] ⦂ ~δ[l✝] }> ∧ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~ρ[l✝] ⦂ ~δ[l✝] }> ∧ δ ⊢ ρ; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ⊢ <{ ∅ / δ ⊢ ~ρ[l✝] ⦂ ~δ[l✝] }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ -- `h₂` is exactly the fact that `ρ[l]` has the type -- `δ` claims for it δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρh₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ <{ ∅ / δ ⊢ ~ρ[l✝] ⦂ ~δ[l✝] }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρ⊢ δ ⊢ ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρh₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ l✝ < List.length ρ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextl✝:Nathl:l✝ < List.length ρh✝:l✝ < List.length δih:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / ρ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ ρh₁:List.length δ = List.length ρh₂:∀ (l : Nat), l < List.length ρ → <{ ∅ / δ ⊢ ~ρ[l] ⦂ ~δ[l] }>⊢ l✝ < List.length ρ All goals completed! 🐙 All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ !t₁'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ !t₁'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ !t₁'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ !t₁'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ !t₁'✝ ⦂ τ₁✝ }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ !t₁'✝ ⦂ τ₁✝ }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmτ₁✝:Tyh:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₁✝ }>ih:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₁✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₁✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyt':TmhEval:<{ t₁✝ := t₂✝ }> / ρ ⟶ t' / ρ'h₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Unit }> ∧ δ' ⊢ ρ' inversion hEval with δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tmτ₂✝:Tyh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>l✝:Nath₁:<{ ∅ / δ ⊢ ~(Tm.loc l✝) ⦂ Ref τ₂✝ }>h₁✝:t₂✝.IsValuehl:l✝ < List.length ρih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ unit ⦂ Unit }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ unit ⦂ Unit }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ Extends δ δ ∧ <{ ∅ / δ ⊢ unit ⦂ Unit }> ∧ δ ⊢ List.set ρ l✝ t₂✝; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ Extends δ δδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ <{ ∅ / δ ⊢ unit ⦂ Unit }> ∧ δ ⊢ List.set ρ l✝ t₂✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ <{ ∅ / δ ⊢ unit ⦂ Unit }> ∧ δ ⊢ List.set ρ l✝ t₂✝; δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ <{ ∅ / δ ⊢ unit ⦂ Unit }>δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ δ ⊢ List.set ρ l✝ t₂✝ δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ δ ⊢ List.set ρ l✝ t₂✝ -- `assign_pres_store_typing` needs the new value's type -- to match `δ[l]` δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ l✝ < List.length ρδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ δ ⊢ ρδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ <{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }> δ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ l✝ < List.length ρδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ δ ⊢ ρδ:StoreTyt:Tmτ:Tyρ:StorehStoreTy:δ ⊢ ρΓ:Contextt₂✝:Tml✝:Nath₁✝:t₂✝.IsValuehl:l✝ < List.length ρh✝:l✝ < List.length δh₂:<{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }>ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝ih₁:∀ {t' : Tm}, Tm.loc l✝ / ρ ⟶ t' / List.set ρ l✝ t₂✝ → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref ~δ[l✝] }> ∧ δ' ⊢ List.set ρ l✝ t₂✝⊢ <{ ∅ / δ ⊢ t₂✝ ⦂ ~δ[l✝] }> All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ := t₂✝ ⦂ Unit }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ := t₂✝ ⦂ Unit }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁'✝ := t₂✝ ⦂ Unit }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ := t₂✝ ⦂ Unit }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ := t₂✝ ⦂ Unit }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁'✝ := t₂✝ ⦂ Unit }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₁'✝:Tmhs:t₁✝ / ρ ⟶ t₁'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₁'✝ ⦂ Ref τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙 δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ := t₂'✝ ⦂ Unit }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ := t₂'✝ ⦂ Unit }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δ ∧ <{ ∅ / δ' ⊢ t₁✝ := t₂'✝ ⦂ Unit }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ Extends δ' δδ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ := t₂'✝ ⦂ Unit }> ∧ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ := t₂'✝ ⦂ Unit }> ∧ δ' ⊢ ρ'; δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ <{ ∅ / δ' ⊢ t₁✝ := t₂'✝ ⦂ Unit }>δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' δ:StoreTyt:Tmτ:Tyρ:Storeρ':StorehStoreTy:δ ⊢ ρΓ:Contextt₁✝:Tmt₂✝:Tmτ₂✝:Tyh₁:<{ ∅ / δ ⊢ t₁✝ ⦂ Ref τ₂✝ }>h₂:<{ ∅ / δ ⊢ t₂✝ ⦂ τ₂✝ }>ih₁:∀ {t' : Tm}, t₁✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ Ref τ₂✝ }> ∧ δ' ⊢ ρ'ih₂:∀ {t' : Tm}, t₂✝ / ρ ⟶ t' / ρ' → ∅ = ∅ → ∃ δ', Extends δ' δ ∧ <{ ∅ / δ' ⊢ t' ⦂ τ₂✝ }> ∧ δ' ⊢ ρ't₂'✝:Tmh₁✝:t₁✝.IsValuehs:t₂✝ / ρ ⟶ t₂'✝ / ρ'δ':StoreTyhExt:Extends δ' δhTy':<{ ∅ / δ' ⊢ t₂'✝ ⦂ τ₂✝ }>hStoreTy':δ' ⊢ ρ'⊢ δ' ⊢ ρ' All goals completed! 🐙

9.6. References and Nontermination🔗

An important fact about the STLC is that it is normalizing — that is, every well-typed term can be reduced to a value in a finite number of steps.

What about STLC + references? Surprisingly, adding references causes us to lose the normalization property: there exist well-typed terms in the STLC + references which can continue to reduce forever, without ever reaching a normal form!

How can we construct such a term? The main idea is to make a function which calls itself. We first make a function which calls another function stored in a reference cell; the trick is that we then smuggle in a reference to itself!

(λR : Ref (Unit → Unit).
    R := (λX:Unit. (!R) unit); (!R) unit)
(ref (λX:Unit. unit))
namespace RefsAndNontermination def loop_fun := <{ λX : Unit. (!R) unit }> def loop := <{ (λR : Ref (Unit → Unit). (( R := (λX : Unit. (!R) unit) ); ( (! R) unit ) )) (ref (λX : Unit. unit)) }>

This term is well typed:

theorem loop_typeable : ∃ τ, <{ ∅ / [] ⊢ loop ⦂ τ }> := ⊢ ∃ τ, <{ ∅ / [] ⊢ loop ⦂ τ }> ⊢ <{ ∅ / [] ⊢ loop ⦂ ~?w }>⊢ Ty All goals completed! 🐙

To show formally that the term diverges, we first define the step_closure of the single-step reduction relation, written ⟶+. This is just like the reflexive step closure of single-step reduction (which we're been writing ⟶*), except that it is not reflexive: t ⟶+ t' means that τ can reach t' by one or more steps of reduction.

inductive StepClosure {X:Type} (R: Relation X) : X → X → Prop `inductive ... :=` has been deprecated in favor of `inductive ... where` Note: This linter can be disabled with `set_option linter.deprecated false`:= | one {x y : X} (h₁ : R x y) : StepClosure R x y | step {x y z : X} (h₁ : R x y) (h₂ : StepClosure R y z) : StepClosure R x z scoped notation:40 t:71 " / " ρ:41 " ⟶+ " t':71 " / " ρ':41 => StepClosure Step (t, ρ) (t', ρ')

Now, we can show that the expression loop reduces to the expression !(loc 0) unit and the size-one store [R:=(loc 0)] loop_fun.

As a convenience, we introduce a slight variant of the normalize tactic, called reduce, which tries solving the goal with Multi.refl at each step, instead of waiting until the goal can't be reduced any more. Of course, the whole point is that loop doesn't normalize, so the old normalize tactic would just go into an infinite loop reducing it forever!

syntax "reduce" " using " ident,+ : tactic macro_rules | `(tactic| reduce using $xs,*) => `(tactic| repeat (apply Multi.step · solve_by_elim (maxDepth := 15) (constructor := false) [Nat.le.refl, Nat.le.step] using $xs,* try apply Multi.refl))

Next, we use reduce to show that loop steps to !(loc 0) unit, starting from the ∅ store.

theorem loop_steps_to_loop_fun : loop / [] ⟶* <{ (! (loc 0)) unit }> / [<{ [R := loc 0] loop_fun }>] := ⊢ loop / [] ⟶* <{ (!(loc 0)) unit }> / [<{ [R := loc 0] loop_fun }>] All goals completed! 🐙

Finally, we show that the latter expression reduces in two steps to itself!

theorem loop_fun_step_self : <{ (! (loc 0)) unit }> / [<{ [R := loc 0] loop_fun }>] ⟶+ <{ (! (loc 0)) unit }> / [<{ [R := loc 0] loop_fun }>] := ⊢ <{ (!(loc 0)) unit }> / [<{ [R := loc 0] loop_fun }>] ⟶+ <{ (!(loc 0)) unit }> / [<{ [R := loc 0] loop_fun }>] ⊢ Step (<{ (!(loc 0)) unit }>, [<{ [R := loc 0] loop_fun }>]) ?y⊢ StepClosure Step ?y (<{ (!(loc 0)) unit }>, [<{ [R := loc 0] loop_fun }>])⊢ Tm × Store; ⊢ <{ ~[<{ [R := loc 0] loop_fun }>][0] unit }> / [<{ [R := loc 0] loop_fun }>] ⟶+ <{ (!(loc 0)) unit }> / [<{ [R := loc 0] loop_fun }>] ⊢ <{ ~[<{ [R := loc 0] loop_fun }>][0] unit }> / [<{ [R := loc 0] loop_fun }>] ⟶ <{ (!(loc 0)) unit }> / [<{ [R := loc 0] loop_fun }>]; All goals completed! 🐙 end RefsAndNontermination

9.7. Additional Exercises🔗

end STLCRef
Source revision: 0519b34, committed 2026-11-20 16:53 UTC