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

chore: turn off [Inhabited β] : Inhabited (Sum α β) #5270

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/Init/Core.lean
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,13 @@ inductive PSum (α : Sort u) (β : Sort v) where

@[inherit_doc] infixr:30 " ⊕' " => PSum

instance {α β} [Inhabited α] : Inhabited (PSum α β) := ⟨PSum.inl default⟩
instance instInhabitedPSumLeft {α β} [Inhabited α] : Inhabited (PSum α β) := ⟨PSum.inl default⟩

instance {α β} [Inhabited β] : Inhabited (PSum α β) := ⟨PSum.inr default⟩
/--
`PSum α β` is inhabited if `β` is inhabited.
This is not an instance to avoid non-defeq instances.
-/
def instInhabitedPSumRight {α β} [Inhabited β] : Inhabited (PSum α β) := ⟨PSum.inr default⟩
kim-em marked this conversation as resolved.
Show resolved Hide resolved

/--
`Sigma β`, also denoted `Σ a : α, β a` or `(a : α) × β a`, is the type of dependent pairs
Expand Down Expand Up @@ -1153,7 +1157,8 @@ variable {α : Type u} {β : Type v}
instance Sum.inhabitedLeft [Inhabited α] : Inhabited (Sum α β) where
default := Sum.inl default

instance Sum.inhabitedRight [Inhabited β] : Inhabited (Sum α β) where
/-- This is not an instance to avoid non-defeq instances. -/
def Sum.inhabitedRight [Inhabited β] : Inhabited (Sum α β) where
default := Sum.inr default

instance {α : Type u} {β : Type v} [DecidableEq α] [DecidableEq β] : DecidableEq (Sum α β) := fun a b =>
Expand Down
Loading