diff --git a/out/Stlc.md b/out/Stlc.md index 5d615dea..97120503 100644 --- a/out/Stlc.md +++ b/out/Stlc.md @@ -366,7 +366,7 @@ And here it is formalised in Agda. Terms have six constructs. Three are for the core lambda calculus: - * Variables, `\` x` + * Variables, `` ` x `` * Abstractions, `λ[ x ∶ A ] N` * Applications, `L · M` and three are for the base type, booleans: @@ -390,213 +390,213 @@ Here is the syntax of terms in BNF.
-infixl 20 20 _·_ infix 15 λ[_∶_]_ infix 15 if_then_else_ data Term : Set where ` : Id →Id → Term λ[_∶_]_ : Id →Id → Type → Term → Term _·_ : Term → Term → Term true : Term false : Term if_then_else_ : Term → Term → Term → Term @@ -613,225 +613,225 @@ CONTINUE FROM HERE Example terms.-f x : Id Id f = = id 0 x = = id 1 not two : Term not = λ[ x ∶ 𝔹 ] (if ` x then false else true) two = λ[ f ∶ 𝔹 ⇒ 𝔹 ] λ[ λ[ x ∶ 𝔹 ] ` f · (` f · (` f · ` x) @@ -841,130 +841,130 @@ Example terms.-data Value : Term → Set where value-λ : ∀ {x A{x N}A → Value (λ[ x ∶ A ] N)} → Value (λ[ x ∶ A ] N) value-true : : Value true value-false : Value false @@ -974,645 +974,645 @@ Example terms.-_[_:=_] : Term → Id Id → Term → Term (` x′) [ x := V:= V ] with x ≟ x′ x′ ... | yes _ = V ... | no _ no _ = ` x′ x′ (λ[ x′ ∶x′ A′∶ A′ ] N′) [ x := := V ] with x ≟ x′ x′ ... | yes _ = λ[ x′λ[ ∶x′ A′∶ ]A′ N′] N′ ... | no _ no _ = λ[ x′λ[ ∶x′ A′∶ A′ ] (N′ [ x := V:= ])V ]) (L′ · M′) [ x := V ] = (L′ [ x := V ] = (L′ [ x V:= ])V ]) · (M′ [ x := V:= ])V ]) (true) [ x := := V ] = true (false) [ x := := V ] = false (if L′ thenL′ M′then M′ else N′) [ x := := V ] = if if (L′ [ x := V:= ])V ]) then (M′ [ x := V:= ])V ]) else (N′ [ x := V:= V ]) @@ -1622,569 +1622,569 @@ Example terms.-infix 10 10 _⟹_ data _⟹_ : Term → Term → Set where βλ· : ∀ {x {x A N V} → Value V} → Value V → (λ[ x ∶ A ] N) · V ⟹ N) · V ⟹ N [ x := V:= V ] ξ·₁ : ∀ {L L′{L M}L′ M} → L ⟹ L′ L′ → L · M ⟹ L′ ·L′ · M ξ·₂ : ∀ {V M M′} → - Value {V M M′} → Value V → + M ⟹ M′ M′ → V · M ⟹ V · M′ M′ βif-true : ∀ {M N}{M N} → if true then M else N ⟹ M βif-false : ∀ {M N}{M N} → if false then M else N ⟹ N ξif : ∀ {L L′{L ML′ N}M N} → L ⟹ L′ L′ → if L then M else N ⟹ if L′if L′ then M else N @@ -2195,665 +2195,665 @@ Example terms.-infix 10 10 _⟹*_ infixr 2 _⟹⟨_⟩_ infix 3 _∎ 3 _∎ data _⟹*_ : Term → Term → Set where _∎ : ∀ M → M ⟹* ⟹* M _⟹⟨_⟩_ : ∀ L {ML N}{M →N} → L ⟹ M → M ⟹* N → L ⟹* N → L ⟹* N reduction₁ : not · true ⟹* ⟹* false reduction₁ = not · true ⟹⟨ βλ· value-true ⟩ if true then false else true ⟹⟨ βif-true ⟩ false ∎ reduction₂ : two · not · true ⟹* ⟹* true reduction₂ = two · not · true ⟹⟨ ξ·₁ (βλ· value-λ) ⟩ (λ[ x ∶ 𝔹 ] not · (not · ` x)) · true ⟹⟨ βλ· value-true ⟩ not · (not · true) ⟹⟨ ξ·₂ value-λ (βλ· value-true) ⟩ not · (if true then false else true) ⟹⟨ ξ·₂ value-λ βif-true ⟩ ⟩ not · false ⟹⟨ βλ· value-false ⟩ if false then false else true ⟹⟨ βif-false ⟩ true ∎ @@ -2867,683 +2867,683 @@ Much of the above, though not all, can be filled in using C-c C-r and C-c C-s.-Context : Set Context = PartialMap Type infix 10 10 _⊢_∶_ data _⊢_∶_ : Context → Term → Type → Set where Ax : ∀ {Γ x{Γ A}x A} → Γ x ≡ just A → Γ ⊢ ` x ∶ A ⇒-I : ∀ {Γ {Γ x N A B} → - Γ , x ∶ A ⊢ N ∶ B} → Γ , x ∶ A ⊢ λ[N ∶ B → + Γ ⊢ λ[ x ∶ A ] N ∶ A ⇒ B ⇒-E : ∀ {Γ {Γ L M A B} B} → Γ ⊢ L ∶ A ⇒ B → Γ ⊢ M ∶ A → Γ ⊢ L · M ∶ B 𝔹-I₁ : ∀ {Γ} → Γ ⊢ true ∶ 𝔹 𝔹-I₂ : ∀ {Γ} → Γ ⊢ false ∶ 𝔹 𝔹-E : ∀ {Γ {Γ L M N A} A} → Γ ⊢ L ∶ 𝔹 → Γ ⊢ M ∶ A → Γ ⊢ N ∶ A → Γ ⊢ if if L then M else N ∶ A @@ -3553,205 +3553,205 @@ Much of the above, though not all, can be filled in using C-c C-r and C-c C-s.-typing₁ : ∅ ⊢ not ∶ 𝔹 ⇒ 𝔹 typing₁ = ⇒-I (𝔹-E (Ax refl) 𝔹-I₂ 𝔹-I₁) typing₂ : ∅ ⊢ two ∶ (𝔹 ⇒ (𝔹) ⇒ ⇒ 𝔹) ⇒ 𝔹 ⇒ 𝔹 typing₂ = ⇒-I (⇒-I (⇒-E (Ax refl) (⇒-E (Ax refl) (Ax refl)))) @@ -3785,7 +3785,7 @@ outermost term is now `if_then_else_`, which is typed using `𝔹-E`. The ?2 : ∅ , x ∶ 𝔹 ⊢ true ∶ 𝔹 Again we fill in the three holes by typing C-c C-r in each. Agda observes -that `\` x`, `false`, and `true` are typed using `Ax`, `𝔹-I₂`, and +that `` ` x ``, `false`, and `true` are typed using `Ax`, `𝔹-I₂`, and `𝔹-I₁` respectively. The `Ax` rule in turn takes an argument, to show that `(∅ , x ∶ 𝔹) x = just 𝔹`, which can in turn be specified with a hole. After filling in all holes, the term is as above. diff --git a/out/StlcProp.md b/out/StlcProp.md index 54616b83..86a1c3bc 100644 --- a/out/StlcProp.md +++ b/out/StlcProp.md @@ -433,7 +433,7 @@ while for boolean types they are values `true` and `false`. >: Term → Type (λ[ x ∶ A ] A ⇒ canonical true for 𝔹 @@ -584,7 +584,7 @@ while for boolean types they are values `true` and `false`. >canonical false for 𝔹 @@ -630,7 +630,7 @@ while for boolean types they are values `true` and `false`. >∅ ⊢ L ∶ → Value (Ax (⇒-I ) value-λ (⇒-E canonical-forms 𝔹-I₁ value-true canonical-forms 𝔹-I₂ value-false (𝔹-E : Term M ⟹ → Value ∅ ⊢ M ∶ (Ax (⇒-I done value-λ @@ -1123,7 +1123,7 @@ This completes the proof. > (⇒-E (ξ·₁ (ξ·₂ (βλ· progress 𝔹-I₁ done value-true @@ -1348,7 +1348,7 @@ This completes the proof. >progress 𝔹-I₂ done value-false @@ -1371,7 +1371,7 @@ This completes the proof. > (𝔹-E (ξif steps βif-true @@ -1517,7 +1517,7 @@ This completes the proof. >steps βif-false @@ -1575,7 +1575,7 @@ instead of induction on typing derivations. >∅ ⊢ M ∶ → Term ∈ ` (λ[ y ∶ A ] L · L · (if L then M else (if L then M else (if L then M else → Term : Term : f ≢ x @@ -2435,7 +2435,7 @@ Here are proofs corresponding to the first two examples above. >: x (λ[ f ∶ (𝔹 ⇒ 𝔹) ] ` f · ` x): f (λ[ f ∶ (𝔹 ⇒ 𝔹) ] ` f · ` x): x ((λ[ f ∶ (𝔹 ⇒ 𝔹) ] ` f · ` x) · ` f): f ((λ[ f ∶ (𝔹 ⇒ 𝔹) ] ` f · ` x) · ` f): x (λ[ f ∶ (𝔹 ⇒ 𝔹) ] λ[ x ∶ 𝔹 ] ` f · ` x): f (λ[ f ∶ (𝔹 ⇒ 𝔹) ] λ[ x ∶ 𝔹 ] ` f · ` x)Γ ⊢ M ∶ -free-lemma free-` (Ax Γx≡A) = (_ , Γx≡A) = (_ , Γx≡A) free-lemma (free-·₁ x∈L) (⇒-E ⊢L ⊢M) = ⊢M) = free-lemma x∈L ⊢L free-lemma (free-·₂ x∈M) (⇒-E ⊢L ⊢M) = free-lemma x∈M ⊢M) = free-lemma x∈M ⊢M free-lemma (free-if₁ x∈L) (𝔹-E ⊢L ⊢M ⊢N)⊢L =⊢M ⊢N) = free-lemma x∈L ⊢L free-lemma (free-if₂ x∈M) (𝔹-E ⊢L ⊢M ⊢N)⊢L =⊢M ⊢N) = free-lemma x∈M ⊢M free-lemma (free-if₃ x∈N) (𝔹-E ⊢L ⊢M ⊢N)⊢L =⊢M free-lemma x∈N ⊢N) = free-lemma x∈N ⊢N free-lemma (free-λ {x} {y} y≢x x∈N) (⇒-I ⊢N) with free-lemma x∈N ⊢N -... | Γx≡C with y ≟ {x} {y} y≢x x∈N) (⇒-I ⊢N) with free-lemma x∈N ⊢N ... | Γx≡C with y ≟ |x yes y≡x = ⊥-elim (y≢x y≡x) ... | no _ yes y≡x = ⊥-elim (y≢x y≡x) +... | no _ = Γx≡C @@ -3629,68 +3629,68 @@ typed in the empty context is closed (has no free variables).-postulate ∅⊢-closed : ∀ {M A}∀ →{M ∅ ⊢A} M→ ∶∅ A⊢ →M closed∶ A → closed M @@ -3699,294 +3699,294 @@ typed in the empty context is closed (has no free variables).-contradiction : ∀ {X : Set} → ∀ {x : X} → ¬∀ (_≡_ {x : X} → ¬ (_≡_ {A = Maybe X}Maybe (justX} x)(just nothingx) nothing) contradiction () ∅⊢-closed′ : ∀ {M A}∀ →{M ∅ ⊢A} M→ ∶∅ A⊢ →M closed∶ M -∅⊢-closed′ {M} {A} ⊢M→ {x}closed x∈M with free-lemma x∈M ⊢MM ...∅⊢-closed′ |{M} {A} ⊢M {x} x∈M with free-lemma x∈M ⊢M +... | (B , ∅x≡B) = contradiction (trans (sym ∅x≡B) = contradiction (trans (sym (apply-∅∅x≡B) (apply-∅ x)) @@ -4002,144 +4002,144 @@ exchanged for the other.-context-lemma : ∀ {Γ Γ′ M{Γ Γ′ M A} → (∀ {x} → {x ∈} M→ →x Γ∈ xM ≡→ Γ′ x) - → Γ ⊢ Mx ∶≡ AΓ′ x) → Γ′ Γ ⊢ M ∶ A + → Γ′ ⊢ M ∶ A @@ -4191,600 +4191,600 @@ _Proof_: By induction on the derivation of `Γ ⊢ M ∶ A`.-context-lemma Γ~Γ′ (Ax Γx≡A) rewriteΓx≡A) (Γ~Γ′rewrite (Γ~Γ′ free-`) = Ax Γx≡A context-lemma {Γ} {Γ′} {λ[ x ∶ A{λ[ ]x ∶ A ] N} Γ~Γ′ (⇒-I ⊢N) = ⇒-I⊢N) = ⇒-I (context-lemma Γx~Γ′x ⊢N) where Γx~Γ′x : ∀ {y}: →∀ {y ∈} N→ →y ∈ N → (Γ , x ∶ , x ∶ A) y ≡ (Γ′) y ,≡ x ∶(Γ′ A), y - Γx~Γ′x {y} y∈N with x ≟∶ A) y ...Γx~Γ′x {y} y∈N with x ≟ y | yes + ... refl| yes refl = refl ... | no x≢y = Γ~Γ′ (free-λ x≢y y∈N) context-lemma Γ~Γ′ (⇒-E ⊢L ⊢M) = ⇒-E⊢M) (context-lemma= ⇒-E (Γ~Γ′context-lemma ∘(Γ~Γ′ ∘ free-·₁) ⊢L) (context-lemma (Γ~Γ′ (Γ~Γ′ ∘ free-·₂) ⊢M) context-lemma Γ~Γ′ 𝔹-I₁ = 𝔹-I₁ context-lemma Γ~Γ′ 𝔹-I₂ = 𝔹-I₂ context-lemma Γ~Γ′ (𝔹-E ⊢L ⊢M ⊢N)⊢L =⊢M 𝔹-E⊢N) (context-lemma= 𝔹-E (Γ~Γ′context-lemma (Γ~Γ′ ∘ free-if₁) ⊢L) (context-lemma (Γ~Γ′ (Γ~Γ′ ∘ free-if₂) ⊢M) (context-lemma (Γ~Γ′ (Γ~Γ′ ∘ free-if₃) ⊢N) @@ -4809,162 +4809,162 @@ _Lemma_: If `Γ , x ∶ A ⊢ N ∶ B` and `∅ ⊢ V ∶ A`, then-preservation-[:=] : ∀ {Γ x A NΓ Bx A N B V} → (Γ , x ∶ A), ⊢x N ∶ A) B⊢ N ∶ B → ∅ ⊢ V ∶∅ A⊢ V ∶ A → Γ ⊢ → Γ ⊢ (N [ x := V ]) ∶ B @@ -4994,7 +4994,7 @@ we show that if `∅ ⊢ V ∶ A` then `Γ ⊢ N [ x := V ] ∶ B`. - If `N` is a variable there are two cases to consider, depending on whether `N` is `x` or some other variable. - - If `N = \` x`, then from `Γ , x ∶ A ⊢ x ∶ B` + - If `N = `` `x ``, then from `Γ , x ∶ A ⊢ x ∶ B` we know that looking up `x` in `Γ , x : A` gives `just B`, but we already know it gives `just A`; applying injectivity for `just` we conclude that `A ≡ B`. @@ -5038,381 +5038,369 @@ we show that if `∅ ⊢ V ∶ A` then `Γ ⊢ N [ x := V ] ∶ B`. We need a couple of lemmas. A closed term can be weakened to any context, and `just` is injective.-weaken-closed : ∀ {V A Γ}: →∀ ∅{V ⊢A V ∶ A → Γ} → ∅ ⊢ V ∶ A → Γ ⊢ V ∶ A weaken-closed {V} {A} {Γ} ⊢V =} context-lemma Γ~Γ′ ⊢V - where - Γ~Γ′ : ∀ {x} → x ∈ V → ∅ x ≡ Γ} x⊢V = context-lemma Γ~Γ′ ⊢V where + Γ~Γ′ : ∀ {x} → x ∈ V → ∅ x ≡ Γ {x + Γ~Γ′ {x} x∈V = ⊥-elim (x∉V= ⊥-elim (x∉V x∈V) where x∉V : ¬ (x ∈ : ¬ (x ∈ V) x∉V = ∅⊢-closed ⊢V {x} just-injective : ∀ {X : Set} {x y : ∀ {X} →: Set} {x _≡_y : {AX} =→ Maybe_≡_ {A X}= (justMaybe xX)} just yx) → x ≡(just y) → x ≡ y just-injective refl = refl @@ -5464,937 +5464,937 @@ We need a couple of lemmas. A closed term can be weakened to any context, and `j-preservation-[:=] {Γ} {x} {A} (Ax {Γ,x∶A} {x′} {B} {x′} {B} [Γ,x∶A]x′≡B) ⊢V with x ≟ with x ≟ x′ ...| yes x≡x′ yes x≡x′ rewrite just-injective [Γ,x∶A]x′≡B = weaken-closed ⊢V ...| no x≢x′ = no x≢x′ = Ax [Γ,x∶A]x′≡B preservation-[:=] {Γ} {x} {A} {λ[ x′ ∶ A′{λ[ ]x′ N′}∶ {.A′ ] ⇒N′} B′} {V}.A′ (⇒-I⇒ B′} {V} (⇒-I ⊢N′) ⊢V with x ≟ with x ≟ x′ ...| yes x≡x′ rewriteyes x≡x′ rewrite x≡x′ = context-lemma Γ′~Γ (⇒-I ⊢N′) where Γ′~Γ : ∀ {y} → y ∈ (λ[ x′ ∶∈ A′(λ[ ]x′ N′)∶ →A′ (Γ] , x′ ∶ AN′) y→ ≡(Γ , x′ Γ∶ A) y - Γ′~Γ ≡ Γ {y} (free-λ x′≢y y∈N′) with x′ ≟ y ...|Γ′~Γ {y} (free-λ x′≢y y∈N′) with x′ ≟ yes x′≡y = ⊥-elim (x′≢y x′≡y)y ...| noyes x′≡y _ = ⊥-elim (x′≢y x′≡y) + ...| no _ = refl ...| no x≢x′ no x≢x′ = ⇒-I ⊢N′V ⇒-I ⊢N′V where x′x⊢N′ : Γ , x′ ∶: A′Γ , xx′ ∶ AA′ ⊢, N′x ∶ A ⊢ N′ ∶ B′ x′x⊢N′ rewrite update-permute Γ x A x′ Γ x A x′ A′ x≢x′ = ⊢N′ ⊢N′V : (Γ , x′ ∶ A′) ⊢x′ N′∶ [ xA′) :=⊢ VN′ ][ ∶x B′:= V ] ∶ B′ ⊢N′V = preservation-[:=] x′x⊢N′ ⊢V preservation-[:=] (⇒-E ⊢L ⊢M) ⊢V = ⇒-E⊢M) (preservation-[:=]⊢V = ⇒-E (preservation-[:=] ⊢L ⊢V) (preservation-[:=] ⊢M ⊢V) preservation-[:=] 𝔹-I₁ ⊢V = 𝔹-I₁ preservation-[:=] 𝔹-I₂ ⊢V = 𝔹-I₂ preservation-[:=] (𝔹-E ⊢L ⊢M ⊢N) ⊢V = ⊢N) ⊢V = 𝔹-E (preservation-[:=] ⊢L ⊢V) (preservation-[:=] ⊢M ⊢V) (preservation-[:=] ⊢N ⊢V) @@ -6410,95 +6410,95 @@ reduction preserves types.-preservation : ∀ {M N A}: →∀ ∅{M ⊢N M ∶ A} → M ⟹ N → ∅ ⊢ NM ∶ A → M ⟹ N → ∅ ⊢ N ∶ A @@ -6536,435 +6536,435 @@ _Proof_: By induction on the derivation of `∅ ⊢ M ∶ A`.-preservation (Ax Γx≡A) () Γx≡A) () preservation (⇒-I ⊢N) (⇒-I ⊢N) () preservation (⇒-E (⇒-I ⊢N) ⊢V) (βλ·⇒-I ⊢N) valueV) = preservation-[:=] ⊢N ⊢V) (βλ· valueV) = preservation-[:=] ⊢N ⊢V preservation (⇒-E ⊢L ⊢M) (ξ·₁ L⟹L′⊢M) )(ξ·₁ with preservation ⊢L L⟹L′ -...| ⊢L′ = ⇒-E ⊢L′ ⊢M -preservation (⇒-E ⊢L ⊢M) with preservation ⊢L L⟹L′ +...| ⊢L′ = ⇒-E ⊢L′ ⊢M +preservation (ξ·₂⇒-E ⊢L valueL M⟹M′) with preservation ⊢M) (ξ·₂ valueL M⟹M′) with preservation ⊢M M⟹M′ ...| ⊢M′ =...| ⇒-E ⊢L⊢M′ = ⇒-E ⊢L ⊢M′ preservation 𝔹-I₁ () preservation 𝔹-I₂ () preservation (𝔹-E 𝔹-I₁ ⊢M ⊢N) βif-true =βif-true = ⊢M preservation (𝔹-E 𝔹-I₂ ⊢M ⊢N) βif-false = ⊢N preservation (𝔹-E ⊢L ⊢M ⊢N) (ξif L⟹L′⊢N) with(ξif preservation ⊢L L⟹L′) with preservation ⊢L L⟹L′ ...| ⊢L′ =...| 𝔹-E ⊢L′ = 𝔹-E ⊢L′ ⊢M ⊢N @@ -6988,226 +6988,226 @@ term can _never_ reach a stuck state.-Normal : Term → : Term → Set Normal M = ∀ {N} → ¬ (M ⟹ → ¬ (M ⟹ N) Stuck : Term → : Term → Set Stuck M = Normal M= ×Normal ¬ Value M × ¬ Value M postulate Soundness : ∀ {M N A}: →∀ ∅{M ⊢N M ∶ A} → ∅ ⊢ M ⟹*∶ NA → ¬M (Stuck⟹* N → ¬ (Stuck N) @@ -7216,342 +7216,342 @@ term can _never_ reach a stuck state.-Soundness′ : ∀ {M N A}: →∀ ∅{M ⊢N M ∶ A} → ∅ ⊢ M ⟹*∶ NA → ¬M (Stuck⟹* N → ¬ (Stuck N) Soundness′ ⊢M (M ∎) ⊢M (¬M⟹NM , ¬ValueM∎) (¬M⟹N , with¬ValueM) progresswith ⊢M -... |progress steps M⟹N = ¬M⟹N M⟹N⊢M ... | donesteps ValueMM⟹N = ¬ValueM¬M⟹N ValueMM⟹N ... | done ValueM = ¬ValueM ValueM +Soundness′ {L} {N} {A} ⊢L } {A} ⊢L (_⟹⟨_⟩_ .L {M} {.N} L⟹M{M} {.N} L⟹M M⟹*N) = Soundness′ ⊢M M⟹*N where - ⊢M : ∅ ⊢ M ∶ A ⊢M : ∅ ⊢ M =∶ A + ⊢M = preservation ⊢L L⟹M @@ -7731,65 +7731,65 @@ booleans, for brevity).-data Type′ : Set where _⇒_ : Type′ → Type′ → Type′ ℕ : Type′ @@ -7800,226 +7800,226 @@ plus, minus, and testing for zero.-data Term′ : Set where `_ : Id → Term′ λ[_∶_]_ : Id → Type′ → Term′ → Term′ _·_ : Term′ → Term′ → Term′ ‶_ : Data.Nat.ℕ → Term′ _+_ : Term′ → Term′ → Term′ _-_ : Term′ → Term′ → Term′ if0_then_else_ : Term′ → Term′ → Term′ → Term′ diff --git a/src/Stlc.lagda b/src/Stlc.lagda index 9abc392d..6cfc0fa1 100644 --- a/src/Stlc.lagda +++ b/src/Stlc.lagda @@ -70,7 +70,7 @@ data Type : Set where \end{code} Terms have six constructs. Three are for the core lambda calculus: - * Variables, `\` x` + * Variables, `` ` x `` * Abstractions, `λ[ x ∶ A ] N` * Applications, `L · M` and three are for the base type, booleans: @@ -285,7 +285,7 @@ outermost term is now `if_then_else_`, which is typed using `𝔹-E`. The ?2 : ∅ , x ∶ 𝔹 ⊢ true ∶ 𝔹 Again we fill in the three holes by typing C-c C-r in each. Agda observes -that `\` x`, `false`, and `true` are typed using `Ax`, `𝔹-I₂`, and +that `` ` x ``, `false`, and `true` are typed using `Ax`, `𝔹-I₂`, and `𝔹-I₁` respectively. The `Ax` rule in turn takes an argument, to show that `(∅ , x ∶ 𝔹) x = just 𝔹`, which can in turn be specified with a hole. After filling in all holes, the term is as above. diff --git a/src/StlcProp.lagda b/src/StlcProp.lagda index 6b9fbddb..d717c5ab 100644 --- a/src/StlcProp.lagda +++ b/src/StlcProp.lagda @@ -266,7 +266,7 @@ _Proof_: We show, by induction on the proof that `x` appears free in `M`, that, for all contexts `Γ`, if `M` is well typed under `Γ`, then `Γ` assigns some type to `x`. - - If the last rule used was `free-\``, then `M = \` x`, and from + - If the last rule used was `` free-` ``, then `M = `` `x ``, and from the assumption that `M` is well typed under `Γ` we have immediately that `Γ` assigns a type to `x`. @@ -452,7 +452,7 @@ we show that if `∅ ⊢ V ∶ A` then `Γ ⊢ N [ x := V ] ∶ B`. - If `N` is a variable there are two cases to consider, depending on whether `N` is `x` or some other variable. - - If `N = \` x`, then from `Γ , x ∶ A ⊢ x ∶ B` + - If `N = `` `x ``, then from `Γ , x ∶ A ⊢ x ∶ B` we know that looking up `x` in `Γ , x : A` gives `just B`, but we already know it gives `just A`; applying injectivity for `just` we conclude that `A ≡ B`.