"""Use a theorem parameter for a leading universal quantifier."""

from judgment import Session, exists


def main() raises:
    var s = Session()
    var proof = s.theorem("self_witness")
    var A = proof.type_var("A")
    var x = proof.var("x", A)
    var y = proof.bound_var("y", A)
    proof.goal(exists(y, y == x))

    proof.witness(x)
    proof.rfl()
    var theorem = proof.finish()
    print(theorem)
    print("Axiom dependencies:", len(theorem.axioms()))
