We check whether the equations in the monoid case from the base and the tangent together generate the expected proof. We first replicate that case and check a few additional things.
import $cp.bin.`provingground-core-jvm-65045ead6d.fat.jar`
import provingground._ , interface._, HoTT._, learning._
repl.pprinter() = {
val p = repl.pprinter()
p.copy(
additionalHandlers = p.additionalHandlers.orElse {
translation.FansiShow.fansiHandler
}
)
}
val tg1 = TermGenParams.zero.copy(appW = 0.1, unAppW = 0.1)
import library._, MonoidSimple._
val ts = TermState(dist1, dist1.map(_.typ))
import monix.execution.Scheduler.Implicits.global
val lp1 = LocalProver(ts, tg1)
val lemT1 = lp1.lemmas
lemT1.runToFuture
val lem = eqM(l)(op(l)(r))
val termsT = lp1.expressionEval.map(_.finalTerms)
termsT.runToFuture
val pfsT = termsT.map(_.filter(_.typ == lem))
pfsT.runToFuture
val pfT = pfsT.map(_.supp.head)
pfT.runToFuture
val lpTangT1 = pfT.flatMap(pf => lp1.distTangentProver(FiniteDistribution.unif(pf)))
val goal = eqM(l)(r)
val targGoalT1 = lpTangT1.flatMap(lpt => lpt.theoremsByStatement).map(_(goal))
targGoalT1.runToFuture
We replicated the tangent result using an actual proof, so nothing formal
val eqsT = for{
eq1 <- lp1.equations
lp2 <- lpTangT1
eq2 <- lp2.equations
} yield Equation.merge(eq1, eq2)
eqsT.runToFuture
val evT = eqsT.map(eqs => ExpressionEval.fromInitEqs(ts, eqs, tg1)).memoize
val terms2T = evT.map(_.finalTerms).memoize
val eqPfsT = terms2T.map(ts => ts.filter(_.typ == goal))
eqPfsT.runToFuture