Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cslib/Foundations/Data/HasFresh.lean
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ def HasFresh.freeUnion : TermElab := fun stx _ => do

for ldecl in ← getLCtx do
if !ldecl.isImplementationDetail then
let local_type ← ldecl.toExpr |> inferType >=> whnf
for map in maps do
if let Expr.forallE _ dom _ _ := ← inferType map then
if ← isDefEq local_type dom then
finsets := finsets.push (map.betaRev #[ldecl.toExpr])
let finset ← try
mkAppM' map #[ldecl.toExpr]
catch _ =>
continue
finsets := finsets.push finset.headBeta

let _dec : Q(DecidableEq $α) ← synthInstanceQ q(DecidableEq $α)
let union := finsets.foldl (fun a b : Q(Finset $α) => q($a ∪ $b)) q(∅)
Expand Down
Loading