Skip to content

Commit a8b43f9

Browse files
Apply suggestions from code review
Co-authored-by: Jovan Gerbscheid <56355248+JovanGerb@users.noreply.github.com>
1 parent 781b3ad commit a8b43f9

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Mathlib/Tactic/FunProp/Mor.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,8 @@ where
135135
go (.app (.app c f) x) as
136136
| .app f a, as => go f (as.push { expr := a })
137137
| .forallE x t b bi, _ => do
138-
let u := (← inferType t).sortLevel!
139-
let v := (← withLocalDecl x bi t fun x => do
140-
return (← inferType (b.instantiate1 x)).sortLevel!)
138+
let u ← getLevel t
139+
let v ← withLocalDecl x bi t fun x => getLevel (b.instantiate1 x)
141140
k (.const `_Forall [u, v]) #[{ expr := t }, { expr := .lam x t b bi }]
142141
| f, as => k f as.reverse
143142

@@ -163,11 +162,11 @@ def getAppArgs (e : Expr) : MetaM (Array Arg) := withApp e fun _ xs => return xs
163162

164163
/-- `mkAppN f #[a₀, ..., aₙ]` ==> `f a₀ a₁ .. aₙ` where `f` can be bundled morphism. -/
165164
def mkAppN (f : Expr) (xs : Array Arg) : Expr :=
166-
let fn :=
165+
let f :=
167166
if f.isConstOf `_Forall then
168167
Expr.mkLambdaForall f.constLevels![0]! f.constLevels![1]!
169168
else f
170-
xs.foldl (init := fn) (fun f x =>
169+
xs.foldl (init := f) (fun f x =>
171170
match x with
172171
| ⟨x, .none⟩ => (f.app x)
173172
| ⟨x, some coe⟩ => (coe.app f).app x)

0 commit comments

Comments
 (0)