77
88public import Lean.Elab.Tactic.Location
99public import KernelHom.Kernel.MonoidalComp
10- public import KernelHom.Mathlib.MeasurableEquiv
1110public import KernelHom.Tactic.LocTactic
1211public import KernelHom.Tactic.Hom.Universe
1312public import KernelHom.Tactic.Hom.Utils
@@ -24,7 +23,7 @@ kernels into equivalent equalities in the monoidal category.
2423 categorical morphism expressions.
2524* `mkKernelHomEqProof`: construction of the equivalence proof used by the
2625 tactic.
27- * `applyKernelHom`: core implementation on goals and hypotheses.
26+ * `applyKernelHom`: core implementation of `kernel_hom` on goals and hypotheses.
2827* `kernel_hom`: user-facing tactic (with location support).
2928 -/
3029
@@ -342,8 +341,8 @@ def mkKernelHomEqProof (eqProofType rhs lhs : Expr) (maxLvl : Level)
342341 | [forwardGoal, backwardGoal] =>
343342 setGoals [forwardGoal]
344343 evalTactic (← `(tactic| intro h))
345- for e in op_data do
346- match e with
344+ for op in op_data do
345+ match op with
347346 | .leftUnitor_hom lvl sfinker equiv =>
348347 let punitLevelStx ← liftMacroM <| levelToSyntax lvl
349348 let sfinkerStx ← Term.exprToSyntax sfinker
@@ -412,10 +411,9 @@ def mkKernelHomEqProof (eqProofType rhs lhs : Expr) (maxLvl : Level)
412411 evalTactic congr_tac
413412 catch _ =>
414413 pure ()
415- for e in op_data do
416- match e with
414+ for op in op_data do
415+ match op with
417416 | .WhiskerLeft sfinker equiv =>
418- logInfo m! "WhiskerLeft: { sfinker} , { equiv} "
419417 let sfinkerStx ← Term.exprToSyntax sfinker
420418 let equivStx ← Term.exprToSyntax equiv
421419 evalTactic (← `(tactic| nth_rw 1 [
@@ -425,7 +423,6 @@ def mkKernelHomEqProof (eqProofType rhs lhs : Expr) (maxLvl : Level)
425423 catch _ =>
426424 pure ()
427425 | .WhiskerRight sfinker equiv =>
428- logInfo m! "WhiskerRight: { sfinker} , { equiv} "
429426 let sfinkerStx ← Term.exprToSyntax sfinker
430427 let equivStx ← Term.exprToSyntax equiv
431428 evalTactic (← `(tactic| nth_rw 1 [
@@ -435,7 +432,6 @@ def mkKernelHomEqProof (eqProofType rhs lhs : Expr) (maxLvl : Level)
435432 catch _ =>
436433 pure ()
437434 | .MonoidalComp sfinkerW ew sfinkerX ex sfinkerY ey sfinkerZ ez =>
438- logInfo m! "MonoidalComp: { sfinkerW} , { ew} , { sfinkerX} , { ex} , { sfinkerY} , { ey} , { sfinkerZ} , { ez} "
439435 let sfinkerWStx ← Term.exprToSyntax sfinkerW
440436 let ewStx ← Term.exprToSyntax ew
441437 let sfinkerXStx ← Term.exprToSyntax sfinkerX
@@ -459,8 +455,8 @@ def mkKernelHomEqProof (eqProofType rhs lhs : Expr) (maxLvl : Level)
459455
460456 setGoals [backwardGoal]
461457 evalTactic (← `(tactic| intro h))
462- for e in op_data do
463- match e with
458+ for op in op_data do
459+ match op with
464460 | .leftUnitor_hom lvl sfinker equiv =>
465461 let punitLevelStx ← liftMacroM <| levelToSyntax lvl
466462 let sfinkerStx ← Term.exprToSyntax sfinker
@@ -531,8 +527,8 @@ def mkKernelHomEqProof (eqProofType rhs lhs : Expr) (maxLvl : Level)
531527 evalTactic congr_tac
532528 catch _ =>
533529 pure ()
534- for e in op_data do
535- match e with
530+ for op in op_data do
531+ match op with
536532 | .WhiskerLeft sfinker equiv =>
537533 let sfinkerStx ← Term.exprToSyntax sfinker
538534 let equivStx ← Term.exprToSyntax equiv
@@ -581,33 +577,6 @@ def mkKernelHomEqProof (eqProofType rhs lhs : Expr) (maxLvl : Level)
581577 setGoals savedGoals
582578 instantiateMVars mvar
583579
584- /-- Construct the proof of equivalence between the original equality and the transformed one. -/
585- def mkKernelHomEqProofSorry (eqProofType rhs lhs : Expr) (maxLvl : Level)
586- (op_data : List CategoryOP) : TacticM Expr := do
587- let maxLvlStx ← liftMacroM <| levelToSyntax maxLvl
588- let rhsStx ← Term.exprToSyntax rhs
589- let lhsStx ← Term.exprToSyntax lhs
590- let op_data := op_data.reverse
591- let savedGoals ← getGoals
592- let mvar ← mkFreshExprSyntheticOpaqueMVar eqProofType
593- let mvarId := mvar.mvarId!
594- setGoals [mvarId]
595- evalTactic (← `(tactic| apply propext))
596- evalTactic (← `(tactic| constructor))
597- let goalsAfterConstructor ← getGoals
598- match goalsAfterConstructor with
599- | [forwardGoal, backwardGoal] =>
600- setGoals [forwardGoal]
601- evalTactic (← `(tactic| sorry ))
602-
603- setGoals [backwardGoal]
604- evalTactic (← `(tactic| sorry ))
605- | _ =>
606- setGoals savedGoals
607- throwError "Expected exactly two goals after `constructor`"
608- setGoals savedGoals
609- instantiateMVars mvar
610-
611580/-- The `kernel_hom` tactic transforms a kernel equality to an equivalent equality in
612581the category of measurable spaces and s-finite kernels.
613582
0 commit comments