Lean4
/-- Elaborator for `prod_assoc%`. -/
@[term_elab prodAssocStx]
def elabProdAssoc : TermElab := fun stx expectedType? => do
match stx with
| `(prod_assoc_internal%) =>
do
let some expectedType ← tryPostponeIfHasMVars? expectedType? |
throwError"expected type must be known"
let .app (.app (.const ``Equiv _) a) b := expectedType |
throwError "Expected type{indentD expectedType}\nis not of the form `α ≃ β`."
mkProdEquiv a b
| _ =>
throwUnsupportedSyntax