internlm/Lean-Github huggingface dataset:
Theorem: abst_rule
Proof state before:
case mpr
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
x : V
σ τ : 𝕋 𝕍
aux : Option (𝕋 𝕍)
h :
  (match aux with
    | some τ => some (σ →' τ)
    | x => none) =
    some (σ →' τ)
h' : typeOf (Γ;; x : σ) M = aux
⊢ aux = some τ
Tactic:
match aux with
| .some τ' => simp at h; simp [h]
Proof state after:
no goals
Theorem: abst_rule
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
x : V
σ τ : 𝕋 𝕍
aux : Option (𝕋 𝕍)
τ' : 𝕋 𝕍
h :
  (match some τ' with
    | some τ => some (σ →' τ)
    | x => none) =
    some (σ →' τ)
h' : typeOf (Γ;; x : σ) M = some τ'
⊢ some τ' = some τ
Tactic:
simp at h
Proof state after:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
x : V
σ τ : 𝕋 𝕍
aux : Option (𝕋 𝕍)
τ' : 𝕋 𝕍
h' : typeOf (Γ;; x : σ) M = some τ'
h : τ' = τ
⊢ some τ' = some τ
Theorem: abst_rule
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
x : V
σ τ : 𝕋 𝕍
aux : Option (𝕋 𝕍)
τ' : 𝕋 𝕍
h' : typeOf (Γ;; x : σ) M = some τ'
h : τ' = τ
⊢ some τ' = some τ
Tactic:
simp [h]
Proof state after:
no goals
Theorem: typeUniqueness
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
σ τ : 𝕋 𝕍
⊢ (Γ ⊢ M : σ) → (Γ ⊢ M : τ) → σ = τ
Tactic:
intros h h'
Proof state after:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
σ τ : 𝕋 𝕍
h : Γ ⊢ M : σ
h' : Γ ⊢ M : τ
⊢ σ = τ
Theorem: typeUniqueness
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
σ τ : 𝕋 𝕍
h : Γ ⊢ M : σ
h' : Γ ⊢ M : τ
⊢ σ = τ
Tactic:
unfold typingJudgement at *
Proof state after:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
σ τ : 𝕋 𝕍
h : typeOf Γ M = some σ
h' : typeOf Γ M = some τ
⊢ σ = τ
Theorem: typeUniqueness
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
σ τ : 𝕋 𝕍
h : typeOf Γ M = some σ
h' : typeOf Γ M = some τ
⊢ σ = τ
Tactic:
rw [h, Option.some.injEq] at h'
Proof state after:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
σ τ : 𝕋 𝕍
h : typeOf Γ M = some σ
h' : σ = τ
⊢ σ = τ
Theorem: typeUniqueness
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
Γ : TCtxt V 𝕍
M : Λ V 𝕍
σ τ : 𝕋 𝕍
h : typeOf Γ M = some σ
h' : σ = τ
⊢ σ = τ
Tactic:
assumption
Proof state after:
no goals
Theorem: AlphaEquivPreservesType'
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
⊢ ∀ {M' M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M' : σ)
Tactic:
intros M'
Proof state after:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M' : Λ V 𝕍
⊢ ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M' : σ)
Theorem: AlphaEquivPreservesType'
Proof state before:
case Var
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
⊢ ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M (Λ.Var y) →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ Λ.Var y : σ)
Tactic:
introv
Proof state after:
case Var
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
⊢ AlphaEquiv' var_map M (Λ.Var y) →
    (∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
      (Γ ⊢ M : σ) → (Γ' ⊢ Λ.Var y : σ)
Theorem: AlphaEquivPreservesType'
Proof state before:
case Var
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
⊢ AlphaEquiv' var_map M (Λ.Var y) →
    (∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
      (Γ ⊢ M : σ) → (Γ' ⊢ Λ.Var y : σ)
Tactic:
intros alpha_equiv ctxt_equiv
Proof state after:
case Var
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
alpha_equiv : AlphaEquiv' var_map M (Λ.Var y)
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
⊢ (Γ ⊢ M : σ) → (Γ' ⊢ Λ.Var y : σ)
Theorem: AlphaEquivPreservesType'
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
alpha_equiv : AlphaEquiv' var_map (Λ.Var x) (Λ.Var y)
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Tactic:
simp at alpha_equiv
Proof state after:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
alpha_equiv : var_map x = some y ∨ var_map x = none ∧ x = y
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Theorem: AlphaEquivPreservesType'
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
alpha_equiv : var_map x = some y ∨ var_map x = none ∧ x = y
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Tactic:
rcases alpha_equiv with var_map_x_to_y | ⟨var_map_x_is_none, x_eq_y⟩
Proof state after:
case inl
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
var_map_x_to_y : var_map x = some y
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)

case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Theorem: AlphaEquivPreservesType'
Proof state before:
case inl
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
var_map_x_to_y : var_map x = some y
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Tactic:
specialize ctxt_equiv x
Proof state after:
case inl
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_to_y : var_map x = some y
ctxt_equiv : var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Theorem: AlphaEquivPreservesType'
Proof state before:
case inl
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_to_y : var_map x = some y
ctxt_equiv : var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Tactic:
simp [var_map_x_to_y] at ctxt_equiv
Proof state after:
case inl
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_to_y : var_map x = some y
ctxt_equiv : getType x Γ = getType y Γ'
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Theorem: AlphaEquivPreservesType'
Proof state before:
case inl
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_to_y : var_map x = some y
ctxt_equiv : getType x Γ = getType y Γ'
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Tactic:
simp [ctxt_equiv]
Proof state after:
no goals
Theorem: AlphaEquivPreservesType'
Proof state before:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
⊢ (Γ ⊢ Λ.Var x : σ) → (Γ' ⊢ Λ.Var y : σ)
Tactic:
simp
Proof state after:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
⊢ getType x Γ = some σ → getType y Γ' = some σ
Theorem: AlphaEquivPreservesType'
Proof state before:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
⊢ getType x Γ = some σ → getType y Γ' = some σ
Tactic:
specialize ctxt_equiv x
Proof state after:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
ctxt_equiv : var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
⊢ getType x Γ = some σ → getType y Γ' = some σ
Theorem: AlphaEquivPreservesType'
Proof state before:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
ctxt_equiv : var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
⊢ getType x Γ = some σ → getType y Γ' = some σ
Tactic:
rw [←x_eq_y]
Proof state after:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
ctxt_equiv : var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
⊢ getType x Γ = some σ → getType x Γ' = some σ
Theorem: AlphaEquivPreservesType'
Proof state before:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
ctxt_equiv : var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
⊢ getType x Γ = some σ → getType x Γ' = some σ
Tactic:
simp [var_map_x_is_none] at ctxt_equiv
Proof state after:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
ctxt_equiv : getType x Γ = getType x Γ'
⊢ getType x Γ = some σ → getType x Γ' = some σ
Theorem: AlphaEquivPreservesType'
Proof state before:
case inr.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
y : V
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
x : V
var_map_x_is_none : var_map x = none
x_eq_y : x = y
ctxt_equiv : getType x Γ = getType x Γ'
⊢ getType x Γ = some σ → getType x Γ' = some σ
Tactic:
simp [ctxt_equiv]
Proof state after:
no goals
Theorem: AlphaEquivPreservesType'
Proof state before:
case App
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
⊢ ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M (Λ.App M₀' M₁') →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ Λ.App M₀' M₁' : σ)
Tactic:
introv
Proof state after:
case App
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
⊢ AlphaEquiv' var_map M (Λ.App M₀' M₁') →
    (∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
      (Γ ⊢ M : σ) → (Γ' ⊢ Λ.App M₀' M₁' : σ)
Theorem: AlphaEquivPreservesType'
Proof state before:
case App
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
⊢ AlphaEquiv' var_map M (Λ.App M₀' M₁') →
    (∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
      (Γ ⊢ M : σ) → (Γ' ⊢ Λ.App M₀' M₁' : σ)
Tactic:
intros alpha_equiv ctxt_equiv h
Proof state after:
case App
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
alpha_equiv : AlphaEquiv' var_map M (Λ.App M₀' M₁')
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
h : Γ ⊢ M : σ
⊢ Γ' ⊢ Λ.App M₀' M₁' : σ
Theorem: AlphaEquivPreservesType'
Proof state before:
case App
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
alpha_equiv : AlphaEquiv' var_map M (Λ.App M₀' M₁')
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
h : Γ ⊢ M : σ
⊢ Γ' ⊢ Λ.App M₀' M₁' : σ
Tactic:
match M with
| .App M₀ M₁ =>
  simp at alpha_equiv
  rw [←appl_rule] at h
  rcases h with ⟨τ, h₀, h₁⟩
  specialize ih₀ alpha_equiv.1 ctxt_equiv h₀
  specialize ih₁ alpha_equiv.2 ctxt_equiv h₁
  simp at ih₀ ih₁
  simp [ih₀, ih₁]
Proof state after:
no goals
Theorem: AlphaEquivPreservesType'
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
M₀ M₁ : Λ V 𝕍
alpha_equiv : AlphaEquiv' var_map (Λ.App M₀ M₁) (Λ.App M₀' M₁')
h : Γ ⊢ Λ.App M₀ M₁ : σ
⊢ Γ' ⊢ Λ.App M₀' M₁' : σ
Tactic:
simp at alpha_equiv
Proof state after:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
M₀ M₁ : Λ V 𝕍
alpha_equiv : AlphaEquiv' var_map M₀ M₀' ∧ AlphaEquiv' var_map M₁ M₁'
h : Γ ⊢ Λ.App M₀ M₁ : σ
⊢ Γ' ⊢ Λ.App M₀' M₁' : σ
Theorem: AlphaEquivPreservesType'
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
M₀ M₁ : Λ V 𝕍
alpha_equiv : AlphaEquiv' var_map M₀ M₀' ∧ AlphaEquiv' var_map M₁ M₁'
h : Γ ⊢ Λ.App M₀ M₁ : σ
⊢ Γ' ⊢ Λ.App M₀' M₁' : σ
Tactic:
rw [←appl_rule] at h
Proof state after:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
M₀ M₁ : Λ V 𝕍
alpha_equiv : AlphaEquiv' var_map M₀ M₀' ∧ AlphaEquiv' var_map M₁ M₁'
h : ∃ σ_1, (Γ ⊢ M₀ : σ_1 →' σ) ∧ (Γ ⊢ M₁ : σ_1)
⊢ Γ' ⊢ Λ.App M₀' M₁' : σ
Theorem: AlphaEquivPreservesType'
Proof state before:
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
M₀ M₁ : Λ V 𝕍
alpha_equiv : AlphaEquiv' var_map M₀ M₀' ∧ AlphaEquiv' var_map M₁ M₁'
h : ∃ σ_1, (Γ ⊢ M₀ : σ_1 →' σ) ∧ (Γ ⊢ M₁ : σ_1)
⊢ Γ' ⊢ Λ.App M₀' M₁' : σ
Tactic:
rcases h with ⟨τ, h₀, h₁⟩
Proof state after:
case intro.intro
V 𝕍 : Type
inst✝¹ : DecidableEq V
inst✝ : DecidableEq 𝕍
M₀' M₁' : Λ V 𝕍
ih₀ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₀' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₀' : σ)
ih₁ :
  ∀ {M : Λ V 𝕍} {Γ Γ' : TCtxt V 𝕍} {σ : 𝕋 𝕍} {var_map : V → Option V},
    AlphaEquiv' var_map M M₁' →
      (∀ (x : V),
          var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ') →
        (Γ ⊢ M : σ) → (Γ' ⊢ M₁' : σ)
M : Λ V 𝕍
Γ Γ' : TCtxt V 𝕍
σ : 𝕋 𝕍
var_map : V → Option V
ctxt_equiv :
  ∀ (x : V), var_map x = none ∧ getType x Γ = getType x Γ' ∨ ∃ y, var_map x = some y ∧ getType x Γ = getType y Γ'
M₀ M₁ : Λ V 𝕍
alpha_equiv : AlphaEquiv' var_map M₀ M₀' ∧ AlphaEquiv' var_map M₁ M₁'
τ : 𝕋 𝕍
h₀ : Γ ⊢ M₀ : τ →' σ
h₁ : Γ ⊢ M₁ : τ
⊢ Γ' ⊢ Λ.App M₀' M₁' : σ