lean4-htt/tests/lean/run/dsimpNatLitIssue.lean
2024-09-10 19:30:09 +10:00

37 lines
868 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

variable {R M : Type}
/-- Typeclass for the `⊥` (`\bot`) notation -/
class Bot (α : Type) where
/-- The bot (`⊥`, `\bot`) element -/
bot : α
/-- The bot (`⊥`, `\bot`) element -/
notation "⊥" => Bot.bot
/-- Typeclass for types with a scalar multiplication operation, denoted `•` (`\bu`) -/
class SMul (M α : Type) where
smul : M → αα
infixr:73 " • " => SMul.smul
structure Submodule (R : Type) (M : Type) [Zero M] [SMul R M] where
carrier : M → Prop
zero_mem : carrier (0 : M)
variable [Zero M] [SMul R M]
instance : Bot (Submodule R M) where
bot := ⟨(· = 0), rfl⟩
instance : Zero (Submodule R M) where
zero := ⊥
@[simp]
theorem zero_eq_bot : (0 : Submodule R M) = ⊥ :=
rfl
theorem ohai : (0 : Submodule R M) = ⊥ := by
simp -- works
theorem oops : (0 : Submodule R M) = ⊥ := by
dsimp -- should work