Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in 2nd subst example #136

Open
ketilwright opened this issue Oct 31, 2024 · 0 comments
Open

Error in 2nd subst example #136

ketilwright opened this issue Oct 31, 2024 · 0 comments

Comments

@ketilwright
Copy link

This generates "compile" errors

namespace Hidden
theorem subst {α : Type u} {a b : α} {p : α → Prop} (h₁ : Eq a b) (h₂ : p a) : p b :=
  match h₁ with
  | rfl => h₂
end Hidden

I suspect what's meant is

theorem subst {α : Type u} {a b : α} {p : α → Prop} (h₁ : Eq a b) (h₂ : p a) : p b :=
  match h₁ with
  | .refl => h₂

Or perhaps:

theorem subst {α : Type u} {a b : α} {p : α → Prop} (h₁ : Eq a b) (h₂ : p a) : p b :=
  match h₁ with
  | Hidden.Eq.refl => h₂

"rfl" is probably a typo. Without a prepended . or Hidden.Eq. on refl there are warnings in the infoview:

Local variable 'refl' resembles constructor 'Hidden.Eq.refl' - write '.refl' (with a dot) or 'Hidden.Eq.refl' to use the constructor.
note: this linter can be disabled with set_option linter.constructorNameAsVariable false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant