lean4-htt/tests/elab/grind_9825.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

59 lines
2.1 KiB
Text

module
import Lean.Elab.Command
theorem extracted_1_1 {K : Type} [Lean.Grind.Field K] (pB ppB pBf ifpnf : K) :
ifpnf ≠ 0 →
pBf + ppB = pB * (1 / ifpnf) + ppB →
ifpnf / (ppB * ifpnf + pB) = 1 / (ppB + pBf)
:=
by grind -abstractProof only [cases Or]
theorem extracted_1_2 {K : Type} [Lean.Grind.Field K] (pB ppB pBf ifpnf : K) :
ifpnf ≠ 0 →
pBf + ppB = pB * (1 / ifpnf) + ppB →
ifpnf / (ppB * ifpnf + pB) = 1 / (ppB + pBf)
:=
by grind -abstractProof only [cases Or]
theorem extracted_1_3 {K : Type} [Lean.Grind.Field K] (pB ppB pBf ifpnf : K) :
ifpnf ≠ 0 →
pBf + ppB = pB * (1 / ifpnf) + ppB →
ifpnf / (ppB * ifpnf + pB) = 1 / (ppB + pBf)
:=
by grind -abstractProof only [cases Or]
theorem extracted_1_4 {K : Type} [Lean.Grind.Field K] (pB ppB pBf ifpnf : K) :
ifpnf ≠ 0 →
pBf + ppB = pB * (1 / ifpnf) + ppB →
ifpnf / (ppB * ifpnf + pB) = 1 / (ppB + pBf)
:=
by grind -abstractProof only [cases Or]
theorem extracted_1_5 {K : Type} [Lean.Grind.Field K] (pB ppB pBf ifpnf : K) :
ifpnf ≠ 0 →
pBf + ppB = pB * (1 / ifpnf) + ppB →
ifpnf / (ppB * ifpnf + pB) = 1 / (ppB + pBf)
:=
by grind -abstractProof only [cases Or]
theorem extracted_1_6 {K : Type} [Lean.Grind.Field K] (pB ppB pBf ifpnf : K) :
ifpnf ≠ 0 →
pBf + ppB = pB * (1 / ifpnf) + ppB →
ifpnf / (ppB * ifpnf + pB) = 1 / (ppB + pBf)
:=
by grind -abstractProof only [cases Or]
open Lean
run_cmd
let env ← getEnv
let some (.thmInfo ci_1) := env.find? ``extracted_1_1 | unreachable!
let some (.thmInfo ci_2) := env.find? ``extracted_1_2 | unreachable!
let some (.thmInfo ci_3) := env.find? ``extracted_1_3 | unreachable!
let some (.thmInfo ci_4) := env.find? ``extracted_1_4 | unreachable!
let some (.thmInfo ci_5) := env.find? ``extracted_1_5 | unreachable!
let some (.thmInfo ci_6) := env.find? ``extracted_1_6 | unreachable!
assert! ci_1.value.hash == ci_2.value.hash
assert! ci_1.value.hash == ci_3.value.hash
assert! ci_1.value.hash == ci_4.value.hash
assert! ci_1.value.hash == ci_5.value.hash
assert! ci_1.value.hash == ci_6.value.hash