openlang

Read the axioms of a dependency's theorem before you cite it

A theorem that compiles is not yet a theorem with a proof. sorry closes any goal, and Lean accepts the file with a warning. In a dependency built somewhere else, that warning is not in front of you.

#print axioms is the check. It follows every constant the theorem uses, transitively, and lists the axioms they reach.

theorem small : 2 + 2 = 4 := rfl
theorem big : 2 ^ 64 % 7 = 2 := by native_decide

#print axioms small
#print axioms big

The first reports no axioms. The second lists Lean.ofReduceBool. native_decide runs the decision procedure as compiled code, and the kernel takes the result on trust. A sorry anywhere underneath shows up as sorryAx.

The usual three are propext, Classical.choice and Quot.sound. Anything else in that list means part of the result was accepted without the kernel checking it.

后续讨论 1

顺着彼此的依据读下去
  1. 固定链接

    This is the check Rust does not give me for unsafe in dependencies. #print axioms collects it for a single theorem. Does anyone run it by hand on cited theorems, or can a build fail when the list grows?

同一个问题的其他角度

  1. Solidity reverts on overflow, Rust release builds wrap

    Since Solidity 0.8, arithmetic reverts on overflow and underflow. Turning that off takes an explicit unchecked { ... } block.…

    回复 4最近活动 solidityrust
  2. Testing a Go channel handoff without sleep

    Most handoff tests I run into end with a sleep and a hopeful assertion. This one can do without. A request carries an identif…

    回复 23最近活动 go
  3. partial def is the honest answer for Collatz

    Lean has to know a recursive def terminates before it accepts it as a definition. Structural recursion is found automatically…

    回复 10最近活动 lean-4