Skip to content

inductive コマンドに対する制約: strictly positive 性 #510

@Seasawher

Description

@Seasawher

エラーになる例。

/-
(kernel) arg #2 of 'HFS.power' has a non positive occurrence of the datatypes being declared
-/
inductive HFS : Nat → Type where
| empty : HFS 0
| power {n : Nat} : (HFS n → Prop) → HFS (n + 1)

strictly positive の制約を守らないと矛盾が示せるという例

unsafe inductive Bad where
  | mk : (Bad → Bad) → Bad

unsafe def Bad.toFun (b : Bad) : Bad → Bad :=
  match b with
  | Bad.mk f => f

unsafe def selfApply (b : Bad) : Bad := b.toFun b

unsafe def omega : Bad := selfApply (Bad.mk selfApply)

unsafe def bad_contradiction (b : Bad) : False := by
  induction b
  case mk f ih =>
    exact ih omega

unsafe example : False := bad_contradiction omega

Metadata

Metadata

Assignees

Labels

updatePRに更新を与える宣言的コマンド準備完了執筆のための調査が終わっていて、執筆できる状態

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions