Built with doc-gen4, running Lean4. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+โ†‘Ctrl+โ†“to navigate, Ctrl+๐Ÿ–ฑ๏ธto focus. On Mac, use Cmdinstead of Ctrl.
/-
Copyright (c) 2022 Jannis Limperg. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jannis Limperg
-/

import Std.Lean.Meta.Basic

open Lean Lean.Meta

namespace Lean.Meta

/--
Description of a hypothesis for `Lean.MVarId.assertHypotheses'`.
-/
structure 
Hypothesis': Type
Hypothesis'
extends
Hypothesis: Type
Hypothesis
where /-- The hypothesis' `BinderInfo` -/
binderInfo: Hypothesis' โ†’ BinderInfo
binderInfo
:
BinderInfo: Type
BinderInfo
/-- The hypothesis' `LocalDeclKind` -/ kind :
LocalDeclKind: Type
LocalDeclKind
/-- Add the given hypotheses to the local context. This is a generalisation of `Lean.MVarId.assertHypotheses` which lets you specify -/ def
_root_.Lean.MVarId.assertHypotheses': MVarId โ†’ Array Hypothesis' โ†’ MetaM (Array FVarId ร— MVarId)
_root_.Lean.MVarId.assertHypotheses'
(
mvarId: MVarId
mvarId
:
MVarId: Type
MVarId
) (hs :
Array: Type ?u.454 โ†’ Type ?u.454
Array
Hypothesis': Type
Hypothesis'
) :
MetaM: Type โ†’ Type
MetaM
(
Array: Type ?u.459 โ†’ Type ?u.459
Array
FVarId: Type
FVarId
ร—
MVarId: Type
MVarId
) := do let (
fvarIds: Array FVarId
fvarIds
,
mvarId: MVarId
mvarId
) โ†
mvarId: MVarId
mvarId
.
assertHypotheses: MVarId โ†’ Array Hypothesis โ†’ MetaM (Array FVarId ร— MVarId)
assertHypotheses
$ hs.
map: {ฮฑ : Type ?u.540} โ†’ {ฮฒ : Type ?u.539} โ†’ (ฮฑ โ†’ ฮฒ) โ†’ Array ฮฑ โ†’ Array ฮฒ
map
(ยท.
toHypothesis: Hypothesis' โ†’ Hypothesis
toHypothesis
)
mvarId: MVarId
mvarId
.
modifyLCtx: {m : Type โ†’ Type} โ†’ [inst : MonadMCtx m] โ†’ MVarId โ†’ (LocalContext โ†’ LocalContext) โ†’ m Unit
modifyLCtx
ฮป
lctx: ?m.635
lctx
=>
Id.run: {ฮฑ : Type ?u.637} โ†’ Id ฮฑ โ†’ ฮฑ
Id.run
do let mut
lctx: ?m.757
lctx
:=
lctx: ?m.635
lctx
for
h: ?m.751
h
:
i: ?m.748
i
in [:hs.
size: {ฮฑ : Type ?u.694} โ†’ Array ฮฑ โ†’ Nat
size
] do let
h: ?m.760
h
:= hs[
i: ?m.748
i
]'
h: ?m.751
h
.
2: โˆ€ {a b : Prop}, a โˆง b โ†’ b
2
if
h: ?m.760
h
.kind !=
.default: LocalDeclKind
.default
then lctx :=
lctx: ?m.757
lctx
.
setKind: LocalContext โ†’ FVarId โ†’ LocalDeclKind โ†’ LocalContext
setKind
fvarIds: Array FVarId
fvarIds
[
i: ?m.748
i
]!
h: ?m.760
h
.kind if
h: ?m.760
h
.
binderInfo: Hypothesis' โ†’ BinderInfo
binderInfo
!=
.default: BinderInfo
.default
then
lctx: ?m.1265
lctx
:= lctx.
setBinderInfo: LocalContext โ†’ FVarId โ†’ BinderInfo โ†’ LocalContext
setBinderInfo
fvarIds: Array FVarId
fvarIds
[
i: ?m.748
i
]!
h: ?m.760
h
.
binderInfo: Hypothesis' โ†’ BinderInfo
binderInfo
pure: {f : Type ?u.1529 โ†’ Type ?u.1528} โ†’ [self : Pure f] โ†’ {ฮฑ : Type ?u.1529} โ†’ ฮฑ โ†’ f ฮฑ
pure
lctx: ?m.1526
lctx
return (
fvarIds: Array FVarId
fvarIds
,
mvarId: MVarId
mvarId
) end Lean.Meta