text
stringlengths 0
3.34M
|
---|
module CodeGen.RegAlloc
import CommonDef
import Core.Name.Namespace
import Core.Context
import Compiler.Common
import Compiler.ANF
import Data.List
import Data.String
import Data.Vect
import Data.SortedSet
import Data.SortedMap
import CairoCode.CairoCode
import CairoCode.CairoCodeUtils
import Primitives.Externals
import Primitives.Primitives
%hide Prelude.toList
data Elem : Type where
Branch : Int -> Elem
Case : Int -> Elem
Eq Elem where
(==) (Branch a) (Branch b) = a == b
(==) (Case a) (Case b) = a == b
(==) _ _ = False
(/=) (Branch a) (Branch b) = a /= b
(/=) (Case a) (Case b) = a /= b
(/=) _ _ = True
data UseDef : Type where
Use : List Elem -> Int -> UseDef
Def : List Elem -> Int -> Maybe CairoConst -> UseDef
%prefix_record_projections off
record RegInfo where
constructor MkRegInfo
positions: List UseDef
reg: CairoReg --Is the original Register
alloc: CairoReg --Is the newly allocated Register
emptyRegInfo : CairoReg -> RegInfo
emptyRegInfo r = MkRegInfo [] r r
addUseDef: UseDef -> RegInfo -> RegInfo
addUseDef ud rg = { positions $= (ud::) } rg
mutual
%prefix_record_projections off
record RegTreeBlock where
constructor MkRegTreeBlock
depth : Int
regs: List RegInfo
cases: SortedMap Int RegTreeCase
%prefix_record_projections off
record RegTreeCase where
constructor MkRegTreeCase
depth : Int
regs: List RegInfo
blocks: SortedMap Int RegTreeBlock
commonPrefix : List Elem -> List Elem -> List Elem
commonPrefix _ Nil = Nil
commonPrefix Nil _ = Nil
commonPrefix (h1::tail1) (h2::tail2) = if h1 == h2 then h1::(commonPrefix tail1 tail2) else Nil
insertReg : RegTreeBlock -> RegInfo -> RegTreeBlock
insertReg root regInfo = insertIntoBlock (root.depth) pathRes (Just root)
where
computePrefix: Maybe (List Elem) -> UseDef -> Maybe (List Elem)
computePrefix Nothing (Def path _ _) = Just path
computePrefix Nothing (Use path _) = Just path
computePrefix (Just pathAcc) (Def path _ _) = Just (commonPrefix path pathAcc)
computePrefix (Just pathAcc) (Use path _) = Just (commonPrefix path pathAcc)
pathRes: List Elem
pathRes = fromMaybe [] (foldl computePrefix Nothing (regInfo.positions))
mutual
insertIntoBlock: Int -> List Elem -> Maybe RegTreeBlock -> RegTreeBlock
insertIntoBlock _ Nil (Just block) = MkRegTreeBlock (block.depth) (regInfo::(block.regs)) (block.cases)
insertIntoBlock depth Nil Nothing = MkRegTreeBlock depth [regInfo] empty
insertIntoBlock depth ((Case i)::rest) (Just block) = MkRegTreeBlock (block.depth) (block.regs) (insert i (insertIntoCase depth rest (lookup i (block.cases))) (block.cases))
insertIntoBlock depth ((Case i)::rest) Nothing = MkRegTreeBlock depth [] (singleton i (insertIntoCase depth rest Nothing))
insertIntoBlock depth _ _ = MkRegTreeBlock depth [] empty -- should not happen
insertIntoCase : Int -> List Elem -> Maybe RegTreeCase -> RegTreeCase
insertIntoCase _ Nil (Just cases) = MkRegTreeCase (cases.depth) (regInfo::(cases.regs)) (cases.blocks)
insertIntoCase depth Nil Nothing = MkRegTreeCase depth [regInfo] empty
insertIntoCase depth ((Branch i)::rest) (Just cases) = MkRegTreeCase (cases.depth) (cases.regs) (insert i (insertIntoBlock (depth+1) rest (lookup i (cases.blocks))) (cases.blocks))
insertIntoCase depth ((Branch i)::rest) Nothing = MkRegTreeCase depth [] (singleton i (insertIntoBlock (depth+1) rest Nothing))
insertIntoCase depth _ _ = MkRegTreeCase depth [] empty -- should not happen
buildTree : SortedMap CairoReg RegInfo -> RegTreeBlock
buildTree regInfoMap = foldl insertReg (MkRegTreeBlock 0 [] empty) (values regInfoMap)
RegUseState : Type
RegUseState = (Int,Int,Int) -- currentApRegion, nextApRegion, nextCaseIndex
addRegDef : UseDef -> SortedMap CairoReg RegInfo -> CairoReg -> SortedMap CairoReg RegInfo
addRegDef ud apMap reg = insert reg (includeUseDef (lookup reg apMap)) apMap
where
includeUseDef : Maybe RegInfo -> RegInfo
includeUseDef Nothing = MkRegInfo [ud] reg reg
includeUseDef (Just oldInfo) = addUseDef ud oldInfo
addResRegDef : List Elem -> Int -> Maybe CairoConst -> CairoReg -> SortedMap CairoReg RegInfo -> SortedMap CairoReg RegInfo
addResRegDef path apRegion const reg apMap = addRegDef (Def path apRegion const) apMap reg
addResRegDefs : List Elem -> Int -> List CairoReg -> SortedMap CairoReg RegInfo -> SortedMap CairoReg RegInfo
addResRegDefs path apRegion regs apMap = foldl addRegDefAcc apMap regs
where
addRegDefAcc : SortedMap CairoReg RegInfo -> CairoReg -> SortedMap CairoReg RegInfo
addRegDefAcc acc reg = addResRegDef path apRegion Nothing reg acc
addRegUse : List Elem -> Int -> CairoReg -> SortedMap CairoReg RegInfo -> SortedMap CairoReg RegInfo
addRegUse path apRegion reg apMap = insert reg (includeUseDef (lookup reg apMap)) apMap
where
ud : UseDef
ud = Use path apRegion
includeUseDef : Maybe RegInfo -> RegInfo
includeUseDef Nothing = MkRegInfo [ud] reg reg
includeUseDef (Just oldInfo) = addUseDef ud oldInfo
addRegUses : List Elem -> Int -> List CairoReg -> SortedMap CairoReg RegInfo -> SortedMap CairoReg RegInfo
addRegUses path apRegion regs apMap = foldl addRegUseAcc apMap regs
where
addRegUseAcc : SortedMap CairoReg RegInfo -> CairoReg -> SortedMap CairoReg RegInfo
addRegUseAcc acc reg = addRegUse path apRegion reg acc
collectCairoInstRegUseBefore : List Elem -> Int -> SortedMap CairoReg RegInfo -> CairoInst -> SortedMap CairoReg RegInfo
collectCairoInstRegUseBefore path apRegion apMap (ASSIGN _ from) = addRegUse (reverse path) apRegion from apMap
collectCairoInstRegUseBefore path apRegion apMap (MKCON _ _ args) = addRegUses (reverse path) apRegion args apMap
collectCairoInstRegUseBefore path apRegion apMap (MKCLOSURE _ _ _ args) = addRegUses (reverse path) apRegion args apMap
collectCairoInstRegUseBefore path apRegion apMap (APPLY _ impls clo arg) = addRegUses (reverse path) apRegion (clo::arg::(map fst (values impls))) apMap
collectCairoInstRegUseBefore path apRegion apMap (MKCONSTANT _ _ ) = apMap
collectCairoInstRegUseBefore path apRegion apMap (CALL _ impls _ args) = addRegUses (reverse path) apRegion (args ++ (map fst (values impls))) apMap
collectCairoInstRegUseBefore path apRegion apMap (OP _ impls _ args) = addRegUses (reverse path) apRegion (args ++ (map fst (values impls))) apMap
collectCairoInstRegUseBefore path apRegion apMap (EXTPRIM _ impls _ args) = addRegUses (reverse path) apRegion (args ++ (map fst (values impls))) apMap
collectCairoInstRegUseBefore path apRegion apMap (CASE from _ _) = addRegUse (reverse path) apRegion from apMap
collectCairoInstRegUseBefore path apRegion apMap (CONSTCASE from _ _) = addRegUse (reverse path) apRegion from apMap
collectCairoInstRegUseBefore path apRegion apMap (RETURN froms impls) = addRegUses (reverse path) apRegion (froms ++ (values impls)) apMap
collectCairoInstRegUseBefore path apRegion apMap (PROJECT _ from _) = addRegUse (reverse path) apRegion from apMap
collectCairoInstRegUseBefore path apRegion apMap (NULL _) = apMap
collectCairoInstRegUseBefore path apRegion apMap (ERROR _ _) = apMap
collectCairoInstRegUseAfter : List Elem -> Int -> SortedMap CairoReg RegInfo -> CairoInst -> SortedMap CairoReg RegInfo
collectCairoInstRegUseAfter path apRegion apMap (ASSIGN to _) = addResRegDef (reverse path) apRegion Nothing to apMap
collectCairoInstRegUseAfter path apRegion apMap (MKCON to _ _) = addResRegDef (reverse path) apRegion Nothing to apMap
collectCairoInstRegUseAfter path apRegion apMap (MKCLOSURE to _ _ _) = addResRegDef (reverse path) apRegion Nothing to apMap
collectCairoInstRegUseAfter path apRegion apMap (APPLY to impls _ _) = addResRegDefs (reverse path) apRegion (to::(map snd (values impls))) apMap
collectCairoInstRegUseAfter path apRegion apMap (MKCONSTANT to c ) = addResRegDef (reverse path) apRegion (Just c) to apMap
collectCairoInstRegUseAfter path apRegion apMap (CALL tos impls _ _) = addResRegDefs (reverse path) apRegion (tos ++ (map snd (values impls))) apMap
collectCairoInstRegUseAfter path apRegion apMap (OP to impls _ _) = addResRegDefs (reverse path) apRegion (to::(map snd (values impls))) apMap
collectCairoInstRegUseAfter path apRegion apMap (EXTPRIM tos impls _ _) = addResRegDefs (reverse path) apRegion (tos ++ (map snd (values impls))) apMap
collectCairoInstRegUseAfter path apRegion apMap (CASE _ _ _) = apMap
collectCairoInstRegUseAfter path apRegion apMap (CONSTCASE _ _ _) = apMap
collectCairoInstRegUseAfter path apRegion apMap (RETURN _ _) = apMap
collectCairoInstRegUseAfter path apRegion apMap (PROJECT to _ _) = addResRegDef (reverse path) apRegion Nothing to apMap
collectCairoInstRegUseAfter path apRegion apMap (NULL to) = addResRegDef (reverse path) apRegion Nothing to apMap
collectCairoInstRegUseAfter path apRegion apMap (ERROR to _) = addResRegDef (reverse path) apRegion Nothing to apMap
isCairoInstApModStatic : SortedSet Name -> CairoInst -> Bool
isCairoInstApModStatic _ (APPLY _ _ _ _) = False -- An apply can result in an arbitrary ap mod, so this is undef
isCairoInstApModStatic safeCalls (CALL _ _ n _) = contains n safeCalls
isCairoInstApModStatic _ (EXTPRIM _ _ name _) = externalApStable name
isCairoInstApModStatic _ (OP _ _ fn _) = primFnApStable fn
isCairoInstApModStatic _ (CASE _ _ _) = False
isCairoInstApModStatic _ (CONSTCASE _ _ _) = False
isCairoInstApModStatic _ (ERROR _ _ ) = False
isCairoInstApModStatic _ _ = True
mutual
collectCairoInstRegUseCase : SortedSet Name -> List Elem -> (SortedMap CairoReg RegInfo, RegUseState) -> CairoInst -> List (List CairoInst) -> (SortedMap CairoReg RegInfo, RegUseState)
collectCairoInstRegUseCase safeCalls path (apMap, (curApRegion, nextApRegion, nextCase)) inst cases = (after, (afterApRegion, afterApRegion+1, nextCase+1))
where
before : SortedMap CairoReg RegInfo
before = collectCairoInstRegUseBefore path curApRegion apMap inst
branchExtractHelper : Int -> (SortedMap CairoReg RegInfo, RegUseState) -> (SortedMap CairoReg RegInfo, (Int,Int))
branchExtractHelper nextBr (apMap,(_, next, _)) = (apMap, (next,nextBr))
newPath : List Elem
newPath = (Case nextCase)::path
applyBranch : (SortedMap CairoReg RegInfo, (Int,Int)) -> List CairoInst -> (SortedMap CairoReg RegInfo, (Int,Int))
applyBranch (state, (nextApRegion, br)) insts = branchExtractHelper (br+1) (collectCairoInstRegUses safeCalls (Branch br::newPath) (state, (curApRegion, nextApRegion, 0)) insts)
inside : (SortedMap CairoReg RegInfo, (Int,Int))
inside = foldl applyBranch (before,(nextApRegion,0)) cases
afterApRegion : Int
afterApRegion = fst (snd inside)
after : SortedMap CairoReg RegInfo
after = collectCairoInstRegUseAfter path afterApRegion (fst inside) inst
collectCairoInstRegUse : SortedSet Name -> List Elem -> (SortedMap CairoReg RegInfo, RegUseState) -> CairoInst -> (SortedMap CairoReg RegInfo, RegUseState)
collectCairoInstRegUse safeCalls path state (CASE from alts Nothing) = collectCairoInstRegUseCase safeCalls path state (CASE from alts Nothing) (map snd alts)
collectCairoInstRegUse safeCalls path state (CASE from alts (Just def)) = collectCairoInstRegUseCase safeCalls path state (CASE from alts (Just def)) (def::(map snd alts))
collectCairoInstRegUse safeCalls path state (CONSTCASE from alts Nothing) = collectCairoInstRegUseCase safeCalls path state (CONSTCASE from alts Nothing) (map snd alts)
collectCairoInstRegUse safeCalls path state (CONSTCASE from alts (Just def)) = collectCairoInstRegUseCase safeCalls path state (CONSTCASE from alts (Just def)) (def::(map snd alts))
collectCairoInstRegUse safeCalls path (apMap, (curApRegion, nextApRegion, nextCase)) inst = process (isCairoInstApModStatic safeCalls inst)
where
before : SortedMap CairoReg RegInfo
before = collectCairoInstRegUseBefore path curApRegion apMap inst
applyAfter : Int -> SortedMap CairoReg RegInfo -> SortedMap CairoReg RegInfo
applyAfter region curApMap = collectCairoInstRegUseAfter path region curApMap inst
process : Bool -> (SortedMap CairoReg RegInfo, RegUseState)
process False = (applyAfter nextApRegion before, (nextApRegion, nextApRegion+1, nextCase))
process True = (applyAfter curApRegion before, (curApRegion, nextApRegion, nextCase))
collectCairoInstRegUses: SortedSet Name -> List Elem -> (SortedMap CairoReg RegInfo, RegUseState) -> List CairoInst -> (SortedMap CairoReg RegInfo, RegUseState)
collectCairoInstRegUses safeCalls path state insts = foldl (collectCairoInstRegUse safeCalls path) state insts
collectRegUse : SortedSet Name -> List CairoReg -> List CairoInst -> (SortedMap CairoReg RegInfo, Bool)
collectRegUse safeCalls args insts = (fst collectionRes, hasSingleApRegion)
where
mapEntry : CairoReg -> (CairoReg, RegInfo)
mapEntry reg = (reg, MkRegInfo [Def [] 0 Nothing] reg reg)
initial : List CairoReg -> SortedMap CairoReg RegInfo
initial args = fromList (map mapEntry args)
initialApRegion: Int
initialApRegion = 0
collectionRes : (SortedMap CairoReg RegInfo, RegUseState)
collectionRes = collectCairoInstRegUses safeCalls [] (initial args,(initialApRegion,initialApRegion+1,0)) insts
hasSingleApRegion : Bool
hasSingleApRegion = (fst (snd collectionRes)) == initialApRegion
SelectionState : Type
SelectionState = (SortedMap CairoReg CairoReg,(Int, Int))
assignRegs : SelectionState -> Int -> List RegInfo -> SelectionState
assignRegs state depth regs = foldl assignReg state regs
where
decideTempType : Maybe CairoConst -> Bool -> Int -> CairoReg
decideTempType (Just v) _ _ = Const v
decideTempType Nothing False index = Temp index depth
decideTempType Nothing True index = Let index depth
extractUsePath : UseDef -> List (List Elem)
extractUsePath (Use p _) = [p]
extractUsePath (Def _ _ _) = []
isCase : Maybe Elem -> Bool
isCase Nothing = False -- share the root, so in same branch
isCase (Just (Branch _)) = False -- share a branch
isCase (Just (Case _)) = True -- share a case but not a branch
checkPrefixCase : List Elem -> List (List Elem) -> Bool
checkPrefixCase _ Nil = True
checkPrefixCase p1 (p2::tail) = isCase (last' (commonPrefix p1 p2))
distinctBranch : List (List Elem) -> Bool
distinctBranch Nil = True
distinctBranch (p::tail) = (checkPrefixCase p tail) && (distinctBranch tail)
isSingleUse : List UseDef -> Bool
isSingleUse uds = distinctBranch (uds >>= extractUsePath)
extractConstant : UseDef -> List CairoConst
extractConstant (Use _ _) = Nil
extractConstant (Def _ _ Nothing) = Nil
extractConstant (Def _ _ (Just s)) = [s]
uniqueElem : List CairoConst -> Maybe CairoConst
uniqueElem [v] = Just v
uniqueElem _ = Nothing
extractSingleConstant : List UseDef -> Maybe CairoConst
extractSingleConstant uds = uniqueElem (toList (SortedSet.fromList (uds >>= extractConstant)))
doRegAlloc : Maybe Int -> SelectionState -> RegInfo -> SelectionState
doRegAlloc (Just regio) (mapping, (nextLocal, nextTemp)) (MkRegInfo ud r _) = (insert r (decideTempType (extractSingleConstant ud) (isSingleUse ud) nextTemp) mapping, (nextLocal,nextTemp+1)) -- is temp/let/const assignable
doRegAlloc Nothing (mapping, (nextLocal, nextTemp)) (MkRegInfo ud r _) = (insert r (Local nextLocal depth) mapping, (nextLocal+1,nextTemp)) -- must be local assigned
mergeApRegions : Int -> Maybe Int -> Maybe Int
mergeApRegions _ Nothing = Nothing
mergeApRegions newRegion (Just oldRegion) = if newRegion == oldRegion then Just oldRegion else Nothing
detectApRegion : List UseDef -> Maybe Int
detectApRegion Nil = Nothing -- should never happen
detectApRegion ((Use _ apRegion)::Nil) = Just apRegion
detectApRegion ((Def _ apRegion _)::Nil) = Just apRegion
detectApRegion ((Use _ apRegion)::tail) = mergeApRegions apRegion (detectApRegion tail)
detectApRegion ((Def _ apRegion _)::tail) = mergeApRegions apRegion (detectApRegion tail)
assignReg : SelectionState -> RegInfo -> SelectionState
assignReg state assig@(MkRegInfo locs r (Unassigned _ _ _)) = doRegAlloc (detectApRegion locs) state assig
assignReg (mapping, counters) (MkRegInfo _ r res) = (insert r res mapping, counters) --Already ia allocated skip
mutual
assignBlockRegs : SelectionState -> RegTreeBlock -> SelectionState
assignBlockRegs state block = assignNestedRegs
where
assignBlockLocatedRegs : SelectionState
assignBlockLocatedRegs = assignRegs state (block.depth) (block.regs)
assignNestedRegs : SelectionState
assignNestedRegs = foldl assignCaseRegs assignBlockLocatedRegs (values block.cases)
assignCaseRegs : SelectionState -> RegTreeCase -> SelectionState
assignCaseRegs state cases = mergeResults (assignNestedBranchesRegs assignCaseLocatedRegs)
where
assignCaseLocatedRegs : SelectionState
assignCaseLocatedRegs = assignRegs state (cases.depth) (cases.regs)
assignNestedBranchesRegs : SelectionState -> List SelectionState
assignNestedBranchesRegs (_, counters) = map (assignBlockRegs (empty, counters)) (values cases.blocks)
mergeStates : SelectionState -> SelectionState -> SelectionState
mergeStates (mapping1, (nextLocal1, nextTemp1)) (mapping2, (nextLocal2, nextTemp2)) = (mergeLeft mapping1 mapping2, (max nextLocal1 nextLocal2, max nextTemp1 nextTemp2))
mergeResults : List SelectionState -> SelectionState
mergeResults branchResults = foldl mergeStates (fst assignCaseLocatedRegs, (0,0)) branchResults
public export
allocateCairoDefRegisters : SortedSet Name -> (Name, CairoDef) -> (CairoDef, SortedSet Name)
allocateCairoDefRegisters safeCalls def@(n, FunDef args implicits rets body) = (updatedDef, updatedSafeCalls)
where collectedRegs : (SortedMap CairoReg RegInfo, Bool)
collectedRegs = collectRegUse safeCalls args body
builtTree : RegTreeBlock
builtTree = buildTree (fst collectedRegs)
assignedRegs : SelectionState
assignedRegs = assignBlockRegs (empty,(0,0)) builtTree
updatedDef : CairoDef
updatedDef = snd $ substituteDefRegisters (\reg => lookup reg (fst assignedRegs)) def
updatedSafeCalls : SortedSet Name
updatedSafeCalls = if (snd collectedRegs) then (insert n safeCalls) else safeCalls
allocateCairoDefRegisters safeCalls def@(n, ForeignDef info _ _) = if isApStable info
then (snd def, insert n safeCalls)
else (snd def, safeCalls)
|
# 1. Paper and Group Details
**Paper Title:** Duplex Generative Adversarial Network for Unsupervised Domain Adaptation - CVPR 2018
**Authors:** Lanqing Hu, Meina Kan, Shiguang Shan, Xilin Chen
**Link:** http://openaccess.thecvf.com/content_cvpr_2018/papers/Hu_Duplex_Generative_Adversarial_CVPR_2018_paper.pdf
**Group Members:** Cem Önem, Cansu Cemre Yeşilçimen
Contact Information can be found in the README.
**Reviewers:** Y.Berk Gültekin, Hasan Ali Duran
# 2. Goals
Our results can be compared with the original results at the last section of the notebook.
## 2.1. Quantitative Results
We planned to meet the classification accuracy of the architecture mentioned in Table 1, 2nd row from the bottom, 3rd column from the left (92.46%), where the model was trained on SVHN dataset with labels + unlabeled MNIST dataset, and tested against the MNIST dataset (SVHN -> MNIST) to show the domain adaptation quality. We plan to reproduce similar results with digits 0-4 to cut down on dataset size.
## 2.2. Qualitative Results
We planned to reproduce Figure 4, where the model and the training is the same as the quantitative results, however this time SVHN images are fed into the network to generate images similar to the ones in MNIST, where digit category is preserved (for digits 0-4)
# 3. Paper Summary
## 3.1 Problem Statement
As models scale up, collecting new training data to train models becomes more and more expensive. Transfer learning is a remedy technique to this complication where the model exploits its experience gained from training for other tasks that are similar to the one at hand.
DupGAN mainly tackles the issue of **unsupervised domain adaptation**, a subset of Transfer Learning in which there are two domains that share categories but have different data distrubutions. **The ground truth labels are only available for one of the domains** (the source domain), therefore the model is expected to utilize the sample-label relation of this domain to unsupervisedly classify the samples of the other domain (the target domain).
In our reproduction we will treat these domains as follows:
- Source domain training data: SVHN train set digit images + labels for digits 0-4
- Target domain training data: MNIST train set digit images for digits 0-4
- Target domain test data (for classification): MNIST test set digit images for digits 0-4
## 3.2 Definitions and Model Architecture Overview
Let the source domain training data be denoted as $S = \{(x^s_i, y^s_i)\}^n_{i=1}$ with source images $X^s = \{x^s_i\}^n_{i=1}$ and labels $Y^s = \{y^s_i\}^n_{i=1}$. Each $y^s \in Y^s$ correspond to a label in the set $B = \{b_0,\ b_1...b_c\}$ with cardinality $c$. Let the target domain training data be denoted as $X^t = \{x^t_i\}^m_{i=1}$. **Note that there is no $Y^t$.**
DupGAN attempts to better the classification quality by training for category preserving domain translation as well as classification. To that end, a hybrid autoencoder GAN architecture where the generator $G$ with two outputs is put against two discriminators $D^s, D^t$ for the source and the target domains respectively:
<center>Figure 1: Overview of DupGAN Architecture</center>
The encoder $E$ at the beginning compresses the images (without any regard to type of domain) into encodings which should be ideally independent of the domain:
\begin{align}
Z^s &= \{z^s \mid E(x^s) = z^s,\ x^s \in X^s \} \\
Z^t &= \{z^t \mid E(x^t) = z^t,\ x^t \in X^t \} \\
Z &= Z^s \cup Z^t
\end{align}
$G$ takes this encoding as well as a domain code $a$ as input, where $a \in \{s, t \}$ indicates the domain type of the image that should be generated. In the end, the following 4 modes of $G$ are integral during training, for $z^s \in Z^s$ and $z^t \in Z^t$:
- source to source, $X^{ss} = \{x^{ss} \mid G(z^s,s) = x^{ss},\ z^s \in Z^s \}$
- target to target, $X^{tt} = \{x^{tt} \mid G(z^t,t) = x^{tt},\ z^t \in Z^t \}$
- source to target, $X^{ss} = \{x^{st} \mid G(z^s,t) = x^{st},\ z^s \in Z^s \}$
- target to source, $X^{ss} = \{x^{ts} \mid G(z^s,s) = x^{ts},\ z^t \in Z^t \}$
The first two are used for assessing reconstruction quality to ensure $E$ and $G$ work properly as an autoencoder. The other two are to deceive $D^s, D^t$ for GAN training.
Other than telling real images apart from the real ones, the discriminators also categorize the images in the correct labels. To that end, the discriminators categorize images in bins $B' = \{b_0,\ b_1...b_{c+1}\}$ of cardinality $c+1$ with some probabilities $p^s_l, p^t_l$, where first $c$ bins correspond to the labels and the last bin $b_{c+1}$ is reserved for fake images.
\begin{align}
p^{s}_l &= D^s(x,l) & l \in B',\ x \in X^{s} \cup X^{ts} \\
p^{t}_l &= D^t(x,l) & l \in B',\ x \in X^{t} \cup X^{st}
\end{align}
Lastly, there is a classifier $C$ on top of the encodings. It sorts images from both domains into $L$ with some probability $p^c_l$:
\begin{align}
p^c_l &= C(z,l) & l \in B,\ z \in Z
\end{align}
It might seem redundant since the $D^s, D^t$ are also doing classification, but the classifier is necessary for the target domain at the pretraining stage. The purpose of $C$ will become clear in the further sections.
## 3.3. Training Details and Objective Functions for the Modules
### 3.3.1. Pseudolabels for Target Domain
In the following sections, the objective function formulations for the models require labels for both domains. **Since the ground truth labels are missing for the target domain, they are compansated with pseudolabels generated from the classifier $C$**. The high confidence target dataset with supervised labels is defined as follows:
\begin{align}
T &= \{ (x^t,y^{t}) \mid C(E(x^t),y^{t}) > p_{thres},\ x^t \in X^t,\ y^{t} \in B \}
\end{align}
with $X^{t'}$ and $Y^{t'}$ as data and the labels of this constructed dataset. After pretraining (explained below), $T$ replaces $X^{t}$.
$p_{thres}$ is a model hyperparameter (we picked it as 0.99 in our experiments). Note that **$T$ may change at every training step since $C$ might classify the target domain data in a different way. Therefore $T$ is renewed at every epoch of the training step.**
To increase the chances of pseudolabels being accurate, $E$ and $C$ are pretrained solely with $S$ before core DupGAN training loop.
### 3.3.2. Generator Related Losses
The generator $G$ has two purposes:
- Act as an autoencoder with the Encoder $E$, and reconstruct the original image from the encoding:
\begin{align}
L_{recon}(E,G) &= \sum_{x^s \in X^s}||x^s - G(E(x^s),s)|| + \sum_{x^t in X^t}||x^t - G(E(x^t),t)|| \\
&= \sum_{x^s \in X^s}||x^s - x^{ss})|| + \sum_{x^t \in X^t}||x^t - x^{tt}||
\end{align}
- Decieve the discriminators with fake images generated from the other domain:
\begin{align}
L_{deceive}(E,G) &= \sum_{{(x^s,y^s)} \in S}H_{B'}(D^t(G(E(x^s),t),y^s))+\sum_{{(x^t,y^t)} \in T} H_{B'}(D^s(G(E(x^t),s),y^t)) \\
&= \sum_{{(x^s,y^s)} \in S}H_{B'}(D^t(x^{st},y^s))+\sum_{{(x^t,y^t)} \in T} H_{B'}(D^s(x^{ts},y^t))
\end{align}
with $H_{B'}(\cdot,\cdot)$ as cross-entropy loss along $B'$. **The labels from the other domains are also used to make the discriminator classify the counterfeit images in the correct category other than not being fake.** This forces the generator to preserve the category when translating images. Also note that **$y^t$ are generated with the classifier $C$ since no ground truth is available** for target domain labels.
In the end, the total generator related loss becomes:
\begin{align}
L_{gen}(E,G) &= \alpha L_{recon} + L_{deceive}
\end{align}
where $\alpha$ is a model hyperparameter (we picked it as 40.0).
### 3.3.3. Discriminator Related Losses
The discriminators are not joint in DupGAN. $D^s$ and $D^t$ discriminate source and target images from counterfeit ones generated from the other domain. Both employ the cross-entropy discriminator loss in the original GAN.
- Discriminator $D^s$ has the following loss:
\begin{align}
L_{D^s} &= \sum_{{(x^s,y^s)} \in S}H_{B'}(D^t(x^s,y^s))+\sum_{{x^t} \in X^t} H_{B'}(G(E(x^t),s),b_{c+1})) \\
&= \sum_{{(x^s,y^s)} \in S}H_{B'}(D^t(x^s,y^s))+\sum_{{x^t} \in X^t} H_{B'}(D(x^{ts},b_{c+1}))
\end{align}
with $b_{c+1}$ representing the fake category.
- Discriminator $D^t$ is similar, **but pseudolabels are used instead of ground truth**:
\begin{align}
L_{D^t} &= \sum_{{(x^t,y^t)} \in T}H_{B'}(D^t(x^t,y^t))+\sum_{{x^s} \in X^s} H_{B'}(G(E(x^s),t),b_{c+1})) \\
&= \sum_{{(x^t,y^t)} \in T}H_{B'}(D^t(x^t,y^t))+\sum_{{x^s} \in X^s} H_{B'}(D(x^{st},b_{c+1}))
\end{align}
The total discriminator loss is the sum of these losses:
\begin{align}
L_{disc}(D^s,D^t) &= L_{D^s} + L_{D^t}
\end{align}
### 3.3.4. Classifier Related Losses
The training for classifier $C$ continues even after pretraining step:
\begin{align}
L_{cl}(C,E) &= \sum_{(x, y) \in S \cup T}H_{B}(C(E(x),y))
\end{align}
**During pretraining, $T = \emptyset$. After the pretraining ends, $T$ is recalculated at the beginning of every epoch.**
### 3.3.5. Total Loss and the Training Loop
Total loss is as follows:
\begin{align}
L &= \beta L_{cl} + L_{gen} + L_{disc}
\end{align}
with $\beta$ as model hyperparameter (we picked it as 40.0).
The training loop is similar to the one in the original GAN, but with the addition of pretraining part and the pseudolabel calculation step:
<br>
<br>
<center>Algorithm 1: DupGAN Training Loop.</center>
<hr style="border:2px solid gray"> </hr>
**input**: Source domain $S$.and target domain $X^t$ <br>
**output**: Model weights $W_E,\ W_G,\ W_C,\ W_{D^s},\ W_{D^t}$
1: Pretrain $E$ and $C$ with $S$ by backpropping on $L_{cl}$ until convergence: <br>
$W_E \leftarrow W_E - \eta\frac{\delta L_{cl}}{\delta W_E}$ <br>
$W_C \leftarrow W_C - \eta\frac{\delta L_{cl}}{\delta W_C}$
2: **until** convergence, **do** <br>
 2.1: Calculate $T$.
 2.2: Backprop on discriminator losses: <br>
 $W_{D^s} \leftarrow W_{D^s} - \eta\frac{\delta L_{D^s}}{\delta W_{D^s}}$ <br>
 $W_{D^t} \leftarrow W_{D^t} - \eta\frac{\delta L_{D^t}}{\delta W_{D^t}}$
 2.2: Backprop on generator and classifier losses: <br>
 $W_{G} \leftarrow W_{G} - \eta\frac{\delta L_{gen}}{\delta W_G}$ <br>
 $W_{C} \leftarrow W_{C} - \eta\frac{\delta L_{cl}}{\delta W_C}$ <br>
 $W_{E} \leftarrow W_{E} - \eta\frac{\delta (L_{cl}+L_{gen}}{\delta W_E}
3: **return** $W_E,\ W_G,\ W_C,\ W_{D^s},\ W_{D^t}$
<hr style="border:2px solid gray"> </hr>
# 4. Implementation
## 4.1 Implementation Difficulties and Differences from the Paper Specifications
Main difficulty we faced was that the architecture of the network was not presented in the original DUPGAN paper. It was described as "similar" to an architecture from an another paper named Unsupervised Image-to-Image Translation Networks (https://arxiv.org/pdf/1703.00848.pdf). Upon investigating this paper, we noticed that DUPGAN and UNIT had some differences regarding main architecture design (such as UNIT learning an actual probability distrubution which was used to sample the latent representation and DUPGAN outputting the latent vectors directly), which forced us to make some minor changes that we thought to be successful. Because of these assumptions and trials we consider this to be the reason of our accuracy result being different from our initial goal. These differences are listed below.
- In UNIT paper, for SVHN -> MNIST change, authors used the extra training set and test set. The original MNIST images were gray-scale. But in UNIT paper they are converted to RGB images and performed a data augmentation where they also used the inversions of the original MNIST images for training. We did not follow this augmentation method and used all images as they were.
- Classifier C in the original DUPGAN paper was not specified, and did not exist at all in UNIT. So we picked it as a fully connected layer on top of the encoder followed by a LeakyRELU layer, as it was the simplest choice.
- Regarding the encoder implementation UNIT paper has 1024 channels (neurons since inputs/outputs are 1x1) but those are mu,sigmas that represent a 512x1 latent vector. However DUPGAN does not do any sampling, so 512 channels suffice. We also removed the extra fully connected layer that expands to 1024 nodes owing to this.
- Learning rates are changed for experimental purposes
- Highly confident labels are gathered at each epoch rather than each batch. Since GAN training is already unstable, we wanted to make sure we gathered a statistically more meaningful percentage and overcame the batch size being too small (64) to sample properly.
- Hyperparameters $\alpha$ and $\beta$ of the model are different from the ones specified in the paper.
## 4.2 Implementation Overview
Hyperparameters and Other Settings are listed here. You may want to change the device field if no gpu support is available.
```python
import torch
import os
from train import EncoderClassifierTrainer, GeneratorDiscriminatorTrainer
from utils import mnist_dataset, svhn_dataset, generic_dataloader
from notebook_utils import *
class Params:
#change to cpu if gpu is not available
device = 'cuda'
datasets_root = os.path.join('datasets', '')
ckpt_root = os.path.join('ckpts', '')
# location of pre-trained encoder_classifier file
encoder_classifier_ckpt_file = 'ckpts/encoder_classifier_16.tar'
# prepended to each saved checkpoint file name for encoder_classifier
encoder_classifier_experiment_name = 'encoder_classifier_notebook'
# location of pre-trained generator_discriminator file
generator_discriminator_ckpt_file = 'ckpts/generator_discriminator_99.tar'
# prepended to each saved checkpoint file name for generator_discriminator
generator_discriminator_experiment_name = 'encoder_classifier_notebook'
# dupgan specific params
dupgan_alpha = 40.0 #different from the specified value in the paper
dupgan_beta = 40.0
encoder_classifier_confidence_threshold = 0.99
# optimizer params
encoder_classifier_adam_lr = 0.0002
generator_adam_lr = 0.00002
discriminator_adam_lr = 0.00001
encoder_classifier_adam_beta1 = 0.5
encoder_classifier_adam_beta2 = 0.999
generator_adam_beta1 = 0.5
generator_adam_beta2 = 0.999
discriminator_adam_beta1 = 0.5
discriminator_adam_beta2 = 0.999
# other training params
batch_size = 64
encoder_classifier_num_epochs = 30
generator_discriminator_num_epochs = 100
# other non-training params
demo = True #demo mode, training outputs are more frequent
params = Params()
```
```python
# dataloading, missing datasets are automatically downloaded
svhn_trainsplit = svhn_dataset(params.datasets_root, "train")
svhn_testsplit = svhn_dataset(params.datasets_root, "test")
mnist_testsplit = mnist_dataset(params.datasets_root, False)
mnist_trainsplit = mnist_dataset(params.datasets_root, True)
```
Using downloaded and verified file: datasets/train_32x32.mat
Using downloaded and verified file: datasets/test_32x32.mat
The Encoder - Classifier architecture is as follows. It has 2 outputs, an encoding of the input and a confidence vector from this encoding for digit classification.
```python
encoder_classifier_trainer = EncoderClassifierTrainer(params.device, params,
svhn_trainsplit, svhn_testsplit, mnist_trainsplit, mnist_testsplit,
ckpt_root=params.ckpt_root)
print(encoder_classifier_trainer.encoder_classifier)
```
EncoderClassifier(
(layer1): Sequential(
(0): Conv2d(3, 64, kernel_size=(5, 5), stride=(2, 2), padding=(2, 2))
(1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): LeakyReLU(negative_slope=0.01)
)
(layer2): Sequential(
(0): Conv2d(64, 128, kernel_size=(5, 5), stride=(2, 2), padding=(2, 2))
(1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): LeakyReLU(negative_slope=0.01)
)
(layer3): Sequential(
(0): Conv2d(128, 256, kernel_size=(8, 8), stride=(1, 1))
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): LeakyReLU(negative_slope=0.01)
)
(latent): Linear(in_features=256, out_features=512, bias=True)
(classifier): Sequential(
(0): LeakyReLU(negative_slope=0.01)
(1): Linear(in_features=512, out_features=5, bias=True)
)
)
Pretraining is straightforward, the model is trained only with respect to the labels from the same domain (in our case SVHN digit images and digit labels) at this stage. Here is the training procedure for one batch:
```python
def encoder_classifier_notebook_train_one_batch(self, batch):
inputs, labels = batch
inputs = inputs.to(self.device)
labels = labels.to(self.device)
self.optimizer.zero_grad()
# output is a 1x5 vector of confidences for digits [0-4] (not normalized)
classifier_out, _ = self.encoder_classifier(inputs)
# criterion is cross-entropy loss against labels on top of a softmax layer
loss = self.criterion(classifier_out, labels)
loss.backward()
#optimizer is ADAM
self.optimizer.step()
```
The training procedure finds context as follows. The model is saved and evaluated after every epoch in the code below, but you are free to modify it to your liking.
```python
def encoder_classifier_notebook_train_model(self):
self.encoder_classifier.train()
#initial self.epoch value is taken from saved checkpoint, it is -1 for a brand new model.
for self.epoch in range(self.epoch+1, params.encoder_classifier_num_epochs):
for batch in self.svhn_trainsplit_loader:
encoder_classifier_notebook_train_one_batch(self, batch)
if params.demo:
encoder_classifier_notebook_evaluator_evaluate_and_print(self)
encoder_classifier_notebook_evaluator_evaluate_and_print(self)
#saved every epoch under ckpt_root
self.save()
try:
encoder_classifier_notebook_evaluator_reset()
encoder_classifier_notebook_train_model(encoder_classifier_trainer)
except KeyboardInterrupt:
pass
```
<table><tr><th>Epoch</th><th>SVHN Train Split Loss</th><th>SVHN Train Split Classification Acc. (%)</th><th>SVHN Test Split Classification Acc. (%)</th><th>MNIST Train Split Above Threshold (%)</th></tr><tr><td>0</td><td>1139.7694</td><td>29.1539</td><td>28.4381</td><td>0.0000</td></tr><tr><td>0</td><td>1138.3447</td><td>30.0139</td><td>30.7190</td><td>0.0000</td></tr><tr><td>0</td><td>1135.7645</td><td>30.0381</td><td>30.4995</td><td>0.0000</td></tr></table>
The "pretrained" model for pretraining can be loaded with the snippet below. You can also load the model you have trained above by changing the path.
```python
#encoder_classifier_trainer.load("absolute path to model.tar that you may have
# trained above and would like to continue training")
encoder_classifier_notebook_load_and_print_params(encoder_classifier_trainer, params.encoder_classifier_ckpt_file)
```
ADAM learning rate: 0.0002
ADAM betas: (0.5, 0.999)
epoch: 16
experiment_name: encoder_classifier
Here are the classification results for the pretrained model. About 79% of the MNIST dataset is confidently classified with the classifier pretrained only with SVHN dataset.
```python
encoder_classifier_notebook_evaluator_reset()
encoder_classifier_notebook_evaluator_evaluate_and_print(encoder_classifier_trainer)
```
<table><tr><th>Epoch</th><th>SVHN Train Split Loss</th><th>SVHN Train Split Classification Acc. (%)</th><th>SVHN Test Split Classification Acc. (%)</th><th>MNIST Train Split Above Threshold (%)</th></tr><tr><td>16</td><td>12.9597</td><td>99.4090</td><td>92.6511</td><td>79.6379</td></tr></table>
The pretrained Encoder - Classifier is later embedded to the actual GAN architecture below. Here is the Generator architecture. Notice the extra 513th dimension in the first layer accounting for the domain code that the generator takes as an extra input.
```python
encoder_classifier = encoder_classifier_trainer.encoder_classifier
encoder_classifier_optimizer = encoder_classifier_trainer.optimizer
generator_discriminator_trainer = GeneratorDiscriminatorTrainer(params.device, params,
encoder_classifier,
encoder_classifier_optimizer,
svhn_trainsplit,
svhn_testsplit, mnist_trainsplit, mnist_testsplit,
experiment_name=params.generator_discriminator_experiment_name,
ckpt_root=params.ckpt_root)
print(generator_discriminator_trainer.generator)
```
Generator(
(layer1): Sequential(
(0): ConvTranspose2d(513, 256, kernel_size=(4, 4), stride=(2, 2))
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): LeakyReLU(negative_slope=0.01)
)
(layer2): Sequential(
(0): ConvTranspose2d(256, 128, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
(1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): LeakyReLU(negative_slope=0.01)
)
(layer3): Sequential(
(0): ConvTranspose2d(128, 64, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
(1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): LeakyReLU(negative_slope=0.01)
)
(layer4): ConvTranspose2d(64, 3, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
(tanh): Tanh()
)
The architecture of the Discriminators (they are identical):
```python
print(generator_discriminator_trainer.discriminator_svhn)
```
Discriminator(
(layer1): Sequential(
(0): Conv2d(3, 64, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
(1): ReLU()
(2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(3): Dropout(p=0.1, inplace=False)
)
(layer2): Sequential(
(0): Conv2d(64, 128, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
(1): ReLU()
(2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(3): Dropout(p=0.1, inplace=False)
)
(layer3): Sequential(
(0): Conv2d(128, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
(1): ReLU()
(2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(3): Dropout(p=0.1, inplace=False)
)
(layer4): Sequential(
(0): Conv2d(256, 512, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
(1): ReLU()
(2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(3): Dropout(p=0.1, inplace=False)
)
(discriminator): Conv2d(512, 6, kernel_size=(2, 2), stride=(1, 1))
)
The training procedure for the discriminators is as follows for a pair of batches from both domains. Note that the labels for the MNIST batches are not coming from the dataset, but the Encoder - Classifier of the model itself.
```python
def discriminator_mnist_notebook_train_one_batch(self, svhn_batch, mnist_hc_batch):
svhn_inputs, _ = svhn_batch # don't care about svhn labels here
mnist_hc_inputs, mnist_hc_labels = mnist_hc_batch
# mnist_hc_labels are high confidence digit labels obtained from the classifier, not ground truth
# a utility method to zero all grads in all models
self.zero_grad()
# generate fake mnist images from encodings of svhn images
_, svhn_latent_out = self.encoder_classifier(svhn_inputs)
svhn_to_fake_mnist = self.generator(svhn_latent_out, 1)
# discriminator output is a 1x6 (not 1x5!) vector of confidences for digits [0-4] and fake (not normalized)
# fake image confidences, discriminator has less loss if the 6th item is large
svhn_to_fake_mnist_discriminator_out = self.discriminator_mnist(svhn_to_fake_mnist)
# real image confidences, discriminator has less loss if item matching the high conf. classifier label is large
real_mnist_discriminator_out = self.discriminator_mnist(mnist_hc_inputs)
# criterion is cross-entropy loss against labels on top of a softmax layer
# fake image loss is against fake labels (label "5")
discriminator_mnist_fake_loss = self.discriminator_mnist_criterion(svhn_to_fake_mnist_discriminator_out,
self.fake_label_pool[:svhn_to_fake_mnist_discriminator_out.shape[0]])
# real image loss is against high confidence classifier labels
discriminator_mnist_real_loss = self.discriminator_mnist_criterion(real_mnist_discriminator_out,
mnist_hc_labels)
# total loss
discriminator_mnist_loss = discriminator_mnist_fake_loss + discriminator_mnist_real_loss
discriminator_mnist_loss.backward()
self.discriminator_mnist_optimizer.step()
```
The discriminator training procedure for SVHN dataset, where we have the ground truth, is very similar to the discriminator of MNIST. Only this time actual ground truth is available for calculating the loss on real SVHN images.
```python
def discriminator_svhn_notebook_train_one_batch(self, svhn_batch, mnist_hc_batch):
svhn_inputs, svhn_labels = svhn_batch # we have the ground truth digit labels for svhn in training
mnist_hc_inputs, _ = mnist_hc_batch # don't care about mnist labels here
self.zero_grad()
# generate fake svhn images from encodings of mnist images
_, mnist_hc_latent_out = self.encoder_classifier(mnist_hc_inputs)
mnist_to_fake_svhn = self.generator(mnist_hc_latent_out, 0)
# discriminator output is a 1x6 (not 1x5!) vector of confidences for digits [0-4] and fake (not normalized)
# fake image confidences, discriminator has less loss if the 6th item is large
mnist_to_fake_svhn_discriminator_out = self.discriminator_svhn(mnist_to_fake_svhn)
# real image confidences, discriminator has less loss if item matching the ground truth svhn label is large
real_svhn_discriminator_out = self.discriminator_svhn(svhn_inputs)
# criterion is cross-entropy loss against labels on top of a softmax layer
# fake image loss is against fake labels (label "5"), optimizer pulls discriminator towards guessing correctly
discriminator_svhn_fake_loss = self.discriminator_svhn_criterion(mnist_to_fake_svhn_discriminator_out,
self.fake_label_pool[:mnist_to_fake_svhn_discriminator_out.shape[0]])
# real image loss is against ground truth svhn labels, optimizer pulls discriminator towards guessing correctly
discriminator_svhn_real_loss = self.discriminator_svhn_criterion(real_svhn_discriminator_out,
svhn_labels)
# total loss
discriminator_svhn_loss = discriminator_svhn_fake_loss + discriminator_svhn_real_loss
discriminator_svhn_loss.backward()
self.discriminator_svhn_optimizer.step()
```
Generator and the encoder - classifier are trained with the following procedure. The generator has two losses, the first one is for deceiving the discriminators and the second one the reconstruction loss for the reconstructed encodings (the reconstructions do not change domain).
```python
def generator_classifier_notebook_train_one_batch(self, svhn_batch, mnist_hc_batch):
svhn_inputs, svhn_labels = svhn_batch # we have the ground truth digit labels for svhn in training
mnist_hc_inputs, mnist_hc_labels = mnist_hc_batch
# mnist_hc_labels are high confidence digit labels obtained from the classifier, not ground truth
self.zero_grad()
# generate fake images (from the other domain) and reconstructed images (from the same domain)
# from the encodings
# classifier confidences will be used for classifier training
mnist_hc_classifier_out, mnist_hc_latent_out = self.encoder_classifier(mnist_hc_inputs)
svhn_classifier_out, svhn_latent_out = self.encoder_classifier(svhn_inputs)
svhn_to_fake_svhn = self.generator(svhn_latent_out, 0)
svhn_to_fake_mnist = self.generator(svhn_latent_out, 1)
mnist_to_fake_svhn = self.generator(mnist_hc_latent_out, 0)
mnist_to_fake_mnist = self.generator(mnist_hc_latent_out, 1)
# 1-) Generator Training
# 1-a) Generator Deception Losses
# discriminator output is a 1x6 (not 1x5!) vector of confidences for digits [0-4] and fake (not normalized)
svhn_to_fake_mnist_discriminator_out = self.discriminator_mnist(svhn_to_fake_mnist)
mnist_to_fake_svhn_discriminator_out = self.discriminator_svhn(mnist_to_fake_svhn)
# deception criterion is cross-entropy loss against labels on top of a softmax layer
# fake mnist image losses are against ground truth svhn labels
# optimizer pulls generator towards making discriminator categorize fake mnist images incorrectly
# in the corresponding ground truth svhn labels
deceive_discriminator_mnist_loss = self.generator_deception_criterion(
svhn_to_fake_mnist_discriminator_out, svhn_labels)
# fake svhn image losses are against mnist high conf. classifier labels (not ground truth)
# optimizer pulls generator towards making discriminator categorize fake svhn images incorrectly
# in the corresponding mnist high conf. classifier labels (not ground truth)
deceive_discriminator_svhn_loss = self.generator_deception_criterion(
mnist_to_fake_svhn_discriminator_out, mnist_hc_labels)
# total deception loss
deception_loss = deceive_discriminator_mnist_loss + deceive_discriminator_svhn_loss
# 1-b) Generator Reconstruction Losses
# reconstructed images should look like the original images, reconstruction criterion is
# L2 loss between original and reconstructed images - no label information used
reconstruction_mnist_loss = self.generator_reconstruction_criterion(mnist_to_fake_mnist,
mnist_hc_inputs)
reconstruction_svhn_loss = self.generator_reconstruction_criterion(svhn_to_fake_svhn,
svhn_inputs)
# total reconstruction loss
reconstruction_loss = reconstruction_mnist_loss+reconstruction_svhn_loss
# total generator loss, there is a reconstruction loss scaling parameter alpha specified in the paper
generator_loss = deception_loss + self.dupgan_alpha*reconstruction_loss
# 2-) Classifier Training
# criterion is cross-entropy loss against labels from own domain, same as pretraining, only difference is
# mnist high confidence images also contribute to the loss with mnist high confidence labels (not ground truth)
mnist_classification_loss = self.encoder_classifier_criterion(mnist_hc_classifier_out, mnist_hc_labels)
svhn_classification_loss = self.encoder_classifier_criterion(svhn_classifier_out, svhn_labels)
# total classification loss, there is a scaling parameter beta specified in the paper
classification_loss = self.dupgan_beta*(mnist_classification_loss + svhn_classification_loss)
generator_ec_loss = generator_loss + classification_loss
generator_ec_loss.backward()
self.generator_optimizer.step()
self.encoder_classifier_optimizer.step()
```
The 3 procedures collect in the following main training loop. At the beginning of each epoch, the filtered collection of MNIST images with high classification confidence are renewed. The model is saved and evaluated at every epoch. You can change the frequency of these to your liking by playing with the code below.
```python
def generator_discriminator_notebook_train_models(self):
for self.epoch in range(self.epoch+1, params.generator_discriminator_num_epochs):
# at the beginning every epoch review images in the mnist train split and collect the ones
# that the classifier has high confidence in categorization
# train the models with inferred label - high confidence mnist image pairs
# as if the inferred labels are ground truth
mnist_hc_dataset, pseudolabels = self.get_high_confidence_mnist_dataset_with_pseudolabels()
mnist_hc_loader = generic_dataloader(self.device, mnist_hc_dataset, shuffle=True,
batch_size=self.batch_size)
# since mnist is smaller than svhn, have to use iterators to jointly train
mnist_ind = 0
mnist_iterator = iter(mnist_hc_loader)
for svhn_batch in self.svhn_trainsplit_loader:
# hack to skip 1 sample batches since they give an error with batchnorm
# device compatibility code, etc.
while True:
if mnist_ind >= len(mnist_iterator):
mnist_iterator = iter(mnist_hc_loader)
mnist_ind = 0
mnist_hc_inputs, *_, mnist_hc_indices = next(mnist_iterator)
mnist_ind += 1
if mnist_hc_inputs.shape[0] > 1:
break
mnist_hc_inputs = mnist_hc_inputs.to(self.device)
mnist_hc_labels = pseudolabels[mnist_hc_indices].to(self.device)
svhn_inputs, svhn_labels = svhn_batch
svhn_inputs = svhn_inputs.to(self.device)
svhn_labels = svhn_labels.to(self.device)
#meat of the training code
mnist_hc_batch = (mnist_hc_inputs, mnist_hc_labels)
svhn_batch = (svhn_inputs, svhn_labels)
discriminator_mnist_notebook_train_one_batch(self, svhn_batch, mnist_hc_batch)
discriminator_svhn_notebook_train_one_batch(self, svhn_batch, mnist_hc_batch)
generator_classifier_notebook_train_one_batch(self, svhn_batch, mnist_hc_batch)
#this is here just to show results fast during a demo
if params.demo:
generator_discriminator_notebook_evaluator_evaluate_and_print(self, mnist_hc_loader, pseudolabels)
#saved every epoch under ckpt_root
generator_discriminator_notebook_evaluator_evaluate_and_print(self, mnist_hc_loader, pseudolabels)
self.save()
try:
generator_discriminator_notebook_evaluator_reset()
generator_discriminator_notebook_train_models(generator_discriminator_trainer)
except KeyboardInterrupt:
pass
```
The best model we obtained from our experiments can be loaded with the snippet below. Important hyper-parameters are also listed.
```python
generator_discriminator_notebook_load_and_print_params(generator_discriminator_trainer,params.generator_discriminator_ckpt_file)
```
Discriminator ADAM learning rate: 1e-05
Discriminator ADAM betas: (0.5, 0.999)
Generator ADAM learning rate: 2e-05
Generator ADAM betas: (0.5, 0.999)
Encoder-Classifier ADAM learning rate: 0.0002
Encoder-Classifier ADAM betas: (0.5, 0.999)
DUPGAN Alpha: 40.0
DUPGAN Beta: 40.0
epoch: 99
experiment_name: generator_discriminator
# 5. Final Results
Here are our promised goal results for the project. **The paper reports 92.46% accuracy for the classifier, (we had 87.21%).** The image translation results of the paper can be compared with ours below:
<center>Figure 2: Image Translation Results of DupGAN Paper</center>
<center>Figure 3: Our Image Translation Results</center>
```python
generator_discriminator_notebook_evaluator_evaluate_goals_and_print(generator_discriminator_trainer)
```
|
lemma closed_union_complement_components: fixes S :: "'a::real_normed_vector set" assumes S: "closed S" and c: "c \<subseteq> components(- S)" shows "closed(S \<union> \<Union> c)" |
/-
Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.group_theory.group_action.defs
import Mathlib.group_theory.group_action.group
import Mathlib.group_theory.coset
import Mathlib.PostPort
universes u v u_1 w
namespace Mathlib
/-!
# Basic properties of group actions
-/
namespace mul_action
/-- The orbit of an element under an action. -/
def orbit (α : Type u) {β : Type v} [monoid α] [mul_action α β] (b : β) : set β :=
set.range fun (x : α) => x • b
theorem mem_orbit_iff {α : Type u} {β : Type v} [monoid α] [mul_action α β] {b₁ : β} {b₂ : β} : b₂ ∈ orbit α b₁ ↔ ∃ (x : α), x • b₁ = b₂ :=
iff.rfl
@[simp] theorem mem_orbit {α : Type u} {β : Type v} [monoid α] [mul_action α β] (b : β) (x : α) : x • b ∈ orbit α b :=
Exists.intro x rfl
@[simp] theorem mem_orbit_self {α : Type u} {β : Type v} [monoid α] [mul_action α β] (b : β) : b ∈ orbit α b := sorry
/-- The stabilizer of an element under an action, i.e. what sends the element to itself. Note
that this is a set: for the group stabilizer see `stabilizer`. -/
def stabilizer_carrier (α : Type u) {β : Type v} [monoid α] [mul_action α β] (b : β) : set α :=
set_of fun (x : α) => x • b = b
@[simp] theorem mem_stabilizer_iff {α : Type u} {β : Type v} [monoid α] [mul_action α β] {b : β} {x : α} : x ∈ stabilizer_carrier α b ↔ x • b = b :=
iff.rfl
/-- The set of elements fixed under the whole action. -/
def fixed_points (α : Type u) (β : Type v) [monoid α] [mul_action α β] : set β :=
set_of fun (b : β) => ∀ (x : α), x • b = b
/-- `fixed_by g` is the subfield of elements fixed by `g`. -/
def fixed_by (α : Type u) (β : Type v) [monoid α] [mul_action α β] (g : α) : set β :=
set_of fun (x : β) => g • x = x
theorem fixed_eq_Inter_fixed_by (α : Type u) (β : Type v) [monoid α] [mul_action α β] : fixed_points α β = set.Inter fun (g : α) => fixed_by α β g := sorry
@[simp] theorem mem_fixed_points {α : Type u} (β : Type v) [monoid α] [mul_action α β] {b : β} : b ∈ fixed_points α β ↔ ∀ (x : α), x • b = b :=
iff.rfl
@[simp] theorem mem_fixed_by {α : Type u} (β : Type v) [monoid α] [mul_action α β] {g : α} {b : β} : b ∈ fixed_by α β g ↔ g • b = b :=
iff.rfl
theorem mem_fixed_points' {α : Type u} (β : Type v) [monoid α] [mul_action α β] {b : β} : b ∈ fixed_points α β ↔ ∀ (b' : β), b' ∈ orbit α b → b' = b := sorry
/-- The stabilizer of a point `b` as a submonoid of `α`. -/
def stabilizer.submonoid (α : Type u) {β : Type v} [monoid α] [mul_action α β] (b : β) : submonoid α :=
submonoid.mk (stabilizer_carrier α b) (one_smul α b) sorry
end mul_action
namespace mul_action
/-- The stabilizer of an element under an action, i.e. what sends the element to itself.
A subgroup. -/
def stabilizer (α : Type u) {β : Type v} [group α] [mul_action α β] (b : β) : subgroup α :=
subgroup.mk (submonoid.carrier sorry) sorry sorry sorry
theorem orbit_eq_iff {α : Type u} {β : Type v} [group α] [mul_action α β] {a : β} {b : β} : orbit α a = orbit α b ↔ a ∈ orbit α b := sorry
/-- The stabilizer of a point `b` as a subgroup of `α`. -/
def stabilizer.subgroup (α : Type u) {β : Type v} [group α] [mul_action α β] (b : β) : subgroup α :=
subgroup.mk (submonoid.carrier (stabilizer.submonoid α b)) sorry sorry sorry
@[simp] theorem mem_orbit_smul (α : Type u) {β : Type v} [group α] [mul_action α β] (g : α) (a : β) : a ∈ orbit α (g • a) := sorry
@[simp] theorem smul_mem_orbit_smul (α : Type u) {β : Type v} [group α] [mul_action α β] (g : α) (h : α) (a : β) : g • a ∈ orbit α (h • a) := sorry
/-- The relation "in the same orbit". -/
def orbit_rel (α : Type u) (β : Type v) [group α] [mul_action α β] : setoid β :=
setoid.mk (fun (a b : β) => a ∈ orbit α b) sorry
/-- Action on left cosets. -/
def mul_left_cosets {α : Type u} [group α] (H : subgroup α) (x : α) (y : quotient_group.quotient H) : quotient_group.quotient H :=
quotient.lift_on' y (fun (y : α) => quotient_group.mk (x * y)) sorry
protected instance quotient {α : Type u} [group α] (H : subgroup α) : mul_action α (quotient_group.quotient H) :=
mk sorry sorry
@[simp] theorem quotient.smul_mk {α : Type u} [group α] (H : subgroup α) (a : α) (x : α) : a • quotient_group.mk x = quotient_group.mk (a * x) :=
rfl
@[simp] theorem quotient.smul_coe {α : Type u_1} [comm_group α] (H : subgroup α) (a : α) (x : α) : a • ↑x = ↑(a * x) :=
rfl
protected instance mul_left_cosets_comp_subtype_val {α : Type u} [group α] (H : subgroup α) (I : subgroup α) : mul_action (↥I) (quotient_group.quotient H) :=
comp_hom (quotient_group.quotient H) (subgroup.subtype I)
/-- The canonical map from the quotient of the stabilizer to the set. -/
def of_quotient_stabilizer (α : Type u) {β : Type v} [group α] [mul_action α β] (x : β) (g : quotient_group.quotient (stabilizer α x)) : β :=
quotient.lift_on' g (fun (_x : α) => _x • x) sorry
@[simp] theorem of_quotient_stabilizer_mk (α : Type u) {β : Type v} [group α] [mul_action α β] (x : β) (g : α) : of_quotient_stabilizer α x (quotient_group.mk g) = g • x :=
rfl
theorem of_quotient_stabilizer_mem_orbit (α : Type u) {β : Type v} [group α] [mul_action α β] (x : β) (g : quotient_group.quotient (stabilizer α x)) : of_quotient_stabilizer α x g ∈ orbit α x :=
quotient.induction_on' g fun (g : α) => Exists.intro g rfl
theorem of_quotient_stabilizer_smul (α : Type u) {β : Type v} [group α] [mul_action α β] (x : β) (g : α) (g' : quotient_group.quotient (stabilizer α x)) : of_quotient_stabilizer α x (g • g') = g • of_quotient_stabilizer α x g' :=
quotient.induction_on' g' fun (_x : α) => mul_smul g _x x
theorem injective_of_quotient_stabilizer (α : Type u) {β : Type v} [group α] [mul_action α β] (x : β) : function.injective (of_quotient_stabilizer α x) := sorry
/-- Orbit-stabilizer theorem. -/
def orbit_equiv_quotient_stabilizer (α : Type u) {β : Type v} [group α] [mul_action α β] (b : β) : ↥(orbit α b) ≃ quotient_group.quotient (stabilizer α b) :=
equiv.symm
(equiv.of_bijective
(fun (g : quotient_group.quotient (stabilizer α b)) =>
{ val := of_quotient_stabilizer α b g, property := of_quotient_stabilizer_mem_orbit α b g })
sorry)
@[simp] theorem orbit_equiv_quotient_stabilizer_symm_apply (α : Type u) {β : Type v} [group α] [mul_action α β] (b : β) (a : α) : ↑(coe_fn (equiv.symm (orbit_equiv_quotient_stabilizer α b)) ↑a) = a • b :=
rfl
end mul_action
theorem list.smul_sum {α : Type u} {β : Type v} [monoid α] [add_monoid β] [distrib_mul_action α β] {r : α} {l : List β} : r • list.sum l = list.sum (list.map (has_scalar.smul r) l) :=
add_monoid_hom.map_list_sum (const_smul_hom β r) l
theorem multiset.smul_sum {α : Type u} {β : Type v} [monoid α] [add_comm_monoid β] [distrib_mul_action α β] {r : α} {s : multiset β} : r • multiset.sum s = multiset.sum (multiset.map (has_scalar.smul r) s) :=
add_monoid_hom.map_multiset_sum (const_smul_hom β r) s
theorem finset.smul_sum {α : Type u} {β : Type v} {γ : Type w} [monoid α] [add_comm_monoid β] [distrib_mul_action α β] {r : α} {f : γ → β} {s : finset γ} : (r • finset.sum s fun (x : γ) => f x) = finset.sum s fun (x : γ) => r • f x :=
add_monoid_hom.map_sum (const_smul_hom β r) f s
|
-- Prop has been removed from the language
module PropNoMore where
postulate
X : Prop
|
module Mmhelloworld.IdrisJackson.Databind
import IdrisJvm.IO
%access public export
SerializerProvider : Type
SerializerProvider = JVM_Native (Class "com/fasterxml/jackson/databind/SerializerProvider")
JsonDeserializer : Type
JsonDeserializer = JVM_Native (Class "com/fasterxml/jackson/databind/JsonDeserializer")
JsonSerializer : Type
JsonSerializer = JVM_Native (Class "com/fasterxml/jackson/databind/JsonSerializer")
DeserializationContext : Type
DeserializationContext = JVM_Native (Class "com/fasterxml/jackson/databind/DeserializationContext")
JsonNode : Type
JsonNode = JVM_Native (Class "com/fasterxml/jackson/databind/JsonNode")
|
(*
* Copyright 2014, General Dynamics C4 Systems
*
* SPDX-License-Identifier: GPL-2.0-only
*)
theory Ipc_R
imports Finalise_R
begin
context begin interpretation Arch . (*FIXME: arch_split*)
lemmas lookup_slot_wrapper_defs'[simp] =
lookupSourceSlot_def lookupTargetSlot_def lookupPivotSlot_def
lemma get_mi_corres: "corres ((=) \<circ> message_info_map)
(tcb_at t) (tcb_at' t)
(get_message_info t) (getMessageInfo t)"
apply (rule corres_guard_imp)
apply (unfold get_message_info_def getMessageInfo_def fun_app_def)
apply (simp add: ARM_H.msgInfoRegister_def
ARM.msgInfoRegister_def ARM_A.msg_info_register_def)
apply (rule corres_split_eqr [OF _ user_getreg_corres])
apply (rule corres_trivial, simp add: message_info_from_data_eqv)
apply (wp | simp)+
done
lemma get_mi_inv'[wp]: "\<lbrace>I\<rbrace> getMessageInfo a \<lbrace>\<lambda>x. I\<rbrace>"
by (simp add: getMessageInfo_def, wp)
definition
"get_send_cap_relation rv rv' \<equiv>
(case rv of Some (c, cptr) \<Rightarrow> (\<exists>c' cptr'. rv' = Some (c', cptr') \<and>
cte_map cptr = cptr' \<and>
cap_relation c c')
| None \<Rightarrow> rv' = None)"
lemma cap_relation_mask:
"\<lbrakk> cap_relation c c'; msk' = rights_mask_map msk \<rbrakk> \<Longrightarrow>
cap_relation (mask_cap msk c) (maskCapRights msk' c')"
by simp
lemma lsfco_cte_at':
"\<lbrace>valid_objs' and valid_cap' cap\<rbrace>
lookupSlotForCNodeOp f cap idx depth
\<lbrace>\<lambda>rv. cte_at' rv\<rbrace>, -"
apply (simp add: lookupSlotForCNodeOp_def)
apply (rule conjI)
prefer 2
apply clarsimp
apply (wp)
apply (clarsimp simp: split_def unlessE_def
split del: if_split)
apply (wp hoare_drop_imps throwE_R)
done
declare unifyFailure_wp [wp]
(* FIXME: move *)
lemma unifyFailure_wp_E [wp]:
"\<lbrace>P\<rbrace> f -, \<lbrace>\<lambda>_. E\<rbrace> \<Longrightarrow> \<lbrace>P\<rbrace> unifyFailure f -, \<lbrace>\<lambda>_. E\<rbrace>"
unfolding validE_E_def
by (erule unifyFailure_wp)+
(* FIXME: move *)
lemma unifyFailure_wp2 [wp]:
assumes x: "\<lbrace>P\<rbrace> f \<lbrace>\<lambda>_. Q\<rbrace>"
shows "\<lbrace>P\<rbrace> unifyFailure f \<lbrace>\<lambda>_. Q\<rbrace>"
by (wp x, simp)
definition
ct_relation :: "captransfer \<Rightarrow> cap_transfer \<Rightarrow> bool"
where
"ct_relation ct ct' \<equiv>
ct_receive_root ct = to_bl (ctReceiveRoot ct')
\<and> ct_receive_index ct = to_bl (ctReceiveIndex ct')
\<and> ctReceiveDepth ct' = unat (ct_receive_depth ct)"
(* MOVE *)
lemma valid_ipc_buffer_ptr_aligned_2:
"\<lbrakk>valid_ipc_buffer_ptr' a s; is_aligned y 2 \<rbrakk> \<Longrightarrow> is_aligned (a + y) 2"
unfolding valid_ipc_buffer_ptr'_def
apply clarsimp
apply (erule (1) aligned_add_aligned)
apply (simp add: msg_align_bits)
done
(* MOVE *)
lemma valid_ipc_buffer_ptr'D2:
"\<lbrakk>valid_ipc_buffer_ptr' a s; y < max_ipc_words * 4; is_aligned y 2\<rbrakk> \<Longrightarrow> typ_at' UserDataT (a + y && ~~ mask pageBits) s"
unfolding valid_ipc_buffer_ptr'_def
apply clarsimp
apply (subgoal_tac "(a + y) && ~~ mask pageBits = a && ~~ mask pageBits")
apply simp
apply (rule mask_out_first_mask_some [where n = msg_align_bits])
apply (erule is_aligned_add_helper [THEN conjunct2])
apply (erule order_less_le_trans)
apply (simp add: msg_align_bits max_ipc_words )
apply simp
done
lemma load_ct_corres:
"corres ct_relation \<top> (valid_ipc_buffer_ptr' buffer) (load_cap_transfer buffer) (loadCapTransfer buffer)"
apply (simp add: load_cap_transfer_def loadCapTransfer_def
captransfer_from_words_def
capTransferDataSize_def capTransferFromWords_def
msgExtraCapBits_def word_size add.commute add.left_commute
msg_max_length_def msg_max_extra_caps_def word_size_def
msgMaxLength_def msgMaxExtraCaps_def msgLengthBits_def wordSize_def wordBits_def
del: upt.simps)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ load_word_corres])
apply (rule corres_split [OF _ load_word_corres])
apply (rule corres_split [OF _ load_word_corres])
apply (rule_tac P=\<top> and P'=\<top> in corres_inst)
apply (clarsimp simp: ct_relation_def)
apply (wp no_irq_loadWord)+
apply simp
apply (simp add: conj_comms)
apply safe
apply (erule valid_ipc_buffer_ptr_aligned_2, simp add: is_aligned_def)+
apply (erule valid_ipc_buffer_ptr'D2, simp add: max_ipc_words, simp add: is_aligned_def)+
done
lemma get_recv_slot_corres:
"corres (\<lambda>xs ys. ys = map cte_map xs)
(tcb_at receiver and valid_objs and pspace_aligned)
(tcb_at' receiver and valid_objs' and pspace_aligned' and pspace_distinct' and
case_option \<top> valid_ipc_buffer_ptr' recv_buf)
(get_receive_slots receiver recv_buf)
(getReceiveSlots receiver recv_buf)"
apply (cases recv_buf)
apply (simp add: getReceiveSlots_def)
apply (simp add: getReceiveSlots_def split_def)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ load_ct_corres])
apply (rule corres_empty_on_failure)
apply (rule corres_splitEE)
prefer 2
apply (rule corres_unify_failure)
apply (rule lookup_cap_corres)
apply (simp add: ct_relation_def)
apply simp
apply (rule corres_splitEE)
prefer 2
apply (rule corres_unify_failure)
apply (simp add: ct_relation_def)
apply (erule lsfc_corres [OF _ refl])
apply simp
apply (simp add: split_def liftE_bindE unlessE_whenE)
apply (rule corres_split [OF _ get_cap_corres])
apply (rule corres_split_norE)
apply (rule corres_trivial, simp add: returnOk_def)
apply (rule corres_whenE)
apply (case_tac cap, auto)[1]
apply (rule corres_trivial, simp)
apply simp
apply (wp lookup_cap_valid lookup_cap_valid' lsfco_cte_at | simp)+
done
lemma get_recv_slot_inv'[wp]:
"\<lbrace> P \<rbrace> getReceiveSlots receiver buf \<lbrace>\<lambda>rv'. P \<rbrace>"
apply (case_tac buf)
apply (simp add: getReceiveSlots_def)
apply (simp add: getReceiveSlots_def
split_def unlessE_def)
apply (wp | simp)+
done
lemma get_rs_cte_at'[wp]:
"\<lbrace>\<top>\<rbrace>
getReceiveSlots receiver recv_buf
\<lbrace>\<lambda>rv s. \<forall>x \<in> set rv. cte_wp_at' (\<lambda>c. cteCap c = capability.NullCap) x s\<rbrace>"
apply (cases recv_buf)
apply (simp add: getReceiveSlots_def)
apply (wp,simp)
apply (clarsimp simp add: getReceiveSlots_def
split_def whenE_def unlessE_whenE)
apply wp
apply simp
apply (rule getCTE_wp)
apply (simp add: cte_wp_at_ctes_of cong: conj_cong)
apply wp+
apply simp
done
lemma get_rs_real_cte_at'[wp]:
"\<lbrace>valid_objs'\<rbrace>
getReceiveSlots receiver recv_buf
\<lbrace>\<lambda>rv s. \<forall>x \<in> set rv. real_cte_at' x s\<rbrace>"
apply (cases recv_buf)
apply (simp add: getReceiveSlots_def)
apply (wp,simp)
apply (clarsimp simp add: getReceiveSlots_def
split_def whenE_def unlessE_whenE)
apply wp
apply simp
apply (wp hoare_drop_imps)[1]
apply simp
apply (wp lookup_cap_valid')+
apply simp
done
declare word_div_1 [simp]
declare word_minus_one_le [simp]
declare word32_minus_one_le [simp]
lemma load_word_offs_corres':
"\<lbrakk> y < unat max_ipc_words; y' = of_nat y * 4 \<rbrakk> \<Longrightarrow>
corres (=) \<top> (valid_ipc_buffer_ptr' a) (load_word_offs a y) (loadWordUser (a + y'))"
apply simp
apply (erule load_word_offs_corres)
done
declare loadWordUser_inv [wp]
lemma getExtraCptrs_inv[wp]:
"\<lbrace>P\<rbrace> getExtraCPtrs buf mi \<lbrace>\<lambda>rv. P\<rbrace>"
apply (cases mi, cases buf, simp_all add: getExtraCPtrs_def)
apply (wp dmo_inv' mapM_wp' loadWord_inv)
done
lemma badge_derived_mask [simp]:
"badge_derived' (maskCapRights R c) c' = badge_derived' c c'"
by (simp add: badge_derived'_def)
declare derived'_not_Null [simp]
lemma maskCapRights_vsCapRef[simp]:
"vsCapRef (maskCapRights msk cap) = vsCapRef cap"
unfolding vsCapRef_def
apply (cases cap, simp_all add: maskCapRights_def isCap_simps Let_def)
apply (rename_tac arch_capability)
apply (case_tac arch_capability;
simp add: maskCapRights_def ARM_H.maskCapRights_def isCap_simps Let_def)
done
lemma corres_set_extra_badge:
"b' = b \<Longrightarrow>
corres dc (in_user_frame buffer)
(valid_ipc_buffer_ptr' buffer and
(\<lambda>_. msg_max_length + 2 + n < unat max_ipc_words))
(set_extra_badge buffer b n) (setExtraBadge buffer b' n)"
apply (rule corres_gen_asm2)
apply (drule store_word_offs_corres [where a=buffer and w=b])
apply (simp add: set_extra_badge_def setExtraBadge_def buffer_cptr_index_def
bufferCPtrOffset_def Let_def)
apply (simp add: word_size word_size_def wordSize_def wordBits_def
bufferCPtrOffset_def buffer_cptr_index_def msgMaxLength_def
msg_max_length_def msgLengthBits_def store_word_offs_def
add.commute add.left_commute)
done
crunch typ_at': setExtraBadge "\<lambda>s. P (typ_at' T p s)"
lemmas setExtraBadge_typ_ats' [wp] = typ_at_lifts [OF setExtraBadge_typ_at']
crunch valid_pspace' [wp]: setExtraBadge valid_pspace'
crunch cte_wp_at' [wp]: setExtraBadge "cte_wp_at' P p"
crunch ipc_buffer' [wp]: setExtraBadge "valid_ipc_buffer_ptr' buffer"
crunch inv'[wp]: getExtraCPtr P (wp: dmo_inv' loadWord_inv)
lemmas unifyFailure_discard2
= corres_injection[OF id_injection unifyFailure_injection, simplified]
lemma deriveCap_not_null:
"\<lbrace>\<top>\<rbrace> deriveCap slot cap \<lbrace>\<lambda>rv. K (rv \<noteq> NullCap \<longrightarrow> cap \<noteq> NullCap)\<rbrace>,-"
apply (simp add: deriveCap_def split del: if_split)
apply (case_tac cap)
apply (simp_all add: Let_def isCap_simps)
apply wp
apply simp
done
lemma deriveCap_derived_foo:
"\<lbrace>\<lambda>s. \<forall>cap'. (cte_wp_at' (\<lambda>cte. badge_derived' cap (cteCap cte)
\<and> capASID cap = capASID (cteCap cte) \<and> cap_asid_base' cap = cap_asid_base' (cteCap cte)
\<and> cap_vptr' cap = cap_vptr' (cteCap cte)) slot s
\<and> valid_objs' s \<and> cap' \<noteq> NullCap \<longrightarrow> cte_wp_at' (is_derived' (ctes_of s) slot cap' \<circ> cteCap) slot s)
\<and> (cte_wp_at' (untyped_derived_eq cap \<circ> cteCap) slot s
\<longrightarrow> cte_wp_at' (untyped_derived_eq cap' \<circ> cteCap) slot s)
\<and> (s \<turnstile>' cap \<longrightarrow> s \<turnstile>' cap') \<and> (cap' \<noteq> NullCap \<longrightarrow> cap \<noteq> NullCap) \<longrightarrow> Q cap' s\<rbrace>
deriveCap slot cap \<lbrace>Q\<rbrace>,-"
using deriveCap_derived[where slot=slot and c'=cap] deriveCap_valid[where slot=slot and c=cap]
deriveCap_untyped_derived[where slot=slot and c'=cap] deriveCap_not_null[where slot=slot and cap=cap]
apply (clarsimp simp: validE_R_def validE_def valid_def split: sum.split)
apply (frule in_inv_by_hoareD[OF deriveCap_inv])
apply (clarsimp simp: o_def)
apply (drule spec, erule mp)
apply safe
apply fastforce
apply (drule spec, drule(1) mp)
apply fastforce
apply (drule spec, drule(1) mp)
apply fastforce
apply (drule spec, drule(1) bspec, simp)
done
lemma valid_mdb_untyped_incD':
"valid_mdb' s \<Longrightarrow> untyped_inc' (ctes_of s)"
by (simp add: valid_mdb'_def valid_mdb_ctes_def)
lemma cteInsert_cte_wp_at:
"\<lbrace>\<lambda>s. cte_wp_at' (\<lambda>c. is_derived' (ctes_of s) src cap (cteCap c)) src s
\<and> valid_mdb' s \<and> valid_objs' s
\<and> (if p = dest then P cap
else cte_wp_at' (\<lambda>c. P (maskedAsFull (cteCap c) cap)) p s)\<rbrace>
cteInsert cap src dest
\<lbrace>\<lambda>uu. cte_wp_at' (\<lambda>c. P (cteCap c)) p\<rbrace>"
apply (simp add: cteInsert_def)
apply (wp updateMDB_weak_cte_wp_at updateCap_cte_wp_at_cases getCTE_wp static_imp_wp
| clarsimp simp: comp_def
| unfold setUntypedCapAsFull_def)+
apply (drule cte_at_cte_wp_atD)
apply (elim exE)
apply (rule_tac x=cte in exI)
apply clarsimp
apply (drule cte_at_cte_wp_atD)
apply (elim exE)
apply (rule_tac x=ctea in exI)
apply clarsimp
apply (cases "p=dest")
apply (clarsimp simp: cte_wp_at'_def)
apply (cases "p=src")
apply clarsimp
apply (intro conjI impI)
apply ((clarsimp simp: cte_wp_at'_def maskedAsFull_def split: if_split_asm)+)[2]
apply clarsimp
apply (rule conjI)
apply (clarsimp simp: maskedAsFull_def cte_wp_at_ctes_of split:if_split_asm)
apply (erule disjE) prefer 2 apply simp
apply (clarsimp simp: is_derived'_def isCap_simps)
apply (drule valid_mdb_untyped_incD')
apply (case_tac cte, case_tac cteb, clarsimp)
apply (drule untyped_incD', (simp add: isCap_simps)+)
apply (frule(1) ctes_of_valid'[where p = p])
apply (clarsimp simp:valid_cap'_def capAligned_def split:if_splits)
apply (drule_tac y ="of_nat fb" in word_plus_mono_right[OF _ is_aligned_no_overflow',rotated])
apply simp+
apply (rule word_of_nat_less)
apply simp
apply (simp add:p_assoc_help)
apply (simp add: max_free_index_def)
apply (clarsimp simp: maskedAsFull_def is_derived'_def badge_derived'_def
isCap_simps capMasterCap_def cte_wp_at_ctes_of
split: if_split_asm capability.splits)
done
lemma cteInsert_weak_cte_wp_at3:
assumes imp:"\<And>c. P c \<Longrightarrow> \<not> isUntypedCap c"
shows " \<lbrace>\<lambda>s. if p = dest then P cap
else cte_wp_at' (\<lambda>c. P (cteCap c)) p s\<rbrace>
cteInsert cap src dest
\<lbrace>\<lambda>uu. cte_wp_at' (\<lambda>c. P (cteCap c)) p\<rbrace>"
by (wp updateMDB_weak_cte_wp_at updateCap_cte_wp_at_cases getCTE_wp' static_imp_wp
| clarsimp simp: comp_def cteInsert_def
| unfold setUntypedCapAsFull_def
| auto simp: cte_wp_at'_def dest!: imp)+
lemma maskedAsFull_null_cap[simp]:
"(maskedAsFull x y = capability.NullCap) = (x = capability.NullCap)"
"(capability.NullCap = maskedAsFull x y) = (x = capability.NullCap)"
by (case_tac x, auto simp:maskedAsFull_def isCap_simps )
lemma maskCapRights_eq_null:
"(RetypeDecls_H.maskCapRights r xa = capability.NullCap) =
(xa = capability.NullCap)"
apply (cases xa; simp add: maskCapRights_def isCap_simps)
apply (rename_tac arch_capability)
apply (case_tac arch_capability)
apply (simp_all add: ARM_H.maskCapRights_def isCap_simps)
done
lemma cte_refs'_maskedAsFull[simp]:
"cte_refs' (maskedAsFull a b) = cte_refs' a"
apply (rule ext)+
apply (case_tac a)
apply (clarsimp simp:maskedAsFull_def isCap_simps)+
done
lemma tc_loop_corres:
"\<lbrakk> list_all2 (\<lambda>(cap, slot) (cap', slot'). cap_relation cap cap'
\<and> slot' = cte_map slot) caps caps';
mi' = message_info_map mi \<rbrakk> \<Longrightarrow>
corres ((=) \<circ> message_info_map)
(\<lambda>s. valid_objs s \<and> pspace_aligned s \<and> pspace_distinct s \<and> valid_mdb s
\<and> valid_list s
\<and> (case ep of Some x \<Rightarrow> ep_at x s | _ \<Rightarrow> True)
\<and> (\<forall>x \<in> set slots. cte_wp_at (\<lambda>cap. cap = cap.NullCap) x s \<and>
real_cte_at x s)
\<and> (\<forall>(cap, slot) \<in> set caps. valid_cap cap s \<and>
cte_wp_at (\<lambda>cp'. (cap \<noteq> cap.NullCap \<longrightarrow> cp'\<noteq>cap \<longrightarrow> cp' = masked_as_full cap cap )) slot s )
\<and> distinct slots
\<and> in_user_frame buffer s)
(\<lambda>s. valid_pspace' s
\<and> (case ep of Some x \<Rightarrow> ep_at' x s | _ \<Rightarrow> True)
\<and> (\<forall>x \<in> set (map cte_map slots).
cte_wp_at' (\<lambda>cte. cteCap cte = NullCap) x s
\<and> real_cte_at' x s)
\<and> distinct (map cte_map slots)
\<and> valid_ipc_buffer_ptr' buffer s
\<and> (\<forall>(cap, slot) \<in> set caps'. valid_cap' cap s \<and>
cte_wp_at' (\<lambda>cte. cap \<noteq> NullCap \<longrightarrow> cteCap cte \<noteq> cap \<longrightarrow> cteCap cte = maskedAsFull cap cap) slot s)
\<and> 2 + msg_max_length + n + length caps' < unat max_ipc_words)
(transfer_caps_loop ep buffer n caps slots mi)
(transferCapsToSlots ep buffer n caps'
(map cte_map slots) mi')"
(is "\<lbrakk> list_all2 ?P caps caps'; ?v \<rbrakk> \<Longrightarrow> ?corres")
proof (induct caps caps' arbitrary: slots n mi mi' rule: list_all2_induct)
case Nil
show ?case using Nil.prems by (case_tac mi, simp)
next
case (Cons x xs y ys slots n mi mi')
note if_weak_cong[cong] if_cong [cong del]
assume P: "?P x y"
show ?case using Cons.prems P
apply (clarsimp split del: if_split)
apply (simp add: Let_def split_def word_size liftE_bindE
word_bits_conv[symmetric] split del: if_split)
apply (rule corres_const_on_failure)
apply (simp add: dc_def[symmetric] split del: if_split)
apply (rule corres_guard_imp)
apply (rule corres_if2)
apply (case_tac "fst x", auto simp add: isCap_simps)[1]
apply (rule corres_split [OF _ corres_set_extra_badge])
apply (drule conjunct1)
apply simp
apply (rule corres_rel_imp, rule Cons.hyps, simp_all)[1]
apply (case_tac mi, simp)
apply (clarsimp simp: is_cap_simps)
apply (simp add: split_def)
apply (wp hoare_vcg_const_Ball_lift)
apply (subgoal_tac "obj_ref_of (fst x) = capEPPtr (fst y)")
prefer 2
apply (clarsimp simp: is_cap_simps)
apply (simp add: split_def)
apply (wp hoare_vcg_const_Ball_lift)
apply (rule_tac P="slots = []" and Q="slots \<noteq> []" in corres_disj_division)
apply simp
apply (rule corres_trivial, simp add: returnOk_def)
apply (case_tac mi, simp)
apply (simp add: list_case_If2 split del: if_split)
apply (rule corres_splitEE)
prefer 2
apply (rule unifyFailure_discard2)
apply (case_tac mi, clarsimp)
apply (rule derive_cap_corres)
apply (simp add: remove_rights_def)
apply clarsimp
apply (rule corres_split_norE)
apply (simp add: liftE_bindE)
apply (rule corres_split_nor)
prefer 2
apply (rule cins_corres, simp_all add: hd_map)[1]
apply (simp add: tl_map)
apply (rule corres_rel_imp, rule Cons.hyps, simp_all)[1]
apply (wp valid_case_option_post_wp hoare_vcg_const_Ball_lift
hoare_vcg_const_Ball_lift cap_insert_weak_cte_wp_at)
apply (wp hoare_vcg_const_Ball_lift | simp add:split_def del: imp_disj1)+
apply (wp cap_insert_cte_wp_at)
apply (wp valid_case_option_post_wp hoare_vcg_const_Ball_lift
cteInsert_valid_pspace
| simp add: split_def)+
apply (wp cteInsert_weak_cte_wp_at hoare_valid_ipc_buffer_ptr_typ_at')+
apply (wp hoare_vcg_const_Ball_lift cteInsert_cte_wp_at valid_case_option_post_wp
| simp add:split_def)+
apply (rule corres_whenE)
apply (case_tac cap', auto)[1]
apply (rule corres_trivial, simp)
apply (case_tac mi, simp)
apply simp
apply (unfold whenE_def)
apply wp+
apply (clarsimp simp: conj_comms ball_conj_distrib split del: if_split)
apply (rule_tac Q' ="\<lambda>cap' s. (cap'\<noteq> cap.NullCap \<longrightarrow>
cte_wp_at (is_derived (cdt s) (a, b) cap') (a, b) s
\<and> QM s cap')" for QM
in hoare_post_imp_R)
prefer 2
apply clarsimp
apply assumption
apply (subst imp_conjR)
apply (rule hoare_vcg_conj_liftE_R)
apply (rule derive_cap_is_derived)
apply (wp derive_cap_is_derived_foo)+
apply (simp split del: if_split)
apply (rule_tac Q' ="\<lambda>cap' s. (cap'\<noteq> capability.NullCap \<longrightarrow>
cte_wp_at' (\<lambda>c. is_derived' (ctes_of s) (cte_map (a, b)) cap' (cteCap c)) (cte_map (a, b)) s
\<and> QM s cap')" for QM
in hoare_post_imp_R)
prefer 2
apply clarsimp
apply assumption
apply (subst imp_conjR)
apply (rule hoare_vcg_conj_liftE_R)
apply (rule hoare_post_imp_R[OF deriveCap_derived])
apply (clarsimp simp:cte_wp_at_ctes_of)
apply (wp deriveCap_derived_foo)
apply (clarsimp simp: cte_wp_at_caps_of_state remove_rights_def
real_cte_tcb_valid if_apply_def2
split del: if_split)
apply (rule conjI, (clarsimp split del: if_split)+)
apply (clarsimp simp:conj_comms split del:if_split)
apply (intro conjI allI)
apply (clarsimp split:if_splits)
apply (case_tac "cap = fst x",simp+)
apply (clarsimp simp:masked_as_full_def is_cap_simps cap_master_cap_simps)
apply (clarsimp split del: if_split)
apply (intro conjI)
apply (clarsimp simp:neq_Nil_conv)
apply (drule hd_in_set)
apply (drule(1) bspec)
apply (clarsimp split:if_split_asm)
apply (fastforce simp:neq_Nil_conv)
apply (intro ballI conjI)
apply (clarsimp simp:neq_Nil_conv)
apply (intro impI)
apply (drule(1) bspec[OF _ subsetD[rotated]])
apply (clarsimp simp:neq_Nil_conv)
apply (clarsimp split:if_splits)
apply clarsimp
apply (intro conjI)
apply (drule(1) bspec,clarsimp)+
subgoal for \<dots> aa _ _ capa
by (case_tac "capa = aa"; clarsimp split:if_splits simp:masked_as_full_def is_cap_simps)
apply (case_tac "isEndpointCap (fst y) \<and> capEPPtr (fst y) = the ep \<and> (\<exists>y. ep = Some y)")
apply (clarsimp simp:conj_comms split del:if_split)
apply (subst if_not_P)
apply clarsimp
apply (clarsimp simp:valid_pspace'_def cte_wp_at_ctes_of split del:if_split)
apply (intro conjI)
apply (case_tac "cteCap cte = fst y",clarsimp simp: badge_derived'_def)
apply (clarsimp simp: maskCapRights_eq_null maskedAsFull_def badge_derived'_def isCap_simps
split: if_split_asm)
apply (clarsimp split del: if_split)
apply (case_tac "fst y = capability.NullCap")
apply (clarsimp simp: neq_Nil_conv split del: if_split)+
apply (intro allI impI conjI)
apply (clarsimp split:if_splits)
apply (clarsimp simp:image_def)+
apply (thin_tac "\<forall>x\<in>set ys. Q x" for Q)
apply (drule(1) bspec)+
apply clarsimp+
apply (drule(1) bspec)
apply (rule conjI)
apply clarsimp+
apply (case_tac "cteCap cteb = ab")
by (clarsimp simp: isCap_simps maskedAsFull_def split:if_splits)+
qed
declare constOnFailure_wp [wp]
lemma transferCapsToSlots_pres1[crunch_rules]:
assumes x: "\<And>cap src dest. \<lbrace>P\<rbrace> cteInsert cap src dest \<lbrace>\<lambda>rv. P\<rbrace>"
assumes eb: "\<And>b n. \<lbrace>P\<rbrace> setExtraBadge buffer b n \<lbrace>\<lambda>_. P\<rbrace>"
shows "\<lbrace>P\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv. P\<rbrace>"
apply (induct caps arbitrary: slots n mi)
apply simp
apply (simp add: Let_def split_def whenE_def
cong: if_cong list.case_cong
split del: if_split)
apply (rule hoare_pre)
apply (wp x eb | assumption | simp split del: if_split | wpc
| wp (once) hoare_drop_imps)+
done
lemma cteInsert_cte_cap_to':
"\<lbrace>ex_cte_cap_to' p and cte_wp_at' (\<lambda>cte. cteCap cte = NullCap) dest\<rbrace>
cteInsert cap src dest
\<lbrace>\<lambda>rv. ex_cte_cap_to' p\<rbrace>"
apply (simp add: ex_cte_cap_to'_def)
apply (rule hoare_pre)
apply (rule hoare_use_eq_irq_node' [OF cteInsert_ksInterruptState])
apply (clarsimp simp:cteInsert_def)
apply (wp hoare_vcg_ex_lift updateMDB_weak_cte_wp_at updateCap_cte_wp_at_cases
setUntypedCapAsFull_cte_wp_at getCTE_wp static_imp_wp)
apply (clarsimp simp:cte_wp_at_ctes_of)
apply (rule_tac x = "cref" in exI)
apply (rule conjI)
apply clarsimp+
done
declare maskCapRights_eq_null[simp]
crunch ex_cte_cap_wp_to' [wp]: setExtraBadge "ex_cte_cap_wp_to' P p"
(rule: ex_cte_cap_to'_pres)
crunch valid_objs' [wp]: setExtraBadge valid_objs'
crunch aligned' [wp]: setExtraBadge pspace_aligned'
crunch distinct' [wp]: setExtraBadge pspace_distinct'
lemma cteInsert_assume_Null:
"\<lbrace>P\<rbrace> cteInsert cap src dest \<lbrace>Q\<rbrace> \<Longrightarrow>
\<lbrace>\<lambda>s. cte_wp_at' (\<lambda>cte. cteCap cte = NullCap) dest s \<longrightarrow> P s\<rbrace>
cteInsert cap src dest
\<lbrace>Q\<rbrace>"
apply (rule hoare_name_pre_state)
apply (erule impCE)
apply (simp add: cteInsert_def)
apply (rule hoare_seq_ext[OF _ getCTE_sp])+
apply (rule hoare_name_pre_state)
apply (clarsimp simp: cte_wp_at_ctes_of)
apply (erule hoare_pre(1))
apply simp
done
crunch mdb'[wp]: setExtraBadge valid_mdb'
lemma cteInsert_weak_cte_wp_at2:
assumes weak:"\<And>c cap. P (maskedAsFull c cap) = P c"
shows
"\<lbrace>\<lambda>s. if p = dest then P cap else cte_wp_at' (\<lambda>c. P (cteCap c)) p s\<rbrace>
cteInsert cap src dest
\<lbrace>\<lambda>uu. cte_wp_at' (\<lambda>c. P (cteCap c)) p\<rbrace>"
apply (rule hoare_pre)
apply (rule hoare_use_eq_irq_node' [OF cteInsert_ksInterruptState])
apply (clarsimp simp:cteInsert_def)
apply (wp hoare_vcg_ex_lift updateMDB_weak_cte_wp_at updateCap_cte_wp_at_cases
setUntypedCapAsFull_cte_wp_at getCTE_wp static_imp_wp)
apply (clarsimp simp:cte_wp_at_ctes_of weak)
apply auto
done
lemma transferCapsToSlots_presM:
assumes x: "\<And>cap src dest. \<lbrace>\<lambda>s. P s \<and> (emx \<longrightarrow> cte_wp_at' (\<lambda>cte. cteCap cte = NullCap) dest s \<and> ex_cte_cap_to' dest s)
\<and> (vo \<longrightarrow> valid_objs' s \<and> valid_cap' cap s \<and> real_cte_at' dest s)
\<and> (drv \<longrightarrow> cte_wp_at' (is_derived' (ctes_of s) src cap \<circ> cteCap) src s
\<and> cte_wp_at' (untyped_derived_eq cap o cteCap) src s
\<and> valid_mdb' s)
\<and> (pad \<longrightarrow> pspace_aligned' s \<and> pspace_distinct' s)\<rbrace>
cteInsert cap src dest \<lbrace>\<lambda>rv. P\<rbrace>"
assumes eb: "\<And>b n. \<lbrace>P\<rbrace> setExtraBadge buffer b n \<lbrace>\<lambda>_. P\<rbrace>"
shows "\<lbrace>\<lambda>s. P s
\<and> (emx \<longrightarrow> (\<forall>x \<in> set slots. ex_cte_cap_to' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = NullCap) x s) \<and> distinct slots)
\<and> (vo \<longrightarrow> valid_objs' s \<and> (\<forall>x \<in> set slots. real_cte_at' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = NullCap) x s)
\<and> (\<forall>x \<in> set caps. s \<turnstile>' fst x ) \<and> distinct slots)
\<and> (pad \<longrightarrow> pspace_aligned' s \<and> pspace_distinct' s)
\<and> (drv \<longrightarrow> vo \<and> pspace_aligned' s \<and> pspace_distinct' s \<and> valid_mdb' s
\<and> length slots \<le> 1
\<and> (\<forall>x \<in> set caps. s \<turnstile>' fst x \<and> (slots \<noteq> []
\<longrightarrow> cte_wp_at' (\<lambda>cte. fst x \<noteq> NullCap \<longrightarrow> cteCap cte = fst x) (snd x) s)))\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. P\<rbrace>"
apply (induct caps arbitrary: slots n mi)
apply (simp, wp, simp)
apply (simp add: Let_def split_def whenE_def
cong: if_cong list.case_cong split del: if_split)
apply (rule hoare_pre)
apply (wp eb hoare_vcg_const_Ball_lift hoare_vcg_const_imp_lift
| assumption | wpc)+
apply (rule cteInsert_assume_Null)
apply (wp x hoare_vcg_const_Ball_lift cteInsert_cte_cap_to' static_imp_wp)
apply (rule cteInsert_weak_cte_wp_at2,clarsimp)
apply (wp hoare_vcg_const_Ball_lift static_imp_wp)+
apply (rule cteInsert_weak_cte_wp_at2,clarsimp)
apply (wp hoare_vcg_const_Ball_lift cteInsert_cte_wp_at static_imp_wp
deriveCap_derived_foo)+
apply (thin_tac "\<And>slots. PROP P slots" for P)
apply (clarsimp simp: cte_wp_at_ctes_of remove_rights_def
real_cte_tcb_valid if_apply_def2
split del: if_split)
apply (rule conjI)
apply (clarsimp simp:cte_wp_at_ctes_of untyped_derived_eq_def)
apply (intro conjI allI)
apply (clarsimp simp:Fun.comp_def cte_wp_at_ctes_of)+
apply (clarsimp simp:valid_capAligned)
done
lemmas transferCapsToSlots_pres2
= transferCapsToSlots_presM[where vo=False and emx=True
and drv=False and pad=False, simplified]
lemma transferCapsToSlots_aligned'[wp]:
"\<lbrace>pspace_aligned'\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. pspace_aligned'\<rbrace>"
by (wp transferCapsToSlots_pres1)
lemma transferCapsToSlots_distinct'[wp]:
"\<lbrace>pspace_distinct'\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. pspace_distinct'\<rbrace>"
by (wp transferCapsToSlots_pres1)
lemma transferCapsToSlots_typ_at'[wp]:
"\<lbrace>\<lambda>s. P (typ_at' T p s)\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv s. P (typ_at' T p s)\<rbrace>"
by (wp transferCapsToSlots_pres1 setExtraBadge_typ_at')
lemma transferCapsToSlots_valid_objs[wp]:
"\<lbrace>valid_objs' and valid_mdb' and (\<lambda>s. \<forall>x \<in> set slots. real_cte_at' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = capability.NullCap) x s)
and (\<lambda>s. \<forall>x \<in> set caps. s \<turnstile>' fst x) and K(distinct slots)\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. valid_objs'\<rbrace>"
apply (rule hoare_pre)
apply (rule transferCapsToSlots_presM[where vo=True and emx=False and drv=False and pad=False])
apply (wp | simp)+
done
abbreviation(input)
"transferCaps_srcs caps s \<equiv> \<forall>x\<in>set caps. cte_wp_at' (\<lambda>cte. fst x \<noteq> NullCap \<longrightarrow> cteCap cte = fst x) (snd x) s"
lemma transferCapsToSlots_mdb[wp]:
"\<lbrace>\<lambda>s. valid_pspace' s \<and> distinct slots
\<and> length slots \<le> 1
\<and> (\<forall>x \<in> set slots. ex_cte_cap_to' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = capability.NullCap) x s)
\<and> (\<forall>x \<in> set slots. real_cte_at' x s)
\<and> transferCaps_srcs caps s\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. valid_mdb'\<rbrace>"
apply (wp transferCapsToSlots_presM[where drv=True and vo=True and emx=True and pad=True])
apply clarsimp
apply (frule valid_capAligned)
apply (clarsimp simp: cte_wp_at_ctes_of is_derived'_def badge_derived'_def)
apply wp
apply (clarsimp simp: valid_pspace'_def)
apply (clarsimp simp:cte_wp_at_ctes_of)
apply (drule(1) bspec,clarify)
apply (case_tac cte)
apply (clarsimp dest!:ctes_of_valid_cap' split:if_splits)
apply (fastforce simp:valid_cap'_def)
done
crunch no_0' [wp]: setExtraBadge no_0_obj'
lemma transferCapsToSlots_no_0_obj' [wp]:
"\<lbrace>no_0_obj'\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv. no_0_obj'\<rbrace>"
by (wp transferCapsToSlots_pres1)
lemma transferCapsToSlots_vp[wp]:
"\<lbrace>\<lambda>s. valid_pspace' s \<and> distinct slots
\<and> length slots \<le> 1
\<and> (\<forall>x \<in> set slots. ex_cte_cap_to' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = capability.NullCap) x s)
\<and> (\<forall>x \<in> set slots. real_cte_at' x s)
\<and> transferCaps_srcs caps s\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. valid_pspace'\<rbrace>"
apply (rule hoare_pre)
apply (simp add: valid_pspace'_def | wp)+
apply (fastforce simp: cte_wp_at_ctes_of dest: ctes_of_valid')
done
crunches setExtraBadge, doIPCTransfer
for sch_act [wp]: "\<lambda>s. P (ksSchedulerAction s)"
(wp: crunch_wps mapME_wp' simp: zipWithM_x_mapM)
crunches setExtraBadge
for pred_tcb_at' [wp]: "\<lambda>s. pred_tcb_at' proj P p s"
and ksCurThread[wp]: "\<lambda>s. P (ksCurThread s)"
and ksCurDomain[wp]: "\<lambda>s. P (ksCurDomain s)"
and obj_at' [wp]: "\<lambda>s. P' (obj_at' P p s)"
and queues [wp]: "\<lambda>s. P (ksReadyQueues s)"
and queuesL1 [wp]: "\<lambda>s. P (ksReadyQueuesL1Bitmap s)"
and queuesL2 [wp]: "\<lambda>s. P (ksReadyQueuesL2Bitmap s)"
lemma tcts_sch_act[wp]:
"\<lbrace>\<lambda>s. sch_act_wf (ksSchedulerAction s) s\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv s. sch_act_wf (ksSchedulerAction s) s\<rbrace>"
by (wp sch_act_wf_lift tcb_in_cur_domain'_lift transferCapsToSlots_pres1)
lemma tcts_vq[wp]:
"\<lbrace>Invariants_H.valid_queues\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv. Invariants_H.valid_queues\<rbrace>"
by (wp valid_queues_lift transferCapsToSlots_pres1)
lemma tcts_vq'[wp]:
"\<lbrace>valid_queues'\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv. valid_queues'\<rbrace>"
by (wp valid_queues_lift' transferCapsToSlots_pres1)
crunch state_refs_of' [wp]: setExtraBadge "\<lambda>s. P (state_refs_of' s)"
lemma tcts_state_refs_of'[wp]:
"\<lbrace>\<lambda>s. P (state_refs_of' s)\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv s. P (state_refs_of' s)\<rbrace>"
by (wp transferCapsToSlots_pres1)
crunch if_live' [wp]: setExtraBadge if_live_then_nonz_cap'
lemma tcts_iflive[wp]:
"\<lbrace>\<lambda>s. if_live_then_nonz_cap' s \<and> distinct slots \<and>
(\<forall>x\<in>set slots.
ex_cte_cap_to' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = capability.NullCap) x s)\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. if_live_then_nonz_cap'\<rbrace>"
by (wp transferCapsToSlots_pres2 | simp)+
crunch if_unsafe' [wp]: setExtraBadge if_unsafe_then_cap'
lemma tcts_ifunsafe[wp]:
"\<lbrace>\<lambda>s. if_unsafe_then_cap' s \<and> distinct slots \<and>
(\<forall>x\<in>set slots. cte_wp_at' (\<lambda>cte. cteCap cte = capability.NullCap) x s \<and>
ex_cte_cap_to' x s)\<rbrace> transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. if_unsafe_then_cap'\<rbrace>"
by (wp transferCapsToSlots_pres2 | simp)+
crunch it[wp]: ensureNoChildren "\<lambda>s. P (ksIdleThread s)"
crunch idle'[wp]: deriveCap "valid_idle'"
crunch valid_idle' [wp]: setExtraBadge valid_idle'
lemma tcts_idle'[wp]:
"\<lbrace>\<lambda>s. valid_idle' s\<rbrace> transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. valid_idle'\<rbrace>"
apply (rule hoare_pre)
apply (wp transferCapsToSlots_pres1)
apply simp
done
lemma tcts_ct[wp]:
"\<lbrace>cur_tcb'\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv. cur_tcb'\<rbrace>"
by (wp transferCapsToSlots_pres1 cur_tcb_lift)
crunch valid_arch_state' [wp]: setExtraBadge valid_arch_state'
lemma transferCapsToSlots_valid_arch [wp]:
"\<lbrace>valid_arch_state'\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv. valid_arch_state'\<rbrace>"
by (rule transferCapsToSlots_pres1; wp)
crunch valid_global_refs' [wp]: setExtraBadge valid_global_refs'
lemma transferCapsToSlots_valid_globals [wp]:
"\<lbrace>valid_global_refs' and valid_objs' and valid_mdb' and pspace_distinct' and pspace_aligned' and K (distinct slots)
and K (length slots \<le> 1)
and (\<lambda>s. \<forall>x \<in> set slots. real_cte_at' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = capability.NullCap) x s)
and transferCaps_srcs caps\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. valid_global_refs'\<rbrace>"
apply (wp transferCapsToSlots_presM[where vo=True and emx=False and drv=True and pad=True] | clarsimp)+
apply (clarsimp simp:cte_wp_at_ctes_of)
apply (drule(1) bspec,clarsimp)
apply (case_tac cte,clarsimp)
apply (frule(1) CSpace_I.ctes_of_valid_cap')
apply (fastforce simp:valid_cap'_def)
done
crunch irq_node' [wp]: setExtraBadge "\<lambda>s. P (irq_node' s)"
lemma transferCapsToSlots_irq_node'[wp]:
"\<lbrace>\<lambda>s. P (irq_node' s)\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv s. P (irq_node' s)\<rbrace>"
by (wp transferCapsToSlots_pres1)
lemma valid_irq_handlers_ctes_ofD:
"\<lbrakk> ctes_of s p = Some cte; cteCap cte = IRQHandlerCap irq; valid_irq_handlers' s \<rbrakk>
\<Longrightarrow> irq_issued' irq s"
by (auto simp: valid_irq_handlers'_def cteCaps_of_def ran_def)
crunch valid_irq_handlers' [wp]: setExtraBadge valid_irq_handlers'
lemma transferCapsToSlots_irq_handlers[wp]:
"\<lbrace>valid_irq_handlers' and valid_objs' and valid_mdb' and pspace_distinct' and pspace_aligned'
and K(distinct slots \<and> length slots \<le> 1)
and (\<lambda>s. \<forall>x \<in> set slots. real_cte_at' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = capability.NullCap) x s)
and transferCaps_srcs caps\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. valid_irq_handlers'\<rbrace>"
apply (wp transferCapsToSlots_presM[where vo=True and emx=False and drv=True and pad=False])
apply (clarsimp simp: is_derived'_def cte_wp_at_ctes_of badge_derived'_def)
apply (erule(2) valid_irq_handlers_ctes_ofD)
apply wp
apply (clarsimp simp:cte_wp_at_ctes_of | intro ballI conjI)+
apply (drule(1) bspec,clarsimp)
apply (case_tac cte,clarsimp)
apply (frule(1) CSpace_I.ctes_of_valid_cap')
apply (fastforce simp:valid_cap'_def)
done
crunch irq_state' [wp]: setExtraBadge "\<lambda>s. P (ksInterruptState s)"
lemma setExtraBadge_irq_states'[wp]:
"\<lbrace>valid_irq_states'\<rbrace> setExtraBadge buffer b n \<lbrace>\<lambda>_. valid_irq_states'\<rbrace>"
apply (wp valid_irq_states_lift')
apply (simp add: setExtraBadge_def storeWordUser_def)
apply (wpsimp wp: no_irq dmo_lift' no_irq_storeWord)
apply assumption
done
lemma transferCapsToSlots_irq_states' [wp]:
"\<lbrace>valid_irq_states'\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>_. valid_irq_states'\<rbrace>"
by (wp transferCapsToSlots_pres1)
crunch valid_pde_mappings' [wp]: setExtraBadge valid_pde_mappings'
lemma transferCapsToSlots_pde_mappings'[wp]:
"\<lbrace>valid_pde_mappings'\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv. valid_pde_mappings'\<rbrace>"
by (wp transferCapsToSlots_pres1)
lemma transferCapsToSlots_irqs_masked'[wp]:
"\<lbrace>irqs_masked'\<rbrace> transferCapsToSlots ep buffer n caps slots mi \<lbrace>\<lambda>rv. irqs_masked'\<rbrace>"
by (wp transferCapsToSlots_pres1 irqs_masked_lift)
lemma storeWordUser_vms'[wp]:
"\<lbrace>valid_machine_state'\<rbrace> storeWordUser a w \<lbrace>\<lambda>_. valid_machine_state'\<rbrace>"
proof -
have aligned_offset_ignore:
"\<And>(l::word32) (p::word32) sz. l<4 \<Longrightarrow> p && mask 2 = 0 \<Longrightarrow>
p+l && ~~ mask pageBits = p && ~~ mask pageBits"
proof -
fix l p sz
assume al: "(p::word32) && mask 2 = 0"
assume "(l::word32) < 4" hence less: "l<2^2" by simp
have le: "2 \<le> pageBits" by (simp add: pageBits_def)
show "?thesis l p sz"
by (rule is_aligned_add_helper[simplified is_aligned_mask,
THEN conjunct2, THEN mask_out_first_mask_some,
where n=2, OF al less le])
qed
show ?thesis
apply (simp add: valid_machine_state'_def storeWordUser_def
doMachineOp_def split_def)
apply wp
apply clarsimp
apply (drule use_valid)
apply (rule_tac x=p in storeWord_um_inv, simp+)
apply (drule_tac x=p in spec)
apply (erule disjE, simp_all)
apply (erule conjE)
apply (erule disjE, simp)
apply (simp add: pointerInUserData_def word_size)
apply (subgoal_tac "a && ~~ mask pageBits = p && ~~ mask pageBits", simp)
apply (simp only: is_aligned_mask[of _ 2])
apply (elim disjE, simp_all)
apply (rule aligned_offset_ignore[symmetric], simp+)+
done
qed
lemma setExtraBadge_vms'[wp]:
"\<lbrace>valid_machine_state'\<rbrace> setExtraBadge buffer b n \<lbrace>\<lambda>_. valid_machine_state'\<rbrace>"
by (simp add: setExtraBadge_def) wp
lemma transferCapsToSlots_vms[wp]:
"\<lbrace>\<lambda>s. valid_machine_state' s\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>_ s. valid_machine_state' s\<rbrace>"
by (wp transferCapsToSlots_pres1)
crunches setExtraBadge, transferCapsToSlots
for pspace_domain_valid[wp]: "pspace_domain_valid"
crunch ct_not_inQ[wp]: setExtraBadge "ct_not_inQ"
lemma tcts_ct_not_inQ[wp]:
"\<lbrace>ct_not_inQ\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>_. ct_not_inQ\<rbrace>"
by (wp transferCapsToSlots_pres1)
crunch gsUntypedZeroRanges[wp]: setExtraBadge "\<lambda>s. P (gsUntypedZeroRanges s)"
crunch ctes_of[wp]: setExtraBadge "\<lambda>s. P (ctes_of s)"
lemma tcts_zero_ranges[wp]:
"\<lbrace>\<lambda>s. untyped_ranges_zero' s \<and> valid_pspace' s \<and> distinct slots
\<and> (\<forall>x \<in> set slots. ex_cte_cap_to' x s \<and> cte_wp_at' (\<lambda>cte. cteCap cte = capability.NullCap) x s)
\<and> (\<forall>x \<in> set slots. real_cte_at' x s)
\<and> length slots \<le> 1
\<and> transferCaps_srcs caps s\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. untyped_ranges_zero'\<rbrace>"
apply (wp transferCapsToSlots_presM[where emx=True and vo=True
and drv=True and pad=True])
apply (clarsimp simp: cte_wp_at_ctes_of)
apply (simp add: cteCaps_of_def)
apply (rule hoare_pre, wp untyped_ranges_zero_lift)
apply (simp add: o_def)
apply (clarsimp simp: valid_pspace'_def ball_conj_distrib[symmetric])
apply (drule(1) bspec)
apply (clarsimp simp: cte_wp_at_ctes_of)
apply (case_tac cte, clarsimp)
apply (frule(1) ctes_of_valid_cap')
apply auto[1]
done
crunch ct_idle_or_in_cur_domain'[wp]: setExtraBadge ct_idle_or_in_cur_domain'
crunch ct_idle_or_in_cur_domain'[wp]: transferCapsToSlots ct_idle_or_in_cur_domain'
crunch ksCurDomain[wp]: transferCapsToSlots "\<lambda>s. P (ksCurDomain s)"
crunch ksDomSchedule[wp]: setExtraBadge "\<lambda>s. P (ksDomSchedule s)"
crunch ksDomScheduleIdx[wp]: setExtraBadge "\<lambda>s. P (ksDomScheduleIdx s)"
crunch ksDomSchedule[wp]: transferCapsToSlots "\<lambda>s. P (ksDomSchedule s)"
crunch ksDomScheduleIdx[wp]: transferCapsToSlots "\<lambda>s. P (ksDomScheduleIdx s)"
lemma transferCapsToSlots_invs[wp]:
"\<lbrace>\<lambda>s. invs' s \<and> distinct slots
\<and> (\<forall>x \<in> set slots. cte_wp_at' (\<lambda>cte. cteCap cte = NullCap) x s)
\<and> (\<forall>x \<in> set slots. ex_cte_cap_to' x s)
\<and> (\<forall>x \<in> set slots. real_cte_at' x s)
\<and> length slots \<le> 1
\<and> transferCaps_srcs caps s\<rbrace>
transferCapsToSlots ep buffer n caps slots mi
\<lbrace>\<lambda>rv. invs'\<rbrace>"
apply (simp add: invs'_def valid_state'_def)
apply (wp valid_irq_node_lift)
apply fastforce
done
lemma grs_distinct'[wp]:
"\<lbrace>\<top>\<rbrace> getReceiveSlots t buf \<lbrace>\<lambda>rv s. distinct rv\<rbrace>"
apply (cases buf, simp_all add: getReceiveSlots_def
split_def unlessE_def)
apply (wp, simp)
apply (wp | simp only: distinct.simps list.simps empty_iff)+
apply simp
done
lemma tc_corres:
"\<lbrakk> info' = message_info_map info;
list_all2 (\<lambda>x y. cap_relation (fst x) (fst y) \<and> snd y = cte_map (snd x))
caps caps' \<rbrakk>
\<Longrightarrow>
corres ((=) \<circ> message_info_map)
(tcb_at receiver and valid_objs and
pspace_aligned and pspace_distinct and valid_mdb
and valid_list
and (\<lambda>s. case ep of Some x \<Rightarrow> ep_at x s | _ \<Rightarrow> True)
and case_option \<top> in_user_frame recv_buf
and (\<lambda>s. valid_message_info info)
and transfer_caps_srcs caps)
(tcb_at' receiver and valid_objs' and
pspace_aligned' and pspace_distinct' and no_0_obj' and valid_mdb'
and (\<lambda>s. case ep of Some x \<Rightarrow> ep_at' x s | _ \<Rightarrow> True)
and case_option \<top> valid_ipc_buffer_ptr' recv_buf
and transferCaps_srcs caps'
and (\<lambda>s. length caps' \<le> msgMaxExtraCaps))
(transfer_caps info caps ep receiver recv_buf)
(transferCaps info' caps' ep receiver recv_buf)"
apply (simp add: transfer_caps_def transferCaps_def
getThreadCSpaceRoot)
apply (rule corres_assume_pre)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ get_recv_slot_corres])
apply (rule_tac x=recv_buf in option_corres)
apply (rule_tac P=\<top> and P'=\<top> in corres_inst)
apply (case_tac info, simp)
apply simp
apply (rule corres_rel_imp, rule tc_loop_corres,
simp_all add: split_def)[1]
apply (case_tac info, simp)
apply (wp hoare_vcg_all_lift get_rs_cte_at static_imp_wp
| simp only: ball_conj_distrib)+
apply (simp add: cte_map_def tcb_cnode_index_def split_def)
apply (clarsimp simp: valid_pspace'_def valid_ipc_buffer_ptr'_def2
split_def
cong: option.case_cong)
apply (drule(1) bspec)
apply (clarsimp simp:cte_wp_at_caps_of_state)
apply (frule(1) Invariants_AI.caps_of_state_valid)
apply (fastforce simp:valid_cap_def)
apply (cases info)
apply (clarsimp simp: msg_max_extra_caps_def valid_message_info_def
max_ipc_words msg_max_length_def
msgMaxExtraCaps_def msgExtraCapBits_def
shiftL_nat valid_pspace'_def)
apply (drule(1) bspec)
apply (clarsimp simp:cte_wp_at_ctes_of)
apply (case_tac cte,clarsimp)
apply (frule(1) ctes_of_valid_cap')
apply (fastforce simp:valid_cap'_def)
done
crunch typ_at'[wp]: transferCaps "\<lambda>s. P (typ_at' T p s)"
lemmas transferCaps_typ_ats[wp] = typ_at_lifts [OF transferCaps_typ_at']
declare maskCapRights_Reply [simp]
lemma isIRQControlCap_mask [simp]:
"isIRQControlCap (maskCapRights R c) = isIRQControlCap c"
apply (case_tac c)
apply (clarsimp simp: isCap_simps maskCapRights_def Let_def)+
apply (rename_tac arch_capability)
apply (case_tac arch_capability)
apply (clarsimp simp: isCap_simps ARM_H.maskCapRights_def
maskCapRights_def Let_def)+
done
lemma isPageCap_maskCapRights[simp]:
" isArchCap isPageCap (RetypeDecls_H.maskCapRights R c) = isArchCap isPageCap c"
apply (case_tac c; simp add: isCap_simps isArchCap_def maskCapRights_def)
apply (rename_tac arch_capability)
apply (case_tac arch_capability; simp add: isCap_simps ARM_H.maskCapRights_def)
done
lemma capReplyMaster_mask[simp]:
"isReplyCap c \<Longrightarrow> capReplyMaster (maskCapRights R c) = capReplyMaster c"
by (clarsimp simp: isCap_simps maskCapRights_def)
lemma is_derived_mask' [simp]:
"is_derived' m p (maskCapRights R c) = is_derived' m p c"
apply (rule ext)
apply (simp add: is_derived'_def badge_derived'_def)
done
lemma updateCapData_ordering:
"\<lbrakk> (x, capBadge cap) \<in> capBadge_ordering P; updateCapData p d cap \<noteq> NullCap \<rbrakk>
\<Longrightarrow> (x, capBadge (updateCapData p d cap)) \<in> capBadge_ordering P"
apply (cases cap, simp_all add: updateCapData_def isCap_simps Let_def
capBadge_def ARM_H.updateCapData_def
split: if_split_asm)
apply fastforce+
done
lemma lookup_cap_to'[wp]:
"\<lbrace>\<top>\<rbrace> lookupCap t cref \<lbrace>\<lambda>rv s. \<forall>r\<in>cte_refs' rv (irq_node' s). ex_cte_cap_to' r s\<rbrace>,-"
by (simp add: lookupCap_def lookupCapAndSlot_def | wp)+
lemma grs_cap_to'[wp]:
"\<lbrace>\<top>\<rbrace> getReceiveSlots t buf \<lbrace>\<lambda>rv s. \<forall>x \<in> set rv. ex_cte_cap_to' x s\<rbrace>"
apply (cases buf; simp add: getReceiveSlots_def split_def unlessE_def)
apply (wp, simp)
apply (wp | simp | rule hoare_drop_imps)+
done
lemma grs_length'[wp]:
"\<lbrace>\<lambda>s. 1 \<le> n\<rbrace> getReceiveSlots receiver recv_buf \<lbrace>\<lambda>rv s. length rv \<le> n\<rbrace>"
apply (simp add: getReceiveSlots_def split_def unlessE_def)
apply (rule hoare_pre)
apply (wp | wpc | simp)+
done
lemma transferCaps_invs' [wp]:
"\<lbrace>invs' and transferCaps_srcs caps\<rbrace>
transferCaps mi caps ep receiver recv_buf
\<lbrace>\<lambda>rv. invs'\<rbrace>"
apply (simp add: transferCaps_def Let_def split_def)
apply (wp get_rs_cte_at' hoare_vcg_const_Ball_lift
| wpcw | clarsimp)+
done
lemma get_mrs_inv'[wp]:
"\<lbrace>P\<rbrace> getMRs t buf info \<lbrace>\<lambda>rv. P\<rbrace>"
by (simp add: getMRs_def load_word_offs_def getRegister_def
| wp dmo_inv' loadWord_inv mapM_wp'
asUser_inv det_mapM[where S=UNIV] | wpc)+
lemma copyMRs_typ_at':
"\<lbrace>\<lambda>s. P (typ_at' T p s)\<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv s. P (typ_at' T p s)\<rbrace>"
by (simp add: copyMRs_def | wp mapM_wp [where S=UNIV, simplified] | wpc)+
lemmas copyMRs_typ_at_lifts[wp] = typ_at_lifts [OF copyMRs_typ_at']
lemma copy_mrs_invs'[wp]:
"\<lbrace> invs' and tcb_at' s and tcb_at' r \<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv. invs' \<rbrace>"
including no_pre
apply (simp add: copyMRs_def)
apply (wp dmo_invs' no_irq_mapM no_irq_storeWord|
simp add: split_def)
apply (case_tac sb, simp_all)[1]
apply wp+
apply (case_tac rb, simp_all)[1]
apply (wp mapM_wp dmo_invs' no_irq_mapM no_irq_storeWord no_irq_loadWord)
apply blast
apply (rule hoare_strengthen_post)
apply (rule mapM_wp)
apply (wp | simp | blast)+
done
crunch aligned'[wp]: transferCaps pspace_aligned'
(wp: crunch_wps simp: zipWithM_x_mapM)
crunch distinct'[wp]: transferCaps pspace_distinct'
(wp: crunch_wps simp: zipWithM_x_mapM)
crunch aligned'[wp]: setMRs pspace_aligned'
(wp: crunch_wps simp: crunch_simps)
crunch distinct'[wp]: setMRs pspace_distinct'
(wp: crunch_wps simp: crunch_simps)
crunch aligned'[wp]: copyMRs pspace_aligned'
(wp: crunch_wps simp: crunch_simps wp: crunch_wps)
crunch distinct'[wp]: copyMRs pspace_distinct'
(wp: crunch_wps simp: crunch_simps wp: crunch_wps)
crunch aligned'[wp]: setMessageInfo pspace_aligned'
(wp: crunch_wps simp: crunch_simps)
crunch distinct'[wp]: setMessageInfo pspace_distinct'
(wp: crunch_wps simp: crunch_simps)
crunch valid_objs'[wp]: storeWordUser valid_objs'
crunch valid_pspace'[wp]: storeWordUser valid_pspace'
lemma set_mrs_valid_objs' [wp]:
"\<lbrace>valid_objs'\<rbrace> setMRs t a msgs \<lbrace>\<lambda>rv. valid_objs'\<rbrace>"
apply (simp add: setMRs_def zipWithM_x_mapM split_def)
apply (wp asUser_valid_objs crunch_wps)
done
crunch valid_objs'[wp]: copyMRs valid_objs'
(wp: crunch_wps simp: crunch_simps)
crunch valid_queues'[wp]: asUser "Invariants_H.valid_queues'"
(simp: crunch_simps wp: hoare_drop_imps)
lemma setMRs_invs_bits[wp]:
"\<lbrace>valid_pspace'\<rbrace> setMRs t buf mrs \<lbrace>\<lambda>rv. valid_pspace'\<rbrace>"
"\<lbrace>\<lambda>s. sch_act_wf (ksSchedulerAction s) s\<rbrace>
setMRs t buf mrs \<lbrace>\<lambda>rv s. sch_act_wf (ksSchedulerAction s) s\<rbrace>"
"\<lbrace>\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>
setMRs t buf mrs \<lbrace>\<lambda>rv s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>"
"\<lbrace>Invariants_H.valid_queues\<rbrace> setMRs t buf mrs \<lbrace>\<lambda>rv. Invariants_H.valid_queues\<rbrace>"
"\<lbrace>valid_queues'\<rbrace> setMRs t buf mrs \<lbrace>\<lambda>rv. valid_queues'\<rbrace>"
"\<lbrace>\<lambda>s. P (state_refs_of' s)\<rbrace>
setMRs t buf mrs
\<lbrace>\<lambda>rv s. P (state_refs_of' s)\<rbrace>"
"\<lbrace>if_live_then_nonz_cap'\<rbrace> setMRs t buf mrs \<lbrace>\<lambda>rv. if_live_then_nonz_cap'\<rbrace>"
"\<lbrace>ex_nonz_cap_to' p\<rbrace> setMRs t buf mrs \<lbrace>\<lambda>rv. ex_nonz_cap_to' p\<rbrace>"
"\<lbrace>cur_tcb'\<rbrace> setMRs t buf mrs \<lbrace>\<lambda>rv. cur_tcb'\<rbrace>"
"\<lbrace>if_unsafe_then_cap'\<rbrace> setMRs t buf mrs \<lbrace>\<lambda>rv. if_unsafe_then_cap'\<rbrace>"
by (simp add: setMRs_def zipWithM_x_mapM split_def storeWordUser_def | wp crunch_wps)+
crunch no_0_obj'[wp]: setMRs no_0_obj'
(wp: crunch_wps simp: crunch_simps)
lemma copyMRs_invs_bits[wp]:
"\<lbrace>valid_pspace'\<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv. valid_pspace'\<rbrace>"
"\<lbrace>\<lambda>s. sch_act_wf (ksSchedulerAction s) s\<rbrace> copyMRs s sb r rb n
\<lbrace>\<lambda>rv s. sch_act_wf (ksSchedulerAction s) s\<rbrace>"
"\<lbrace>Invariants_H.valid_queues\<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv. Invariants_H.valid_queues\<rbrace>"
"\<lbrace>valid_queues'\<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv. valid_queues'\<rbrace>"
"\<lbrace>\<lambda>s. P (state_refs_of' s)\<rbrace>
copyMRs s sb r rb n
\<lbrace>\<lambda>rv s. P (state_refs_of' s)\<rbrace>"
"\<lbrace>if_live_then_nonz_cap'\<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv. if_live_then_nonz_cap'\<rbrace>"
"\<lbrace>ex_nonz_cap_to' p\<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv. ex_nonz_cap_to' p\<rbrace>"
"\<lbrace>cur_tcb'\<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv. cur_tcb'\<rbrace>"
"\<lbrace>if_unsafe_then_cap'\<rbrace> copyMRs s sb r rb n \<lbrace>\<lambda>rv. if_unsafe_then_cap'\<rbrace>"
by (simp add: copyMRs_def storeWordUser_def | wp mapM_wp' | wpc)+
crunch no_0_obj'[wp]: copyMRs no_0_obj'
(wp: crunch_wps simp: crunch_simps)
lemma mi_map_length[simp]: "msgLength (message_info_map mi) = mi_length mi"
by (cases mi, simp)
crunch cte_wp_at'[wp]: copyMRs "cte_wp_at' P p"
(wp: crunch_wps)
lemma lookupExtraCaps_srcs[wp]:
"\<lbrace>\<top>\<rbrace> lookupExtraCaps thread buf info \<lbrace>transferCaps_srcs\<rbrace>,-"
apply (simp add: lookupExtraCaps_def lookupCapAndSlot_def
split_def lookupSlotForThread_def
getSlotCap_def)
apply (wp mapME_set[where R=\<top>] getCTE_wp')
apply (rule_tac P=\<top> in hoare_trivE_R)
apply (simp add: cte_wp_at_ctes_of)
apply (wp | simp)+
done
crunch inv[wp]: lookupExtraCaps "P"
(wp: crunch_wps mapME_wp' simp: crunch_simps)
lemma invs_mdb_strengthen':
"invs' s \<longrightarrow> valid_mdb' s" by auto
lemma lookupExtraCaps_length:
"\<lbrace>\<lambda>s. unat (msgExtraCaps mi) \<le> n\<rbrace> lookupExtraCaps thread send_buf mi \<lbrace>\<lambda>rv s. length rv \<le> n\<rbrace>,-"
apply (simp add: lookupExtraCaps_def getExtraCPtrs_def)
apply (rule hoare_pre)
apply (wp mapME_length | wpc)+
apply (clarsimp simp: upto_enum_step_def Suc_unat_diff_1 word_le_sub1)
done
lemma getMessageInfo_msgExtraCaps[wp]:
"\<lbrace>\<top>\<rbrace> getMessageInfo t \<lbrace>\<lambda>rv s. unat (msgExtraCaps rv) \<le> msgMaxExtraCaps\<rbrace>"
apply (simp add: getMessageInfo_def)
apply wp
apply (simp add: messageInfoFromWord_def Let_def msgMaxExtraCaps_def
shiftL_nat)
apply (subst nat_le_Suc_less_imp)
apply (rule unat_less_power)
apply (simp add: word_bits_def msgExtraCapBits_def)
apply (rule and_mask_less'[unfolded mask_2pm1])
apply (simp add: msgExtraCapBits_def)
apply wpsimp+
done
lemma lcs_corres:
"cptr = to_bl cptr' \<Longrightarrow>
corres (lfr \<oplus> (\<lambda>a b. cap_relation (fst a) (fst b) \<and> snd b = cte_map (snd a)))
(valid_objs and pspace_aligned and tcb_at thread)
(valid_objs' and pspace_distinct' and pspace_aligned' and tcb_at' thread)
(lookup_cap_and_slot thread cptr) (lookupCapAndSlot thread cptr')"
unfolding lookup_cap_and_slot_def lookupCapAndSlot_def
apply (simp add: liftE_bindE split_def)
apply (rule corres_guard_imp)
apply (rule_tac r'="\<lambda>rv rv'. rv' = cte_map (fst rv)"
in corres_splitEE)
apply (rule corres_split[OF _ getSlotCap_corres])
apply (rule corres_returnOkTT, simp)
apply simp
apply wp+
apply (rule corres_rel_imp, rule lookup_slot_corres)
apply (simp add: split_def)
apply (wp | simp add: liftE_bindE[symmetric])+
done
lemma lec_corres:
"\<lbrakk> info' = message_info_map info; buffer = buffer'\<rbrakk> \<Longrightarrow>
corres (fr \<oplus> list_all2 (\<lambda>x y. cap_relation (fst x) (fst y) \<and> snd y = cte_map (snd x)))
(valid_objs and pspace_aligned and tcb_at thread and (\<lambda>_. valid_message_info info))
(valid_objs' and pspace_distinct' and pspace_aligned' and tcb_at' thread
and case_option \<top> valid_ipc_buffer_ptr' buffer')
(lookup_extra_caps thread buffer info) (lookupExtraCaps thread buffer' info')"
unfolding lookupExtraCaps_def lookup_extra_caps_def
apply (rule corres_gen_asm)
apply (cases "mi_extra_caps info = 0")
apply (cases info)
apply (simp add: Let_def returnOk_def getExtraCPtrs_def
liftE_bindE upto_enum_step_def mapM_def
sequence_def doMachineOp_return mapME_Nil
split: option.split)
apply (cases info)
apply (rename_tac w1 w2 w3 w4)
apply (simp add: Let_def liftE_bindE)
apply (cases buffer')
apply (simp add: getExtraCPtrs_def mapME_Nil)
apply (rule corres_returnOk)
apply simp
apply (simp add: msgLengthBits_def msgMaxLength_def word_size field_simps
getExtraCPtrs_def upto_enum_step_def upto_enum_word
word_size_def msg_max_length_def liftM_def
Suc_unat_diff_1 word_le_sub1 mapM_map_simp
upt_lhs_sub_map[where x=buffer_cptr_index]
wordSize_def wordBits_def
del: upt.simps)
apply (rule corres_guard_imp)
apply (rule corres_split')
apply (rule_tac S = "\<lambda>x y. x = y \<and> x < unat w2"
in corres_mapM_list_all2
[where Q = "\<lambda>_. valid_objs and pspace_aligned and tcb_at thread" and r = "(=)"
and Q' = "\<lambda>_. valid_objs' and pspace_aligned' and pspace_distinct' and tcb_at' thread
and case_option \<top> valid_ipc_buffer_ptr' buffer'" and r'="(=)" ])
apply simp
apply simp
apply simp
apply (rule corres_guard_imp)
apply (rule load_word_offs_corres')
apply (clarsimp simp: buffer_cptr_index_def msg_max_length_def
max_ipc_words valid_message_info_def
msg_max_extra_caps_def word_le_nat_alt)
apply (simp add: buffer_cptr_index_def msg_max_length_def)
apply simp
apply simp
apply (simp add: load_word_offs_word_def)
apply (wp | simp)+
apply (subst list_all2_same)
apply (clarsimp simp: max_ipc_words field_simps)
apply (simp add: mapME_def, fold mapME_def)[1]
apply (rule corres_mapME [where S = Id and r'="(\<lambda>x y. cap_relation (fst x) (fst y) \<and> snd y = cte_map (snd x))"])
apply simp
apply simp
apply simp
apply (rule corres_cap_fault [OF lcs_corres])
apply simp
apply simp
apply (wp | simp)+
apply (simp add: set_zip_same Int_lower1)
apply (wp mapM_wp [OF _ subset_refl] | simp)+
done
crunch ctes_of[wp]: copyMRs "\<lambda>s. P (ctes_of s)"
(wp: threadSet_ctes_of crunch_wps)
lemma copyMRs_valid_mdb[wp]:
"\<lbrace>valid_mdb'\<rbrace> copyMRs t buf t' buf' n \<lbrace>\<lambda>rv. valid_mdb'\<rbrace>"
by (simp add: valid_mdb'_def copyMRs_ctes_of)
lemma do_normal_transfer_corres:
"corres dc
(tcb_at sender and tcb_at receiver and (pspace_aligned:: det_state \<Rightarrow> bool)
and valid_objs and cur_tcb and valid_mdb and valid_list and pspace_distinct
and (\<lambda>s. case ep of Some x \<Rightarrow> ep_at x s | _ \<Rightarrow> True)
and case_option \<top> in_user_frame send_buf
and case_option \<top> in_user_frame recv_buf)
(tcb_at' sender and tcb_at' receiver and valid_objs'
and pspace_aligned' and pspace_distinct' and cur_tcb'
and valid_mdb' and no_0_obj'
and (\<lambda>s. case ep of Some x \<Rightarrow> ep_at' x s | _ \<Rightarrow> True)
and case_option \<top> valid_ipc_buffer_ptr' send_buf
and case_option \<top> valid_ipc_buffer_ptr' recv_buf)
(do_normal_transfer sender send_buf ep badge can_grant receiver recv_buf)
(doNormalTransfer sender send_buf ep badge can_grant receiver recv_buf)"
apply (simp add: do_normal_transfer_def doNormalTransfer_def)
apply (rule corres_guard_imp)
apply (rule corres_split_mapr [OF _ get_mi_corres])
apply (rule_tac F="valid_message_info mi" in corres_gen_asm)
apply (rule_tac r'="list_all2 (\<lambda>x y. cap_relation (fst x) (fst y) \<and> snd y = cte_map (snd x))"
in corres_split)
prefer 2
apply (rule corres_if[OF refl])
apply (rule corres_split_catch)
apply (rule corres_trivial, simp)
apply (rule lec_corres, simp+)
apply wp+
apply (rule corres_trivial, simp)
apply simp
apply (rule corres_split_eqr [OF _ copy_mrs_corres])
apply (rule corres_split [OF _ tc_corres])
apply (rename_tac mi' mi'')
apply (rule_tac F="mi_label mi' = mi_label mi"
in corres_gen_asm)
apply (rule corres_split_nor [OF _ set_mi_corres])
apply (simp add: badge_register_def badgeRegister_def)
apply (fold dc_def)
apply (rule user_setreg_corres)
apply (case_tac mi', clarsimp)
apply wp
apply simp+
apply ((wp valid_case_option_post_wp hoare_vcg_const_Ball_lift
hoare_case_option_wp
hoare_valid_ipc_buffer_ptr_typ_at' copyMRs_typ_at'
hoare_vcg_const_Ball_lift lookupExtraCaps_length
| simp add: if_apply_def2)+)
apply (wp static_imp_wp | strengthen valid_msg_length_strengthen)+
apply clarsimp
apply auto
done
lemma corres_liftE_lift:
"corres r1 P P' m m' \<Longrightarrow>
corres (f1 \<oplus> r1) P P' (liftE m) (withoutFailure m')"
by simp
lemmas corres_ipc_thread_helper =
corres_split_eqrE [OF _ corres_liftE_lift [OF gct_corres]]
lemmas corres_ipc_info_helper =
corres_split_maprE [where f = message_info_map, OF _
corres_liftE_lift [OF get_mi_corres]]
crunch typ_at'[wp]: doNormalTransfer "\<lambda>s. P (typ_at' T p s)"
lemmas doNormal_lifts[wp] = typ_at_lifts [OF doNormalTransfer_typ_at']
lemma doNormal_invs'[wp]:
"\<lbrace>tcb_at' sender and tcb_at' receiver and invs'\<rbrace>
doNormalTransfer sender send_buf ep badge
can_grant receiver recv_buf \<lbrace>\<lambda>r. invs'\<rbrace>"
apply (simp add: doNormalTransfer_def)
apply (wp hoare_vcg_const_Ball_lift | simp)+
done
crunch aligned'[wp]: doNormalTransfer pspace_aligned'
(wp: crunch_wps)
crunch distinct'[wp]: doNormalTransfer pspace_distinct'
(wp: crunch_wps)
lemma transferCaps_urz[wp]:
"\<lbrace>untyped_ranges_zero' and valid_pspace'
and (\<lambda>s. (\<forall>x\<in>set caps. cte_wp_at' (\<lambda>cte. fst x \<noteq> capability.NullCap \<longrightarrow> cteCap cte = fst x) (snd x) s))\<rbrace>
transferCaps tag caps ep receiver recv_buf
\<lbrace>\<lambda>r. untyped_ranges_zero'\<rbrace>"
apply (simp add: transferCaps_def)
apply (rule hoare_pre)
apply (wp hoare_vcg_all_lift hoare_vcg_const_imp_lift
| wpc
| simp add: ball_conj_distrib)+
apply clarsimp
done
crunch gsUntypedZeroRanges[wp]: doNormalTransfer "\<lambda>s. P (gsUntypedZeroRanges s)"
(wp: crunch_wps transferCapsToSlots_pres1 ignore: constOnFailure)
lemmas asUser_urz = untyped_ranges_zero_lift[OF asUser_gsUntypedZeroRanges]
crunch urz[wp]: doNormalTransfer "untyped_ranges_zero'"
(ignore: asUser wp: crunch_wps asUser_urz hoare_vcg_const_Ball_lift)
lemma msgFromLookupFailure_map[simp]:
"msgFromLookupFailure (lookup_failure_map lf)
= msg_from_lookup_failure lf"
by (cases lf, simp_all add: lookup_failure_map_def msgFromLookupFailure_def)
lemma getRestartPCs_corres:
"corres (=) (tcb_at t) (tcb_at' t)
(as_user t getRestartPC) (asUser t getRestartPC)"
apply (rule corres_as_user')
apply (rule corres_Id, simp, simp)
apply (rule no_fail_getRestartPC)
done
lemma user_mapM_getRegister_corres:
"corres (=) (tcb_at t) (tcb_at' t)
(as_user t (mapM getRegister regs))
(asUser t (mapM getRegister regs))"
apply (rule corres_as_user')
apply (rule corres_Id [OF refl refl])
apply (rule no_fail_mapM)
apply (simp add: getRegister_def)
done
lemma make_arch_fault_msg_corres:
"corres (=) (tcb_at t) (tcb_at' t)
(make_arch_fault_msg f t)
(makeArchFaultMessage (arch_fault_map f) t)"
apply (cases f, clarsimp simp: makeArchFaultMessage_def split: arch_fault.split)
apply (rule corres_guard_imp)
apply (rule corres_split_eqr[OF _ getRestartPCs_corres])
apply (rule corres_trivial, simp add: arch_fault_map_def)
apply (wp+, auto)
done
lemma mk_ft_msg_corres:
"corres (=) (tcb_at t) (tcb_at' t)
(make_fault_msg ft t)
(makeFaultMessage (fault_map ft) t)"
apply (cases ft, simp_all add: makeFaultMessage_def split del: if_split)
apply (rule corres_guard_imp)
apply (rule corres_split_eqr [OF _ getRestartPCs_corres])
apply (rule corres_trivial, simp add: fromEnum_def enum_bool)
apply (wp | simp)+
apply (simp add: ARM_H.syscallMessage_def)
apply (rule corres_guard_imp)
apply (rule corres_split_eqr [OF _ user_mapM_getRegister_corres])
apply (rule corres_trivial, simp)
apply (wp | simp)+
apply (simp add: ARM_H.exceptionMessage_def)
apply (rule corres_guard_imp)
apply (rule corres_split_eqr [OF _ user_mapM_getRegister_corres])
apply (rule corres_trivial, simp)
apply (wp | simp)+
apply (rule make_arch_fault_msg_corres)
done
lemma makeFaultMessage_inv[wp]:
"\<lbrace>P\<rbrace> makeFaultMessage ft t \<lbrace>\<lambda>rv. P\<rbrace>"
apply (cases ft, simp_all add: makeFaultMessage_def)
apply (wp asUser_inv mapM_wp' det_mapM[where S=UNIV]
det_getRestartPC getRestartPC_inv
| clarsimp simp: getRegister_def makeArchFaultMessage_def
split: arch_fault.split)+
done
lemmas threadget_fault_corres =
threadget_corres [where r = fault_rel_optionation
and f = tcb_fault and f' = tcbFault,
simplified tcb_relation_def, simplified]
lemma do_fault_transfer_corres:
"corres dc
(obj_at (\<lambda>ko. \<exists>tcb ft. ko = TCB tcb \<and> tcb_fault tcb = Some ft) sender
and tcb_at receiver and case_option \<top> in_user_frame recv_buf)
(tcb_at' sender and tcb_at' receiver and
case_option \<top> valid_ipc_buffer_ptr' recv_buf)
(do_fault_transfer badge sender receiver recv_buf)
(doFaultTransfer badge sender receiver recv_buf)"
apply (clarsimp simp: do_fault_transfer_def doFaultTransfer_def split_def
ARM_H.badgeRegister_def badge_register_def)
apply (rule_tac Q="\<lambda>fault. K (\<exists>f. fault = Some f) and
tcb_at sender and tcb_at receiver and
case_option \<top> in_user_frame recv_buf"
and Q'="\<lambda>fault'. tcb_at' sender and tcb_at' receiver and
case_option \<top> valid_ipc_buffer_ptr' recv_buf"
in corres_split')
apply (rule corres_guard_imp)
apply (rule threadget_fault_corres)
apply (clarsimp simp: obj_at_def is_tcb)+
apply (rule corres_assume_pre)
apply (fold assert_opt_def | unfold haskell_fail_def)+
apply (rule corres_assert_opt_assume)
apply (clarsimp split: option.splits
simp: fault_rel_optionation_def assert_opt_def
map_option_case)
defer
defer
apply (clarsimp simp: fault_rel_optionation_def)
apply (wp thread_get_wp)
apply (clarsimp simp: obj_at_def is_tcb)
apply wp
apply (rule corres_guard_imp)
apply (rule corres_split_eqr [OF _ mk_ft_msg_corres])
apply (rule corres_split_eqr [OF _ set_mrs_corres [OF refl]])
apply (rule corres_split_nor [OF _ set_mi_corres])
apply (rule user_setreg_corres)
apply simp
apply (wp | simp)+
apply (rule corres_guard_imp)
apply (rule corres_split_eqr [OF _ mk_ft_msg_corres])
apply (rule corres_split_eqr [OF _ set_mrs_corres [OF refl]])
apply (rule corres_split_nor [OF _ set_mi_corres])
apply (rule user_setreg_corres)
apply simp
apply (wp | simp)+
done
lemma doFaultTransfer_invs[wp]:
"\<lbrace>invs' and tcb_at' receiver\<rbrace>
doFaultTransfer badge sender receiver recv_buf
\<lbrace>\<lambda>rv. invs'\<rbrace>"
by (simp add: doFaultTransfer_def split_def | wp
| clarsimp split: option.split)+
lemma lookupIPCBuffer_valid_ipc_buffer [wp]:
"\<lbrace>valid_objs'\<rbrace> VSpace_H.lookupIPCBuffer b s \<lbrace>case_option \<top> valid_ipc_buffer_ptr'\<rbrace>"
unfolding lookupIPCBuffer_def ARM_H.lookupIPCBuffer_def
apply (simp add: Let_def getSlotCap_def getThreadBufferSlot_def
locateSlot_conv threadGet_def comp_def)
apply (wp getCTE_wp getObject_tcb_wp | wpc)+
apply (clarsimp simp del: imp_disjL)
apply (drule obj_at_ko_at')
apply (clarsimp simp del: imp_disjL)
apply (rule_tac x = ko in exI)
apply (frule ko_at_cte_ipcbuffer)
apply (clarsimp simp: cte_wp_at_ctes_of simp del: imp_disjL)
apply (clarsimp simp: valid_ipc_buffer_ptr'_def)
apply (frule (1) ko_at_valid_objs')
apply (clarsimp simp: projectKO_opts_defs split: kernel_object.split_asm)
apply (clarsimp simp add: valid_obj'_def valid_tcb'_def
isCap_simps cte_level_bits_def field_simps)
apply (drule bspec [OF _ ranI [where a = "0x40"]])
apply simp
apply (clarsimp simp add: valid_cap'_def)
apply (rule conjI)
apply (rule aligned_add_aligned)
apply (clarsimp simp add: capAligned_def)
apply assumption
apply (erule is_aligned_andI1)
apply (case_tac xd, simp_all add: msg_align_bits)[1]
apply (clarsimp simp: capAligned_def)
apply (drule_tac x =
"(tcbIPCBuffer ko && mask (pageBitsForSize xd)) >> pageBits" in spec)
apply (subst(asm) mult.commute mult.left_commute, subst(asm) shiftl_t2n[symmetric])
apply (simp add: shiftr_shiftl1)
apply (subst (asm) mask_out_add_aligned)
apply (erule is_aligned_weaken [OF _ pbfs_atleast_pageBits])
apply (erule mp)
apply (rule shiftr_less_t2n)
apply (clarsimp simp: pbfs_atleast_pageBits)
apply (rule and_mask_less')
apply (simp add: word_bits_conv)
done
lemma dit_corres:
"corres dc
(tcb_at s and tcb_at r and valid_objs and pspace_aligned
and valid_list
and pspace_distinct and valid_mdb and cur_tcb
and (\<lambda>s. case ep of Some x \<Rightarrow> ep_at x s | _ \<Rightarrow> True))
(tcb_at' s and tcb_at' r and valid_pspace' and cur_tcb'
and (\<lambda>s. case ep of Some x \<Rightarrow> ep_at' x s | _ \<Rightarrow> True))
(do_ipc_transfer s ep bg grt r)
(doIPCTransfer s ep bg grt r)"
apply (simp add: do_ipc_transfer_def doIPCTransfer_def)
apply (rule_tac Q="%receiveBuffer sa. tcb_at s sa \<and> valid_objs sa \<and>
pspace_aligned sa \<and> tcb_at r sa \<and>
cur_tcb sa \<and> valid_mdb sa \<and> valid_list sa \<and> pspace_distinct sa \<and>
(case ep of None \<Rightarrow> True | Some x \<Rightarrow> ep_at x sa) \<and>
case_option (\<lambda>_. True) in_user_frame receiveBuffer sa \<and>
obj_at (\<lambda>ko. \<exists>tcb. ko = TCB tcb
\<comment> \<open>\<exists>ft. tcb_fault tcb = Some ft\<close>) s sa"
in corres_split')
apply (rule corres_guard_imp)
apply (rule lipcb_corres')
apply auto[2]
apply (rule corres_split' [OF _ _ thread_get_sp threadGet_inv])
apply (rule corres_guard_imp)
apply (rule threadget_fault_corres)
apply simp
defer
apply (rule corres_guard_imp)
apply (subst case_option_If)+
apply (rule corres_if2)
apply (simp add: fault_rel_optionation_def)
apply (rule corres_split_eqr [OF _ lipcb_corres'])
apply (simp add: dc_def[symmetric])
apply (rule do_normal_transfer_corres)
apply (wp | simp add: valid_pspace'_def)+
apply (simp add: dc_def[symmetric])
apply (rule do_fault_transfer_corres)
apply (clarsimp simp: obj_at_def)
apply (erule ignore_if)
apply (wp|simp add: obj_at_def is_tcb valid_pspace'_def)+
done
crunch ifunsafe[wp]: doIPCTransfer "if_unsafe_then_cap'"
(wp: crunch_wps hoare_vcg_const_Ball_lift get_rs_cte_at' ignore: transferCapsToSlots
simp: zipWithM_x_mapM ball_conj_distrib )
crunch iflive[wp]: doIPCTransfer "if_live_then_nonz_cap'"
(wp: crunch_wps hoare_vcg_const_Ball_lift get_rs_cte_at' ignore: transferCapsToSlots
simp: zipWithM_x_mapM ball_conj_distrib )
lemma valid_pspace_valid_objs'[elim!]:
"valid_pspace' s \<Longrightarrow> valid_objs' s"
by (simp add: valid_pspace'_def)
crunch vp[wp]: doIPCTransfer "valid_pspace'"
(wp: crunch_wps hoare_vcg_const_Ball_lift get_rs_cte_at' wp: transferCapsToSlots_vp simp:ball_conj_distrib )
crunch sch_act_wf[wp]: doIPCTransfer "\<lambda>s. sch_act_wf (ksSchedulerAction s) s"
(wp: crunch_wps get_rs_cte_at' ignore: transferCapsToSlots simp: zipWithM_x_mapM)
crunch vq[wp]: doIPCTransfer "Invariants_H.valid_queues"
(wp: crunch_wps get_rs_cte_at' ignore: transferCapsToSlots simp: zipWithM_x_mapM)
crunch vq'[wp]: doIPCTransfer "valid_queues'"
(wp: crunch_wps get_rs_cte_at' ignore: transferCapsToSlots simp: zipWithM_x_mapM)
crunch state_refs_of[wp]: doIPCTransfer "\<lambda>s. P (state_refs_of' s)"
(wp: crunch_wps get_rs_cte_at' ignore: transferCapsToSlots simp: zipWithM_x_mapM)
crunch ct[wp]: doIPCTransfer "cur_tcb'"
(wp: crunch_wps get_rs_cte_at' ignore: transferCapsToSlots simp: zipWithM_x_mapM)
crunch idle'[wp]: doIPCTransfer "valid_idle'"
(wp: crunch_wps get_rs_cte_at' ignore: transferCapsToSlots simp: zipWithM_x_mapM)
crunch typ_at'[wp]: doIPCTransfer "\<lambda>s. P (typ_at' T p s)"
(wp: crunch_wps simp: zipWithM_x_mapM)
lemmas dit'_typ_ats[wp] = typ_at_lifts [OF doIPCTransfer_typ_at']
crunch irq_node'[wp]: doIPCTransfer "\<lambda>s. P (irq_node' s)"
(wp: crunch_wps simp: crunch_simps)
lemmas dit_irq_node'[wp]
= valid_irq_node_lift [OF doIPCTransfer_irq_node' doIPCTransfer_typ_at']
crunch valid_arch_state'[wp]: doIPCTransfer "valid_arch_state'"
(wp: crunch_wps simp: crunch_simps)
(* Levity: added (20090126 19:32:26) *)
declare asUser_global_refs' [wp]
lemma lec_valid_cap' [wp]:
"\<lbrace>valid_objs'\<rbrace> lookupExtraCaps thread xa mi \<lbrace>\<lambda>rv s. (\<forall>x\<in>set rv. s \<turnstile>' fst x)\<rbrace>, -"
apply (rule hoare_pre, rule hoare_post_imp_R)
apply (rule hoare_vcg_conj_lift_R[where R=valid_objs' and S="\<lambda>_. valid_objs'"])
apply (rule lookupExtraCaps_srcs)
apply wp
apply (clarsimp simp: cte_wp_at_ctes_of)
apply (fastforce elim: ctes_of_valid')
apply simp
done
crunch objs'[wp]: doIPCTransfer "valid_objs'"
( wp: crunch_wps hoare_vcg_const_Ball_lift
transferCapsToSlots_valid_objs
simp: zipWithM_x_mapM ball_conj_distrib )
crunch global_refs'[wp]: doIPCTransfer "valid_global_refs'"
(wp: crunch_wps hoare_vcg_const_Ball_lift threadSet_global_refsT
transferCapsToSlots_valid_globals
simp: zipWithM_x_mapM ball_conj_distrib)
declare asUser_irq_handlers' [wp]
crunch irq_handlers'[wp]: doIPCTransfer "valid_irq_handlers'"
(wp: crunch_wps hoare_vcg_const_Ball_lift threadSet_irq_handlers'
transferCapsToSlots_irq_handlers
simp: zipWithM_x_mapM ball_conj_distrib )
crunch irq_states'[wp]: doIPCTransfer "valid_irq_states'"
(wp: crunch_wps no_irq no_irq_mapM no_irq_storeWord no_irq_loadWord
no_irq_case_option simp: crunch_simps zipWithM_x_mapM)
crunch pde_mappings'[wp]: doIPCTransfer "valid_pde_mappings'"
(wp: crunch_wps simp: crunch_simps)
crunch irqs_masked'[wp]: doIPCTransfer "irqs_masked'"
(wp: crunch_wps simp: crunch_simps rule: irqs_masked_lift)
lemma doIPCTransfer_invs[wp]:
"\<lbrace>invs' and tcb_at' s and tcb_at' r\<rbrace>
doIPCTransfer s ep bg grt r
\<lbrace>\<lambda>rv. invs'\<rbrace>"
apply (simp add: doIPCTransfer_def)
apply (wpsimp wp: hoare_drop_imp)
done
crunch nosch[wp]: doIPCTransfer "\<lambda>s. P (ksSchedulerAction s)"
(wp: hoare_drop_imps hoare_vcg_split_case_option mapM_wp'
simp: split_def zipWithM_x_mapM)
lemma handle_fault_reply_registers_corres:
"corres (=) (tcb_at t) (tcb_at' t)
(do t' \<leftarrow> arch_get_sanitise_register_info t;
y \<leftarrow> as_user t
(zipWithM_x
(\<lambda>r v. setRegister r
(sanitise_register t' r v))
msg_template msg);
return (label = 0)
od)
(do t' \<leftarrow> getSanitiseRegisterInfo t;
y \<leftarrow> asUser t
(zipWithM_x
(\<lambda>r v. setRegister r (sanitiseRegister t' r v))
msg_template msg);
return (label = 0)
od)"
apply (rule corres_guard_imp)
apply (clarsimp simp: arch_get_sanitise_register_info_def getSanitiseRegisterInfo_def)
apply (rule corres_split)
apply (rule corres_trivial, simp)
apply (rule corres_as_user')
apply(simp add: setRegister_def sanitise_register_def
sanitiseRegister_def syscallMessage_def)
apply(subst zipWithM_x_modify)+
apply(rule corres_modify')
apply (simp|wp)+
done
lemma handle_fault_reply_corres:
"ft' = fault_map ft \<Longrightarrow>
corres (=) (tcb_at t) (tcb_at' t)
(handle_fault_reply ft t label msg)
(handleFaultReply ft' t label msg)"
apply (cases ft)
apply(simp_all add: handleFaultReply_def
handle_arch_fault_reply_def handleArchFaultReply_def
syscallMessage_def exceptionMessage_def
split: arch_fault.split)
by (rule handle_fault_reply_registers_corres)+
crunch typ_at'[wp]: handleFaultReply "\<lambda>s. P (typ_at' T p s)"
lemmas hfr_typ_ats[wp] = typ_at_lifts [OF handleFaultReply_typ_at']
crunch ct'[wp]: handleFaultReply "\<lambda>s. P (ksCurThread s)"
lemma doIPCTransfer_sch_act_simple [wp]:
"\<lbrace>sch_act_simple\<rbrace> doIPCTransfer sender endpoint badge grant receiver \<lbrace>\<lambda>_. sch_act_simple\<rbrace>"
by (simp add: sch_act_simple_def, wp)
lemma possibleSwitchTo_invs'[wp]:
"\<lbrace>invs' and st_tcb_at' runnable' t
and (\<lambda>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ksCurThread s \<noteq> t)\<rbrace>
possibleSwitchTo t \<lbrace>\<lambda>_. invs'\<rbrace>"
apply (simp add: possibleSwitchTo_def curDomain_def)
apply (wp tcbSchedEnqueue_invs' ssa_invs')
apply (rule hoare_post_imp[OF _ rescheduleRequired_sa_cnt])
apply (wpsimp wp: ssa_invs' threadGet_wp)+
apply (clarsimp dest!: obj_at_ko_at' simp: tcb_in_cur_domain'_def obj_at'_def)
done
crunch cur' [wp]: isFinalCapability "\<lambda>s. P (cur_tcb' s)"
(simp: crunch_simps unless_when
wp: crunch_wps getObject_inv loadObject_default_inv)
crunch ct' [wp]: deleteCallerCap "\<lambda>s. P (ksCurThread s)"
(simp: crunch_simps unless_when
wp: crunch_wps getObject_inv loadObject_default_inv)
lemma getThreadCallerSlot_inv:
"\<lbrace>P\<rbrace> getThreadCallerSlot t \<lbrace>\<lambda>_. P\<rbrace>"
by (simp add: getThreadCallerSlot_def, wp)
lemma deleteCallerCap_ct_not_ksQ:
"\<lbrace>invs' and ct_in_state' simple' and sch_act_sane
and (\<lambda>s. ksCurThread s \<notin> set (ksReadyQueues s p))\<rbrace>
deleteCallerCap t
\<lbrace>\<lambda>rv s. ksCurThread s \<notin> set (ksReadyQueues s p)\<rbrace>"
apply (simp add: deleteCallerCap_def getSlotCap_def getThreadCallerSlot_def locateSlot_conv)
apply (wp getThreadCallerSlot_inv cteDeleteOne_ct_not_ksQ getCTE_wp)
apply (clarsimp simp: cte_wp_at_ctes_of)
done
crunch tcb_at'[wp]: unbindNotification "tcb_at' x"
lemma finaliseCapTrue_standin_tcb_at' [wp]:
"\<lbrace>tcb_at' x\<rbrace> finaliseCapTrue_standin cap v2 \<lbrace>\<lambda>_. tcb_at' x\<rbrace>"
apply (simp add: finaliseCapTrue_standin_def Let_def)
apply (safe)
apply (wp getObject_ntfn_inv
| wpc
| simp)+
done
lemma finaliseCapTrue_standin_cur':
"\<lbrace>\<lambda>s. cur_tcb' s\<rbrace> finaliseCapTrue_standin cap v2 \<lbrace>\<lambda>_ s'. cur_tcb' s'\<rbrace>"
apply (simp add: cur_tcb'_def)
apply (rule hoare_lift_Pf2 [OF _ finaliseCapTrue_standin_ct'])
apply (wp)
done
lemma cteDeleteOne_cur' [wp]:
"\<lbrace>\<lambda>s. cur_tcb' s\<rbrace> cteDeleteOne slot \<lbrace>\<lambda>_ s'. cur_tcb' s'\<rbrace>"
apply (simp add: cteDeleteOne_def unless_def when_def)
apply (wp hoare_drop_imps finaliseCapTrue_standin_cur' isFinalCapability_cur'
| simp add: split_def | wp (once) cur_tcb_lift)+
done
lemma handleFaultReply_cur' [wp]:
"\<lbrace>\<lambda>s. cur_tcb' s\<rbrace> handleFaultReply x0 thread label msg \<lbrace>\<lambda>_ s'. cur_tcb' s'\<rbrace>"
apply (clarsimp simp add: cur_tcb'_def)
apply (rule hoare_lift_Pf2 [OF _ handleFaultReply_ct'])
apply (wp)
done
lemma capClass_Reply:
"capClass cap = ReplyClass tcb \<Longrightarrow> isReplyCap cap \<and> capTCBPtr cap = tcb"
apply (cases cap, simp_all add: isCap_simps)
apply (rename_tac arch_capability)
apply (case_tac arch_capability, simp_all)
done
lemma reply_cap_end_mdb_chain:
"\<lbrakk> cte_wp_at (is_reply_cap_to t) slot s; invs s;
invs' s';
(s, s') \<in> state_relation; ctes_of s' (cte_map slot) = Some cte \<rbrakk>
\<Longrightarrow> (mdbPrev (cteMDBNode cte) \<noteq> nullPointer
\<and> mdbNext (cteMDBNode cte) = nullPointer)
\<and> cte_wp_at' (\<lambda>cte. isReplyCap (cteCap cte) \<and> capReplyMaster (cteCap cte))
(mdbPrev (cteMDBNode cte)) s'"
apply (clarsimp simp only: cte_wp_at_reply_cap_to_ex_rights)
apply (frule(1) pspace_relation_ctes_ofI[OF state_relation_pspace_relation],
clarsimp+)
apply (subgoal_tac "\<exists>slot' rights'. caps_of_state s slot' = Some (cap.ReplyCap t True rights')
\<and> descendants_of slot' (cdt s) = {slot}")
apply (elim state_relationE exE)
apply (clarsimp simp: cdt_relation_def
simp del: split_paired_All)
apply (drule spec, drule(1) mp[OF _ caps_of_state_cte_at])
apply (frule(1) pspace_relation_cte_wp_at[OF _ caps_of_state_cteD],
clarsimp+)
apply (clarsimp simp: descendants_of'_def cte_wp_at_ctes_of)
apply (frule_tac f="\<lambda>S. cte_map slot \<in> S" in arg_cong, simp(no_asm_use))
apply (frule invs_mdb'[unfolded valid_mdb'_def])
apply (rule context_conjI)
apply (clarsimp simp: nullPointer_def valid_mdb_ctes_def)
apply (erule(4) subtree_prev_0)
apply (rule conjI)
apply (rule ccontr)
apply (frule valid_mdb_no_loops, simp add: no_loops_def)
apply (drule_tac x="cte_map slot" in spec)
apply (erule notE, rule r_into_trancl, rule ccontr)
apply (clarsimp simp: mdb_next_unfold valid_mdb_ctes_def nullPointer_def)
apply (rule valid_dlistEn, assumption+)
apply (subgoal_tac "ctes_of s' \<turnstile> cte_map slot \<leadsto> mdbNext (cteMDBNode cte)")
apply (frule(3) class_linksD)
apply (clarsimp simp: isCap_simps dest!: capClass_Reply[OF sym])
apply (drule_tac f="\<lambda>S. mdbNext (cteMDBNode cte) \<in> S" in arg_cong)
apply (simp, erule notE, rule subtree.trans_parent, assumption+)
apply (case_tac ctea, case_tac cte')
apply (clarsimp simp add: parentOf_def isMDBParentOf_CTE)
apply (simp add: sameRegionAs_def2 isCap_simps)
apply (erule subtree.cases)
apply (clarsimp simp: parentOf_def isMDBParentOf_CTE)
apply (clarsimp simp: parentOf_def isMDBParentOf_CTE)
apply (simp add: mdb_next_unfold)
apply (erule subtree.cases)
apply (clarsimp simp: valid_mdb_ctes_def)
apply (erule_tac cte=ctea in valid_dlistEn, assumption)
apply (simp add: mdb_next_unfold)
apply (clarsimp simp: mdb_next_unfold isCap_simps)
apply (drule_tac f="\<lambda>S. c' \<in> S" in arg_cong)
apply (clarsimp simp: no_loops_direct_simp valid_mdb_no_loops)
apply (frule invs_mdb)
apply (drule invs_valid_reply_caps)
apply (clarsimp simp: valid_mdb_def reply_mdb_def
valid_reply_caps_def reply_caps_mdb_def
cte_wp_at_caps_of_state
simp del: split_paired_All)
apply (erule_tac x=slot in allE, erule_tac x=t in allE, erule impE, fast)
apply (elim exEI)
apply clarsimp
apply (subgoal_tac "P" for P, rule sym, rule equalityI, assumption)
apply clarsimp
apply (erule(4) unique_reply_capsD)
apply (simp add: descendants_of_def)
apply (rule r_into_trancl)
apply (simp add: cdt_parent_rel_def is_cdt_parent_def)
done
crunch valid_objs'[wp]: cteDeleteOne "valid_objs'"
(simp: crunch_simps unless_def
wp: crunch_wps getObject_inv loadObject_default_inv)
crunch nosch[wp]: handleFaultReply "\<lambda>s. P (ksSchedulerAction s)"
lemma emptySlot_weak_sch_act[wp]:
"\<lbrace>\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>
emptySlot slot irq
\<lbrace>\<lambda>_ s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>"
by (wp weak_sch_act_wf_lift tcb_in_cur_domain'_lift)
lemma cancelAllIPC_weak_sch_act_wf[wp]:
"\<lbrace>\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>
cancelAllIPC epptr
\<lbrace>\<lambda>_ s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>"
apply (simp add: cancelAllIPC_def)
apply (wp rescheduleRequired_weak_sch_act_wf hoare_drop_imp | wpc | simp)+
done
lemma cancelAllSignals_weak_sch_act_wf[wp]:
"\<lbrace>\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>
cancelAllSignals ntfnptr
\<lbrace>\<lambda>_ s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>"
apply (simp add: cancelAllSignals_def)
apply (wp rescheduleRequired_weak_sch_act_wf hoare_drop_imp | wpc | simp)+
done
crunch weak_sch_act_wf[wp]: finaliseCapTrue_standin "\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s"
(ignore: setThreadState
simp: crunch_simps
wp: crunch_wps getObject_inv loadObject_default_inv)
lemma cteDeleteOne_weak_sch_act[wp]:
"\<lbrace>\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>
cteDeleteOne sl
\<lbrace>\<lambda>_ s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>"
apply (simp add: cteDeleteOne_def unless_def)
apply (wp hoare_drop_imps finaliseCapTrue_standin_cur' isFinalCapability_cur'
| simp add: split_def)+
done
crunch weak_sch_act_wf[wp]: emptySlot "\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s"
crunch pred_tcb_at'[wp]: handleFaultReply "pred_tcb_at' proj P t"
crunch valid_queues[wp]: handleFaultReply "Invariants_H.valid_queues"
crunch valid_queues'[wp]: handleFaultReply "valid_queues'"
crunch tcb_in_cur_domain'[wp]: handleFaultReply "tcb_in_cur_domain' t"
crunch sch_act_wf[wp]: unbindNotification "\<lambda>s. sch_act_wf (ksSchedulerAction s) s"
(wp: sbn_sch_act')
crunch valid_queues'[wp]: cteDeleteOne valid_queues'
(simp: crunch_simps inQ_def
wp: crunch_wps sts_st_tcb' getObject_inv loadObject_default_inv
threadSet_valid_queues' rescheduleRequired_valid_queues'_weak)
lemma cancelSignal_valid_queues'[wp]:
"\<lbrace>valid_queues'\<rbrace> cancelSignal t ntfn \<lbrace>\<lambda>rv. valid_queues'\<rbrace>"
apply (simp add: cancelSignal_def)
apply (rule hoare_pre)
apply (wp getNotification_wp| wpc | simp)+
done
lemma cancelIPC_valid_queues'[wp]:
"\<lbrace>valid_queues' and (\<lambda>s. sch_act_wf (ksSchedulerAction s) s) \<rbrace> cancelIPC t \<lbrace>\<lambda>rv. valid_queues'\<rbrace>"
apply (simp add: cancelIPC_def Let_def getThreadReplySlot_def locateSlot_conv liftM_def)
apply (rule hoare_seq_ext[OF _ gts_sp'])
apply (case_tac state, simp_all) defer 2
apply (rule hoare_pre)
apply ((wp getEndpoint_wp getCTE_wp | wpc | simp)+)[8]
apply (wp cteDeleteOne_valid_queues')
apply (rule_tac Q="\<lambda>_. valid_queues' and (\<lambda>s. sch_act_wf (ksSchedulerAction s) s)" in hoare_post_imp)
apply (clarsimp simp: capHasProperty_def cte_wp_at_ctes_of)
apply (wp threadSet_valid_queues' threadSet_sch_act| simp)+
apply (clarsimp simp: inQ_def)
done
crunch valid_objs'[wp]: handleFaultReply valid_objs'
lemma valid_tcb'_tcbFault_update[simp]: "\<And>tcb s. valid_tcb' tcb s \<Longrightarrow> valid_tcb' (tcbFault_update f tcb) s"
by (clarsimp simp: valid_tcb'_def tcb_cte_cases_def)
lemma cte_wp_at_is_reply_cap_toI:
"cte_wp_at ((=) (cap.ReplyCap t False rights)) ptr s
\<Longrightarrow> cte_wp_at (is_reply_cap_to t) ptr s"
by (fastforce simp: cte_wp_at_reply_cap_to_ex_rights)
lemma do_reply_transfer_corres:
"corres dc
(einvs and tcb_at receiver and tcb_at sender
and cte_wp_at ((=) (cap.ReplyCap receiver False rights)) slot)
(invs' and tcb_at' sender and tcb_at' receiver
and valid_pspace' and cte_at' (cte_map slot))
(do_reply_transfer sender receiver slot grant)
(doReplyTransfer sender receiver (cte_map slot) grant)"
apply (simp add: do_reply_transfer_def doReplyTransfer_def cong: option.case_cong)
apply (rule corres_split' [OF _ _ gts_sp gts_sp'])
apply (rule corres_guard_imp)
apply (rule gts_corres, (clarsimp simp add: st_tcb_at_tcb_at)+)
apply (rule_tac F = "awaiting_reply state" in corres_req)
apply (clarsimp simp add: st_tcb_at_def obj_at_def is_tcb)
apply (fastforce simp: invs_def valid_state_def intro: has_reply_cap_cte_wpD
dest: has_reply_cap_cte_wpD
dest!: valid_reply_caps_awaiting_reply cte_wp_at_is_reply_cap_toI)
apply (case_tac state, simp_all add: bind_assoc)
apply (simp add: isReply_def liftM_def)
apply (rule corres_symb_exec_r[OF _ getCTE_sp getCTE_inv, rotated])
apply (rule no_fail_pre, wp)
apply clarsimp
apply (rename_tac mdbnode)
apply (rule_tac P="Q" and Q="Q" and P'="Q'" and Q'="(\<lambda>s. Q' s \<and> R' s)" for Q Q' R'
in stronger_corres_guard_imp[rotated])
apply assumption
apply (rule conjI, assumption)
apply (clarsimp simp: cte_wp_at_ctes_of)
apply (drule cte_wp_at_is_reply_cap_toI)
apply (erule(4) reply_cap_end_mdb_chain)
apply (rule corres_assert_assume[rotated], simp)
apply (simp add: getSlotCap_def)
apply (rule corres_symb_exec_r[OF _ getCTE_sp getCTE_inv, rotated])
apply (rule no_fail_pre, wp)
apply (clarsimp simp: cte_wp_at_ctes_of)
apply (rule corres_assert_assume[rotated])
apply (clarsimp simp: cte_wp_at_ctes_of)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ threadget_fault_corres])
apply (case_tac rv, simp_all add: fault_rel_optionation_def bind_assoc)[1]
apply (rule corres_split [OF _ dit_corres])
apply (rule corres_split [OF _ cap_delete_one_corres])
apply (rule corres_split [OF _ sts_corres])
apply (rule possibleSwitchTo_corres)
apply simp
apply (wp set_thread_state_runnable_valid_sched set_thread_state_runnable_weak_valid_sched_action sts_st_tcb_at' sts_st_tcb' sts_valid_queues sts_valid_objs' delete_one_tcbDomain_obj_at'
| simp add: valid_tcb_state'_def)+
apply (strengthen cte_wp_at_reply_cap_can_fast_finalise)
apply (wp hoare_vcg_conj_lift)
apply (rule hoare_strengthen_post [OF do_ipc_transfer_non_null_cte_wp_at])
prefer 2
apply (erule cte_wp_at_weakenE)
apply (fastforce)
apply (clarsimp simp:is_cap_simps)
apply (wp weak_valid_sched_action_lift)+
apply (rule_tac Q="\<lambda>_. valid_queues' and valid_objs' and cur_tcb' and tcb_at' receiver and (\<lambda>s. sch_act_wf (ksSchedulerAction s) s)" in hoare_post_imp, simp add: sch_act_wf_weak)
apply (wp tcb_in_cur_domain'_lift)
defer
apply (simp)
apply (wp)+
apply (clarsimp)
apply (rule conjI, erule invs_valid_objs)
apply (rule conjI, clarsimp)+
apply (rule conjI)
apply (erule cte_wp_at_weakenE)
apply (clarsimp)
apply (rule conjI, rule refl)
apply (fastforce)
apply (clarsimp simp: invs_def valid_sched_def valid_sched_action_def)
apply (simp)
apply (auto simp: invs'_def valid_state'_def)[1]
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ cap_delete_one_corres])
apply (rule corres_split_mapr [OF _ get_mi_corres])
apply (rule corres_split_eqr [OF _ lipcb_corres'])
apply (rule corres_split_eqr [OF _ get_mrs_corres])
apply (simp(no_asm) del: dc_simp)
apply (rule corres_split_eqr [OF _ handle_fault_reply_corres])
apply (rule corres_split [OF _ threadset_corresT])
apply (rule_tac Q="valid_sched and cur_tcb and tcb_at receiver"
and Q'="tcb_at' receiver and cur_tcb'
and (\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s)
and Invariants_H.valid_queues and valid_queues' and valid_objs'"
in corres_guard_imp)
apply (case_tac rvb, simp_all)[1]
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ sts_corres])
apply (fold dc_def, rule possibleSwitchTo_corres)
apply simp
apply (wp static_imp_wp static_imp_conj_wp set_thread_state_runnable_weak_valid_sched_action sts_st_tcb_at'
sts_st_tcb' sts_valid_queues | simp | force simp: valid_sched_def valid_sched_action_def valid_tcb_state'_def)+
apply (rule corres_guard_imp)
apply (rule sts_corres)
apply (simp_all)[20]
apply (clarsimp simp add: tcb_relation_def fault_rel_optionation_def
tcb_cap_cases_def tcb_cte_cases_def exst_same_def)+
apply (wp threadSet_cur weak_sch_act_wf_lift_linear threadSet_pred_tcb_no_state
thread_set_not_state_valid_sched threadSet_valid_queues threadSet_valid_queues'
threadSet_tcbDomain_triv threadSet_valid_objs'
| simp add: valid_tcb_state'_def)+
apply (wp threadSet_cur weak_sch_act_wf_lift_linear threadSet_pred_tcb_no_state
thread_set_not_state_valid_sched threadSet_valid_queues threadSet_valid_queues'
| simp add: runnable_def inQ_def valid_tcb'_def)+
apply (rule_tac Q="\<lambda>_. valid_sched and cur_tcb and tcb_at sender and tcb_at receiver and valid_objs and pspace_aligned"
in hoare_strengthen_post [rotated], clarsimp)
apply (wp)
apply (rule hoare_chain [OF cap_delete_one_invs])
apply (assumption)
apply (rule conjI, clarsimp)
apply (clarsimp simp add: invs_def valid_state_def)
apply (rule_tac Q="\<lambda>_. tcb_at' sender and tcb_at' receiver and invs'"
in hoare_strengthen_post [rotated])
apply (solves\<open>auto simp: invs'_def valid_state'_def\<close>)
apply wp
apply clarsimp
apply (rule conjI)
apply (erule cte_wp_at_weakenE)
apply (clarsimp simp add: can_fast_finalise_def)
apply (erule(1) emptyable_cte_wp_atD)
apply (rule allI, rule impI)
apply (clarsimp simp add: is_master_reply_cap_def)
apply (clarsimp)
done
(* when we cannot talk about reply cap rights explicitly (for instance, when a schematic ?rights
would be generated too early *)
lemma do_reply_transfer_corres':
"corres dc
(einvs and tcb_at receiver and tcb_at sender
and cte_wp_at (is_reply_cap_to receiver) slot)
(invs' and tcb_at' sender and tcb_at' receiver
and valid_pspace' and cte_at' (cte_map slot))
(do_reply_transfer sender receiver slot grant)
(doReplyTransfer sender receiver (cte_map slot) grant)"
using do_reply_transfer_corres[of receiver sender _ slot]
by (fastforce simp add: cte_wp_at_reply_cap_to_ex_rights corres_underlying_def)
lemma valid_pspace'_splits[elim!]:
"valid_pspace' s \<Longrightarrow> valid_objs' s"
"valid_pspace' s \<Longrightarrow> pspace_aligned' s"
"valid_pspace' s \<Longrightarrow> pspace_distinct' s"
"valid_pspace' s \<Longrightarrow> valid_mdb' s"
"valid_pspace' s \<Longrightarrow> no_0_obj' s"
by (simp add: valid_pspace'_def)+
lemma sts_valid_pspace_hangers:
"\<lbrace>valid_pspace' and tcb_at' t and
valid_tcb_state' st\<rbrace> setThreadState st t \<lbrace>\<lambda>rv. valid_objs'\<rbrace>"
"\<lbrace>valid_pspace' and tcb_at' t and
valid_tcb_state' st\<rbrace> setThreadState st t \<lbrace>\<lambda>rv. pspace_distinct'\<rbrace>"
"\<lbrace>valid_pspace' and tcb_at' t and
valid_tcb_state' st\<rbrace> setThreadState st t \<lbrace>\<lambda>rv. pspace_aligned'\<rbrace>"
"\<lbrace>valid_pspace' and tcb_at' t and
valid_tcb_state' st\<rbrace> setThreadState st t \<lbrace>\<lambda>rv. valid_mdb'\<rbrace>"
"\<lbrace>valid_pspace' and tcb_at' t and
valid_tcb_state' st\<rbrace> setThreadState st t \<lbrace>\<lambda>rv. no_0_obj'\<rbrace>"
by (safe intro!: hoare_strengthen_post [OF sts'_valid_pspace'_inv])
declare no_fail_getSlotCap [wp]
lemma setup_caller_corres:
"corres dc
(st_tcb_at (Not \<circ> halted) sender and tcb_at receiver and
st_tcb_at (Not \<circ> awaiting_reply) sender and valid_reply_caps and
valid_objs and pspace_distinct and pspace_aligned and valid_mdb
and valid_list and
valid_reply_masters and cte_wp_at (\<lambda>c. c = cap.NullCap) (receiver, tcb_cnode_index 3))
(tcb_at' sender and tcb_at' receiver and valid_pspace'
and (\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s))
(setup_caller_cap sender receiver grant)
(setupCallerCap sender receiver grant)"
supply if_split[split del]
apply (simp add: setup_caller_cap_def setupCallerCap_def
getThreadReplySlot_def locateSlot_conv
getThreadCallerSlot_def)
apply (rule stronger_corres_guard_imp)
apply (rule corres_split_nor)
apply (rule corres_symb_exec_r)
apply (rule_tac F="\<exists>r. cteCap masterCTE = capability.ReplyCap sender True r
\<and> mdbNext (cteMDBNode masterCTE) = nullPointer"
in corres_gen_asm2, clarsimp simp add: isCap_simps)
apply (rule corres_symb_exec_r)
apply (rule_tac F="rv = capability.NullCap"
in corres_gen_asm2, simp)
apply (rule cins_corres)
apply (simp split: if_splits)
apply (simp add: cte_map_def tcbReplySlot_def
tcb_cnode_index_def cte_level_bits_def)
apply (simp add: cte_map_def tcbCallerSlot_def
tcb_cnode_index_def cte_level_bits_def)
apply (rule_tac Q="\<lambda>rv. cte_at' (receiver + 2 ^ cte_level_bits * tcbCallerSlot)"
in valid_prove_more)
apply (wp, (wp getSlotCap_wp)+)
apply blast
apply (rule no_fail_pre, wp)
apply (clarsimp simp: cte_wp_at'_def cte_at'_def)
apply (rule_tac Q="\<lambda>rv. cte_at' (sender + 2 ^ cte_level_bits * tcbReplySlot)"
in valid_prove_more)
apply (wp, (wp getCTE_wp')+)
apply blast
apply (rule no_fail_pre, wp)
apply (clarsimp simp: cte_wp_at_ctes_of)
apply (rule sts_corres)
apply (simp split: option.split)
apply (wp sts_valid_pspace_hangers
| simp add: cte_wp_at_ctes_of)+
apply (clarsimp simp: valid_tcb_state_def st_tcb_at_reply_cap_valid
st_tcb_at_tcb_at st_tcb_at_caller_cap_null
split: option.split)
apply (clarsimp simp: valid_tcb_state'_def valid_cap'_def capAligned_reply_tcbI)
apply (frule(1) st_tcb_at_reply_cap_valid, simp, clarsimp)
apply (clarsimp simp: cte_wp_at_ctes_of cte_wp_at_caps_of_state)
apply (drule pspace_relation_cte_wp_at[rotated, OF caps_of_state_cteD],
erule valid_pspace'_splits, clarsimp+)+
apply (clarsimp simp: cte_wp_at_ctes_of cte_map_def tcbReplySlot_def
tcbCallerSlot_def tcb_cnode_index_def
is_cap_simps)
apply (auto intro: reply_no_descendants_mdbNext_null[OF not_waiting_reply_slot_no_descendants]
simp: cte_index_repair)
done
crunch tcb_at'[wp]: getThreadCallerSlot "tcb_at' t"
lemma getThreadReplySlot_tcb_at'[wp]:
"\<lbrace>tcb_at' t\<rbrace> getThreadReplySlot tcb \<lbrace>\<lambda>_. tcb_at' t\<rbrace>"
by (simp add: getThreadReplySlot_def, wp)
lemma setupCallerCap_tcb_at'[wp]:
"\<lbrace>tcb_at' t\<rbrace> setupCallerCap sender receiver grant \<lbrace>\<lambda>_. tcb_at' t\<rbrace>"
by (simp add: setupCallerCap_def, wp hoare_drop_imp)
crunch ct'[wp]: setupCallerCap "\<lambda>s. P (ksCurThread s)"
(wp: crunch_wps)
lemma cteInsert_sch_act_wf[wp]:
"\<lbrace>\<lambda>s. sch_act_wf (ksSchedulerAction s) s\<rbrace>
cteInsert newCap srcSlot destSlot
\<lbrace>\<lambda>_ s. sch_act_wf (ksSchedulerAction s) s\<rbrace>"
by (wp sch_act_wf_lift tcb_in_cur_domain'_lift)
lemma setupCallerCap_sch_act [wp]:
"\<lbrace>\<lambda>s. sch_act_not t s \<and> sch_act_wf (ksSchedulerAction s) s\<rbrace>
setupCallerCap t r g \<lbrace>\<lambda>_ s. sch_act_wf (ksSchedulerAction s) s\<rbrace>"
apply (simp add: setupCallerCap_def getSlotCap_def getThreadCallerSlot_def
getThreadReplySlot_def locateSlot_conv)
apply (wp getCTE_wp' sts_sch_act' hoare_drop_imps hoare_vcg_all_lift)
apply clarsimp
done
lemma possibleSwitchTo_weak_sch_act_wf[wp]:
"\<lbrace>\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s \<and> st_tcb_at' runnable' t s\<rbrace>
possibleSwitchTo t \<lbrace>\<lambda>rv s. weak_sch_act_wf (ksSchedulerAction s) s\<rbrace>"
apply (simp add: possibleSwitchTo_def setSchedulerAction_def threadGet_def curDomain_def
bitmap_fun_defs)
apply (wp rescheduleRequired_weak_sch_act_wf
weak_sch_act_wf_lift_linear[where f="tcbSchedEnqueue t"]
getObject_tcb_wp static_imp_wp
| wpc)+
apply (clarsimp simp: obj_at'_def projectKOs weak_sch_act_wf_def ps_clear_def tcb_in_cur_domain'_def)
done
lemmas transferCapsToSlots_pred_tcb_at' =
transferCapsToSlots_pres1 [OF cteInsert_pred_tcb_at']
crunches doIPCTransfer, possibleSwitchTo
for pred_tcb_at'[wp]: "pred_tcb_at' proj P t"
(wp: mapM_wp' crunch_wps simp: zipWithM_x_mapM)
(* FIXME move *)
lemma tcb_in_cur_domain'_ksSchedulerAction_update[simp]:
"tcb_in_cur_domain' t (ksSchedulerAction_update f s) = tcb_in_cur_domain' t s"
by (simp add: tcb_in_cur_domain'_def)
(* FIXME move *)
lemma ct_idle_or_in_cur_domain'_ksSchedulerAction_update[simp]:
"b\<noteq> ResumeCurrentThread \<Longrightarrow>
ct_idle_or_in_cur_domain' (s\<lparr>ksSchedulerAction := b\<rparr>)"
apply (clarsimp simp add: ct_idle_or_in_cur_domain'_def)
done
lemma setSchedulerAction_ct_in_domain:
"\<lbrace>\<lambda>s. ct_idle_or_in_cur_domain' s
\<and> p \<noteq> ResumeCurrentThread \<rbrace> setSchedulerAction p
\<lbrace>\<lambda>_. ct_idle_or_in_cur_domain'\<rbrace>"
by (simp add:setSchedulerAction_def | wp)+
crunches setupCallerCap, doIPCTransfer, possibleSwitchTo
for ct_idle_or_in_cur_domain'[wp]: ct_idle_or_in_cur_domain'
and ksCurDomain[wp]: "\<lambda>s. P (ksCurDomain s)"
and ksDomSchedule[wp]: "\<lambda>s. P (ksDomSchedule s)"
(wp: crunch_wps setSchedulerAction_ct_in_domain simp: zipWithM_x_mapM)
crunch tcbDomain_obj_at'[wp]: doIPCTransfer "obj_at' (\<lambda>tcb. P (tcbDomain tcb)) t"
(wp: crunch_wps constOnFailure_wp simp: crunch_simps)
crunches possibleSwitchTo
for tcb_at'[wp]: "tcb_at' t"
and valid_pspace'[wp]: valid_pspace'
(wp: crunch_wps)
lemma send_ipc_corres:
(* call is only true if called in handleSyscall SysCall, which
is always blocking. *)
assumes "call \<longrightarrow> bl"
shows
"corres dc (einvs and st_tcb_at active t and ep_at ep and ex_nonz_cap_to t)
(invs' and sch_act_not t and tcb_at' t and ep_at' ep)
(send_ipc bl call bg cg cgr t ep) (sendIPC bl call bg cg cgr t ep)"
proof -
show ?thesis
apply (insert assms)
apply (unfold send_ipc_def sendIPC_def Let_def)
apply (case_tac bl)
apply clarsimp
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ get_ep_corres,
where
R="\<lambda>rv. einvs and st_tcb_at active t and ep_at ep and
valid_ep rv and obj_at (\<lambda>ob. ob = Endpoint rv) ep
and ex_nonz_cap_to t"
and
R'="\<lambda>rv'. invs' and tcb_at' t and sch_act_not t
and ep_at' ep and valid_ep' rv'"])
apply (case_tac rv)
apply (simp add: ep_relation_def)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ sts_corres])
apply (rule set_ep_corres)
apply (simp add: ep_relation_def)
apply (simp add: fault_rel_optionation_def)
apply wp+
apply (clarsimp simp: st_tcb_at_tcb_at valid_tcb_state_def)
apply clarsimp
\<comment> \<open>concludes IdleEP if bl branch\<close>
apply (simp add: ep_relation_def)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ sts_corres])
apply (rule set_ep_corres)
apply (simp add: ep_relation_def)
apply (simp add: fault_rel_optionation_def)
apply wp+
apply (clarsimp simp: st_tcb_at_tcb_at valid_tcb_state_def)
apply clarsimp
\<comment> \<open>concludes SendEP if bl branch\<close>
apply (simp add: ep_relation_def)
apply (rename_tac list)
apply (rule_tac F="list \<noteq> []" in corres_req)
apply (simp add: valid_ep_def)
apply (case_tac list)
apply simp
apply (clarsimp split del: if_split)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ set_ep_corres])
apply (simp add: isReceive_def split del:if_split)
apply (rule corres_split [OF _ gts_corres])
apply (rule_tac
F="\<exists>data. recv_state = Structures_A.BlockedOnReceive ep data"
in corres_gen_asm)
apply (clarsimp simp: case_bool_If case_option_If if3_fold
simp del: dc_simp split del: if_split cong: if_cong)
apply (rule corres_split [OF _ dit_corres])
apply (rule corres_split [OF _ sts_corres])
apply (rule corres_split [OF _ possibleSwitchTo_corres])
apply (fold when_def)[1]
apply (rule_tac P="call" and P'="call"
in corres_symmetric_bool_cases, blast)
apply (simp add: when_def dc_def[symmetric] split del: if_split)
apply (rule corres_if2, simp)
apply (rule setup_caller_corres)
apply (rule sts_corres, simp)
apply (rule corres_trivial)
apply (simp add: when_def dc_def[symmetric] split del: if_split)
apply (simp split del: if_split add: if_apply_def2)
apply (wp hoare_drop_imps)[1]
apply (simp split del: if_split add: if_apply_def2)
apply (wp hoare_drop_imps)[1]
apply (wp | simp)+
apply (wp sts_cur_tcb set_thread_state_runnable_weak_valid_sched_action sts_st_tcb_at_cases)
apply (wp setThreadState_valid_queues' sts_valid_queues sts_weak_sch_act_wf
sts_cur_tcb' setThreadState_tcb' sts_st_tcb_at'_cases)[1]
apply (simp add: valid_tcb_state_def pred_conj_def)
apply (strengthen reply_cap_doesnt_exist_strg disjI2_strg)
apply ((wp hoare_drop_imps do_ipc_transfer_tcb_caps weak_valid_sched_action_lift
| clarsimp simp: is_cap_simps)+)[1]
apply (simp add: pred_conj_def)
apply (strengthen sch_act_wf_weak)
apply (simp add: valid_tcb_state'_def)
apply (wp weak_sch_act_wf_lift_linear tcb_in_cur_domain'_lift hoare_drop_imps)[1]
apply (wp gts_st_tcb_at)+
apply (simp add: ep_relation_def split: list.split)
apply (simp add: pred_conj_def cong: conj_cong)
apply (wp hoare_post_taut)
apply (simp)
apply (wp weak_sch_act_wf_lift_linear set_ep_valid_objs' setEndpoint_valid_mdb')+
apply (clarsimp simp add: invs_def valid_state_def valid_pspace_def ep_redux_simps
ep_redux_simps' st_tcb_at_tcb_at valid_ep_def
cong: list.case_cong)
apply (drule(1) sym_refs_obj_atD[where P="\<lambda>ob. ob = e" for e])
apply (clarsimp simp: st_tcb_at_refs_of_rev st_tcb_at_reply_cap_valid
st_tcb_def2 valid_sched_def valid_sched_action_def)
apply (force simp: st_tcb_def2 dest!: st_tcb_at_caller_cap_null[simplified,rotated])
subgoal by (auto simp: valid_ep'_def invs'_def valid_state'_def split: list.split)
apply wp+
apply (clarsimp simp: ep_at_def2)+
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ get_ep_corres,
where
R="\<lambda>rv. einvs and st_tcb_at active t and ep_at ep and
valid_ep rv and obj_at (\<lambda>k. k = Endpoint rv) ep"
and
R'="\<lambda>rv'. invs' and tcb_at' t and sch_act_not t
and ep_at' ep and valid_ep' rv'"])
apply (rename_tac rv rv')
apply (case_tac rv)
apply (simp add: ep_relation_def)
\<comment> \<open>concludes IdleEP branch if not bl and no ft\<close>
apply (simp add: ep_relation_def)
\<comment> \<open>concludes SendEP branch if not bl and no ft\<close>
apply (simp add: ep_relation_def)
apply (rename_tac list)
apply (rule_tac F="list \<noteq> []" in corres_req)
apply (simp add: valid_ep_def)
apply (case_tac list)
apply simp
apply (rule_tac F="a \<noteq> t" in corres_req)
apply (clarsimp simp: invs_def valid_state_def
valid_pspace_def)
apply (drule(1) sym_refs_obj_atD[where P="\<lambda>ob. ob = e" for e])
apply (clarsimp simp: st_tcb_at_def obj_at_def tcb_bound_refs_def2)
apply fastforce
apply (clarsimp split del: if_split)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ set_ep_corres])
apply (rule corres_split [OF _ gts_corres])
apply (rule_tac
F="\<exists>data. recv_state = Structures_A.BlockedOnReceive ep data"
in corres_gen_asm)
apply (clarsimp simp: isReceive_def case_bool_If
split del: if_split cong: if_cong)
apply (rule corres_split [OF _ dit_corres])
apply (rule corres_split [OF _ sts_corres])
apply (rule possibleSwitchTo_corres)
apply (simp add: if_apply_def2)
apply (wp hoare_drop_imps)
apply (simp add: if_apply_def2)
apply ((wp sts_cur_tcb set_thread_state_runnable_weak_valid_sched_action sts_st_tcb_at_cases |
simp add: if_apply_def2 split del: if_split)+)[1]
apply (wp setThreadState_valid_queues' sts_valid_queues sts_weak_sch_act_wf
sts_cur_tcb' setThreadState_tcb' sts_st_tcb_at'_cases)
apply (simp add: valid_tcb_state_def pred_conj_def)
apply ((wp hoare_drop_imps do_ipc_transfer_tcb_caps weak_valid_sched_action_lift
| clarsimp simp:is_cap_simps)+)[1]
apply (simp add: valid_tcb_state'_def pred_conj_def)
apply (strengthen sch_act_wf_weak)
apply (wp weak_sch_act_wf_lift_linear hoare_drop_imps)
apply (wp gts_st_tcb_at)+
apply (simp add: ep_relation_def split: list.split)
apply (simp add: pred_conj_def cong: conj_cong)
apply (wp hoare_post_taut)
apply simp
apply (wp weak_sch_act_wf_lift_linear set_ep_valid_objs' setEndpoint_valid_mdb')
apply (clarsimp simp add: invs_def valid_state_def
valid_pspace_def ep_redux_simps ep_redux_simps'
st_tcb_at_tcb_at
cong: list.case_cong)
apply (clarsimp simp: valid_ep_def)
apply (drule(1) sym_refs_obj_atD[where P="\<lambda>ob. ob = e" for e])
apply (clarsimp simp: st_tcb_at_refs_of_rev st_tcb_at_reply_cap_valid
st_tcb_at_caller_cap_null)
apply (fastforce simp: st_tcb_def2 valid_sched_def valid_sched_action_def)
subgoal by (auto simp: valid_ep'_def
split: list.split;
clarsimp simp: invs'_def valid_state'_def)
apply wp+
apply (clarsimp simp: ep_at_def2)+
done
qed
crunch typ_at'[wp]: setMessageInfo "\<lambda>s. P (typ_at' T p s)"
lemmas setMessageInfo_typ_ats[wp] = typ_at_lifts [OF setMessageInfo_typ_at']
(* Annotation added by Simon Winwood (Thu Jul 1 20:54:41 2010) using taint-mode *)
declare tl_drop_1[simp]
crunch cur[wp]: cancel_ipc "cur_tcb"
(wp: select_wp crunch_wps simp: crunch_simps)
crunch valid_objs'[wp]: asUser "valid_objs'"
lemma valid_sched_weak_strg:
"valid_sched s \<longrightarrow> weak_valid_sched_action s"
by (simp add: valid_sched_def valid_sched_action_def)
crunch weak_valid_sched_action[wp]: as_user weak_valid_sched_action
(wp: weak_valid_sched_action_lift)
lemma send_signal_corres:
"corres dc (einvs and ntfn_at ep) (invs' and ntfn_at' ep)
(send_signal ep bg) (sendSignal ep bg)"
apply (simp add: send_signal_def sendSignal_def Let_def)
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ get_ntfn_corres,
where
R = "\<lambda>rv. einvs and ntfn_at ep and valid_ntfn rv and
ko_at (Structures_A.Notification rv) ep" and
R' = "\<lambda>rv'. invs' and ntfn_at' ep and
valid_ntfn' rv' and ko_at' rv' ep"])
defer
apply (wp get_simple_ko_ko_at get_ntfn_ko')+
apply (simp add: invs_valid_objs)+
apply (case_tac "ntfn_obj ntfn")
\<comment> \<open>IdleNtfn\<close>
apply (clarsimp simp add: ntfn_relation_def)
apply (case_tac "ntfnBoundTCB nTFN")
apply clarsimp
apply (rule corres_guard_imp[OF set_ntfn_corres])
apply (clarsimp simp add: ntfn_relation_def)+
apply (rule corres_guard_imp)
apply (rule corres_split[OF _ gts_corres])
apply (rule corres_if)
apply (fastforce simp: receive_blocked_def receiveBlocked_def
thread_state_relation_def
split: Structures_A.thread_state.splits
Structures_H.thread_state.splits)
apply (rule corres_split[OF _ cancel_ipc_corres])
apply (rule corres_split[OF _ sts_corres])
apply (simp add: badgeRegister_def badge_register_def)
apply (rule corres_split[OF _ user_setreg_corres])
apply (rule possibleSwitchTo_corres)
apply wp
apply (clarsimp simp: thread_state_relation_def)
apply (wp set_thread_state_runnable_weak_valid_sched_action sts_st_tcb_at'
sts_valid_queues sts_st_tcb' hoare_disjI2
cancel_ipc_cte_wp_at_not_reply_state
| strengthen invs_vobjs_strgs invs_psp_aligned_strg valid_sched_weak_strg
| simp add: valid_tcb_state_def)+
apply (rule_tac Q="\<lambda>rv. invs' and tcb_at' a" in hoare_strengthen_post)
apply wp
apply (clarsimp simp: invs'_def valid_state'_def sch_act_wf_weak
valid_tcb_state'_def)
apply (rule set_ntfn_corres)
apply (clarsimp simp add: ntfn_relation_def)
apply (wp gts_wp gts_wp' | clarsimp)+
apply (auto simp: valid_ntfn_def receive_blocked_def valid_sched_def invs_cur
elim: pred_tcb_weakenE
intro: st_tcb_at_reply_cap_valid
split: Structures_A.thread_state.splits)[1]
apply (clarsimp simp: valid_ntfn'_def invs'_def valid_state'_def valid_pspace'_def sch_act_wf_weak)
\<comment> \<open>WaitingNtfn\<close>
apply (clarsimp simp add: ntfn_relation_def Let_def)
apply (simp add: update_waiting_ntfn_def)
apply (rename_tac list)
apply (case_tac "tl list = []")
\<comment> \<open>tl list = []\<close>
apply (rule corres_guard_imp)
apply (rule_tac F="list \<noteq> []" in corres_gen_asm)
apply (simp add: list_case_helper split del: if_split)
apply (rule corres_split [OF _ set_ntfn_corres])
apply (rule corres_split [OF _ sts_corres])
apply (simp add: badgeRegister_def badge_register_def)
apply (rule corres_split [OF _ user_setreg_corres])
apply (rule possibleSwitchTo_corres)
apply ((wp | simp)+)[1]
apply (rule_tac Q="\<lambda>_. Invariants_H.valid_queues and valid_queues' and
(\<lambda>s. sch_act_wf (ksSchedulerAction s) s) and
cur_tcb' and
st_tcb_at' runnable' (hd list) and valid_objs'"
in hoare_post_imp, clarsimp simp: pred_tcb_at' elim!: sch_act_wf_weak)
apply (wp | simp)+
apply (wp sts_st_tcb_at' set_thread_state_runnable_weak_valid_sched_action
| simp)+
apply (wp sts_st_tcb_at'_cases sts_valid_queues setThreadState_valid_queues'
setThreadState_st_tcb
| simp)+
apply (simp add: ntfn_relation_def)
apply (wp set_simple_ko_valid_objs set_ntfn_aligned' set_ntfn_valid_objs'
hoare_vcg_disj_lift weak_sch_act_wf_lift_linear
| simp add: valid_tcb_state_def valid_tcb_state'_def)+
apply (clarsimp simp: invs_def valid_state_def valid_ntfn_def
valid_pspace_def ntfn_queued_st_tcb_at valid_sched_def
valid_sched_action_def)
apply (auto simp: valid_ntfn'_def )[1]
apply (clarsimp simp: invs'_def valid_state'_def)
\<comment> \<open>tl list \<noteq> []\<close>
apply (rule corres_guard_imp)
apply (rule_tac F="list \<noteq> []" in corres_gen_asm)
apply (simp add: list_case_helper)
apply (rule corres_split [OF _ set_ntfn_corres])
apply (rule corres_split [OF _ sts_corres])
apply (simp add: badgeRegister_def badge_register_def)
apply (rule corres_split [OF _ user_setreg_corres])
apply (rule possibleSwitchTo_corres)
apply (wp cur_tcb_lift | simp)+
apply (wp sts_st_tcb_at' set_thread_state_runnable_weak_valid_sched_action
| simp)+
apply (wp sts_st_tcb_at'_cases sts_valid_queues setThreadState_valid_queues'
setThreadState_st_tcb
| simp)+
apply (simp add: ntfn_relation_def split:list.splits)
apply (wp set_ntfn_aligned' set_simple_ko_valid_objs set_ntfn_valid_objs'
hoare_vcg_disj_lift weak_sch_act_wf_lift_linear
| simp add: valid_tcb_state_def valid_tcb_state'_def)+
apply (clarsimp simp: invs_def valid_state_def valid_ntfn_def
valid_pspace_def neq_Nil_conv
ntfn_queued_st_tcb_at valid_sched_def valid_sched_action_def
split: option.splits)
apply (auto simp: valid_ntfn'_def neq_Nil_conv invs'_def valid_state'_def
weak_sch_act_wf_def
split: option.splits)[1]
\<comment> \<open>ActiveNtfn\<close>
apply (clarsimp simp add: ntfn_relation_def)
apply (rule corres_guard_imp)
apply (rule set_ntfn_corres)
apply (simp add: ntfn_relation_def combine_ntfn_badges_def
combine_ntfn_msgs_def)
apply (simp add: invs_def valid_state_def valid_ntfn_def)
apply (simp add: invs'_def valid_state'_def valid_ntfn'_def)
done
lemma valid_Running'[simp]:
"valid_tcb_state' Running = \<top>"
by (rule ext, simp add: valid_tcb_state'_def)
crunch typ'[wp]: setMRs "\<lambda>s. P (typ_at' T p s)"
(wp: crunch_wps simp: zipWithM_x_mapM)
lemma possibleSwitchTo_sch_act[wp]:
"\<lbrace>\<lambda>s. sch_act_wf (ksSchedulerAction s) s \<and> st_tcb_at' runnable' t s\<rbrace>
possibleSwitchTo t
\<lbrace>\<lambda>rv s. sch_act_wf (ksSchedulerAction s) s\<rbrace>"
apply (simp add: possibleSwitchTo_def curDomain_def bitmap_fun_defs)
apply (wp static_imp_wp threadSet_sch_act setQueue_sch_act threadGet_wp
| simp add: unless_def | wpc)+
apply (auto simp: obj_at'_def projectKOs tcb_in_cur_domain'_def)
done
lemma possibleSwitchTo_valid_queues[wp]:
"\<lbrace>Invariants_H.valid_queues and valid_objs' and (\<lambda>s. sch_act_wf (ksSchedulerAction s) s) and st_tcb_at' runnable' t\<rbrace>
possibleSwitchTo t
\<lbrace>\<lambda>rv. Invariants_H.valid_queues\<rbrace>"
apply (simp add: possibleSwitchTo_def curDomain_def bitmap_fun_defs)
apply (wp hoare_drop_imps | wpc | simp)+
apply (auto simp: valid_tcb'_def weak_sch_act_wf_def
dest: pred_tcb_at'
elim!: valid_objs_valid_tcbE)
done
lemma possibleSwitchTo_ksQ':
"\<lbrace>(\<lambda>s. t' \<notin> set (ksReadyQueues s p) \<and> sch_act_not t' s) and K(t' \<noteq> t)\<rbrace>
possibleSwitchTo t
\<lbrace>\<lambda>_ s. t' \<notin> set (ksReadyQueues s p)\<rbrace>"
apply (simp add: possibleSwitchTo_def curDomain_def bitmap_fun_defs)
apply (wp static_imp_wp rescheduleRequired_ksQ' tcbSchedEnqueue_ksQ threadGet_wp
| wpc
| simp split del: if_split)+
apply (auto simp: obj_at'_def)
done
lemma possibleSwitchTo_valid_queues'[wp]:
"\<lbrace>valid_queues' and (\<lambda>s. sch_act_wf (ksSchedulerAction s) s)
and st_tcb_at' runnable' t\<rbrace>
possibleSwitchTo t
\<lbrace>\<lambda>rv. valid_queues'\<rbrace>"
apply (simp add: possibleSwitchTo_def curDomain_def bitmap_fun_defs)
apply (wp static_imp_wp threadGet_wp | wpc | simp)+
apply (auto simp: obj_at'_def)
done
crunch st_refs_of'[wp]: possibleSwitchTo "\<lambda>s. P (state_refs_of' s)"
(wp: crunch_wps)
crunch cap_to'[wp]: possibleSwitchTo "ex_nonz_cap_to' p"
(wp: crunch_wps)
crunch objs'[wp]: possibleSwitchTo valid_objs'
(wp: crunch_wps)
crunch ct[wp]: possibleSwitchTo cur_tcb'
(wp: cur_tcb_lift crunch_wps)
lemma possibleSwitchTo_iflive[wp]:
"\<lbrace>if_live_then_nonz_cap' and ex_nonz_cap_to' t
and (\<lambda>s. sch_act_wf (ksSchedulerAction s) s)\<rbrace>
possibleSwitchTo t
\<lbrace>\<lambda>rv. if_live_then_nonz_cap'\<rbrace>"
apply (simp add: possibleSwitchTo_def curDomain_def)
apply (wp | wpc | simp)+
apply (simp only: imp_conv_disj, wp hoare_vcg_all_lift hoare_vcg_disj_lift)
apply (wp threadGet_wp)+
apply (auto simp: obj_at'_def projectKOs)
done
crunches possibleSwitchTo
for ifunsafe[wp]: if_unsafe_then_cap'
and idle'[wp]: valid_idle'
and global_refs'[wp]: valid_global_refs'
and arch_state'[wp]: valid_arch_state'
and irq_node'[wp]: "\<lambda>s. P (irq_node' s)"
and typ_at'[wp]: "\<lambda>s. P (typ_at' T p s)"
and irq_handlers'[wp]: valid_irq_handlers'
and irq_states'[wp]: valid_irq_states'
and pde_mappigns'[wp]: valid_pde_mappings'
(wp: crunch_wps simp: unless_def tcb_cte_cases_def)
crunches sendSignal
for ct'[wp]: "\<lambda>s. P (ksCurThread s)"
and it'[wp]: "\<lambda>s. P (ksIdleThread s)"
(wp: crunch_wps simp: crunch_simps o_def)
crunches sendSignal, setBoundNotification
for irqs_masked'[wp]: "irqs_masked'"
(wp: crunch_wps getObject_inv loadObject_default_inv
simp: crunch_simps unless_def o_def
rule: irqs_masked_lift)
lemma sts_running_valid_queues:
"runnable' st \<Longrightarrow> \<lbrace> Invariants_H.valid_queues \<rbrace> setThreadState st t \<lbrace>\<lambda>_. Invariants_H.valid_queues \<rbrace>"
by (wp sts_valid_queues, clarsimp)
lemma ct_in_state_activatable_imp_simple'[simp]:
"ct_in_state' activatable' s \<Longrightarrow> ct_in_state' simple' s"
apply (simp add: ct_in_state'_def)
apply (erule pred_tcb'_weakenE)
apply (case_tac st; simp)
done
lemma setThreadState_nonqueued_state_update:
"\<lbrace>\<lambda>s. invs' s \<and> st_tcb_at' simple' t s
\<and> st \<in> {Inactive, Running, Restart, IdleThreadState}
\<and> (st \<noteq> Inactive \<longrightarrow> ex_nonz_cap_to' t s)
\<and> (t = ksIdleThread s \<longrightarrow> idle' st)
\<and> (\<not> runnable' st \<longrightarrow> sch_act_simple s)
\<and> (\<not> runnable' st \<longrightarrow> (\<forall>p. t \<notin> set (ksReadyQueues s p)))\<rbrace>
setThreadState st t \<lbrace>\<lambda>rv. invs'\<rbrace>"
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre, wp valid_irq_node_lift
sts_valid_queues
setThreadState_ct_not_inQ)
apply (clarsimp simp: pred_tcb_at')
apply (rule conjI, fastforce simp: valid_tcb_state'_def)
apply (drule simple_st_tcb_at_state_refs_ofD')
apply (drule bound_tcb_at_state_refs_ofD')
apply (rule conjI, fastforce)
apply clarsimp
apply (erule delta_sym_refs)
apply (fastforce split: if_split_asm)
apply (fastforce simp: symreftype_inverse' tcb_bound_refs'_def
split: if_split_asm)
done
lemma cteDeleteOne_reply_cap_to'[wp]:
"\<lbrace>ex_nonz_cap_to' p and
cte_wp_at' (\<lambda>c. isReplyCap (cteCap c)) slot\<rbrace>
cteDeleteOne slot
\<lbrace>\<lambda>rv. ex_nonz_cap_to' p\<rbrace>"
apply (simp add: cteDeleteOne_def ex_nonz_cap_to'_def unless_def)
apply (rule hoare_seq_ext [OF _ getCTE_sp])
apply (rule hoare_assume_pre)
apply (subgoal_tac "isReplyCap (cteCap cte)")
apply (wp hoare_vcg_ex_lift emptySlot_cte_wp_cap_other isFinalCapability_inv
| clarsimp simp: finaliseCap_def isCap_simps | simp
| wp (once) hoare_drop_imps)+
apply (fastforce simp: cte_wp_at_ctes_of)
apply (clarsimp simp: cte_wp_at_ctes_of isCap_simps)
done
crunches setupCallerCap, possibleSwitchTo, asUser, doIPCTransfer
for vms'[wp]: "valid_machine_state'"
(wp: crunch_wps simp: zipWithM_x_mapM_x)
crunch nonz_cap_to'[wp]: cancelSignal "ex_nonz_cap_to' p"
(wp: crunch_wps simp: crunch_simps)
lemma cancelIPC_nonz_cap_to'[wp]:
"\<lbrace>ex_nonz_cap_to' p\<rbrace> cancelIPC t \<lbrace>\<lambda>rv. ex_nonz_cap_to' p\<rbrace>"
apply (simp add: cancelIPC_def getThreadReplySlot_def Let_def
capHasProperty_def)
apply (wp threadSet_cap_to'
| wpc
| simp
| clarsimp elim!: cte_wp_at_weakenE'
| rule hoare_post_imp[where Q="\<lambda>rv. ex_nonz_cap_to' p"])+
done
crunches activateIdleThread, getThreadReplySlot, isFinalCapability
for nosch[wp]: "\<lambda>s. P (ksSchedulerAction s)"
(ignore: setNextPC simp: Let_def)
crunches setupCallerCap, asUser, setMRs, doIPCTransfer, possibleSwitchTo
for pspace_domain_valid[wp]: "pspace_domain_valid"
(wp: crunch_wps simp: zipWithM_x_mapM_x)
crunches setupCallerCap, doIPCTransfer, possibleSwitchTo
for ksDomScheduleIdx[wp]: "\<lambda>s. P (ksDomScheduleIdx s)"
(wp: crunch_wps simp: zipWithM_x_mapM)
lemma setThreadState_not_rct[wp]:
"\<lbrace>\<lambda>s. ksSchedulerAction s \<noteq> ResumeCurrentThread \<rbrace>
setThreadState st t
\<lbrace>\<lambda>_ s. ksSchedulerAction s \<noteq> ResumeCurrentThread \<rbrace>"
apply (simp add: setThreadState_def)
apply (wp)
apply (rule hoare_post_imp [OF _ rescheduleRequired_notresume], simp)
apply (simp)
apply (wp)+
apply simp
done
lemma cancelAllIPC_not_rct[wp]:
"\<lbrace>\<lambda>s. ksSchedulerAction s \<noteq> ResumeCurrentThread \<rbrace>
cancelAllIPC epptr
\<lbrace>\<lambda>_ s. ksSchedulerAction s \<noteq> ResumeCurrentThread \<rbrace>"
apply (simp add: cancelAllIPC_def)
apply (wp | wpc)+
apply (rule hoare_post_imp [OF _ rescheduleRequired_notresume], simp)
apply simp
apply (rule mapM_x_wp_inv)
apply (wp)+
apply (rule hoare_post_imp [OF _ rescheduleRequired_notresume], simp)
apply simp
apply (rule mapM_x_wp_inv)
apply (wp)+
apply (wp hoare_vcg_all_lift hoare_drop_imp)
apply (simp_all)
done
lemma cancelAllSignals_not_rct[wp]:
"\<lbrace>\<lambda>s. ksSchedulerAction s \<noteq> ResumeCurrentThread \<rbrace>
cancelAllSignals epptr
\<lbrace>\<lambda>_ s. ksSchedulerAction s \<noteq> ResumeCurrentThread \<rbrace>"
apply (simp add: cancelAllSignals_def)
apply (wp | wpc)+
apply (rule hoare_post_imp [OF _ rescheduleRequired_notresume], simp)
apply simp
apply (rule mapM_x_wp_inv)
apply (wp)+
apply (wp hoare_vcg_all_lift hoare_drop_imp)
apply (simp_all)
done
crunch not_rct[wp]: finaliseCapTrue_standin "\<lambda>s. ksSchedulerAction s \<noteq> ResumeCurrentThread"
(simp: Let_def)
declare setEndpoint_ct' [wp]
lemma cancelIPC_ResumeCurrentThread_imp_notct[wp]:
"\<lbrace>\<lambda>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ksCurThread s \<noteq> t'\<rbrace>
cancelIPC t
\<lbrace>\<lambda>_ s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ksCurThread s \<noteq> t'\<rbrace>"
(is "\<lbrace>?PRE t'\<rbrace> _ \<lbrace>_\<rbrace>")
proof -
have aipc: "\<And>t t' ntfn.
\<lbrace>\<lambda>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ksCurThread s \<noteq> t'\<rbrace>
cancelSignal t ntfn
\<lbrace>\<lambda>_ s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ksCurThread s \<noteq> t'\<rbrace>"
apply (simp add: cancelSignal_def)
apply (wp)[1]
apply (wp hoare_convert_imp)+
apply (rule_tac P="\<lambda>s. ksSchedulerAction s \<noteq> ResumeCurrentThread"
in hoare_weaken_pre)
apply (wpc)
apply (wp | simp)+
apply (wpc, wp+)
apply (rule_tac Q="\<lambda>_. ?PRE t'" in hoare_post_imp, clarsimp)
apply (wp)
apply simp
done
have cdo: "\<And>t t' slot.
\<lbrace>\<lambda>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ksCurThread s \<noteq> t'\<rbrace>
cteDeleteOne slot
\<lbrace>\<lambda>_ s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ksCurThread s \<noteq> t'\<rbrace>"
apply (simp add: cteDeleteOne_def unless_def split_def)
apply (wp)
apply (wp hoare_convert_imp)[1]
apply (wp)
apply (rule_tac Q="\<lambda>_. ?PRE t'" in hoare_post_imp, clarsimp)
apply (wp hoare_convert_imp | simp)+
done
show ?thesis
apply (simp add: cancelIPC_def Let_def)
apply (wp, wpc)
prefer 4 \<comment> \<open>state = Running\<close>
apply wp
prefer 7 \<comment> \<open>state = Restart\<close>
apply wp
apply (wp)+
apply (wp hoare_convert_imp)[1]
apply (wpc, wp+)
apply (rule_tac Q="\<lambda>_. ?PRE t'" in hoare_post_imp, clarsimp)
apply (wp cdo)+
apply (rule_tac Q="\<lambda>_. ?PRE t'" in hoare_post_imp, clarsimp)
apply ((wp aipc hoare_convert_imp)+)[6]
apply (wp)
apply (wp hoare_convert_imp)[1]
apply (wpc, wp+)
apply (rule_tac Q="\<lambda>_. ?PRE t'" in hoare_post_imp, clarsimp)
apply (wp)
apply (rule_tac Q="\<lambda>_. ?PRE t'" in hoare_post_imp, clarsimp)
apply (wp)
apply simp
done
qed
crunch nosch[wp]: setMRs "\<lambda>s. P (ksSchedulerAction s)"
lemma sai_invs'[wp]:
"\<lbrace>invs' and ex_nonz_cap_to' ntfnptr\<rbrace>
sendSignal ntfnptr badge \<lbrace>\<lambda>y. invs'\<rbrace>"
unfolding sendSignal_def
including no_pre
apply (rule hoare_seq_ext[OF _ get_ntfn_sp'])
apply (case_tac "ntfnObj nTFN", simp_all)
prefer 3
apply (rename_tac list)
apply (case_tac list,
simp_all split del: if_split
add: setMessageInfo_def)[1]
apply (rule hoare_pre)
apply (wp hoare_convert_imp [OF asUser_nosch]
hoare_convert_imp [OF setMRs_sch_act])+
apply (clarsimp simp:conj_comms)
apply (simp add: invs'_def valid_state'_def)
apply ((wp valid_irq_node_lift sts_valid_objs' setThreadState_ct_not_inQ
sts_valid_queues [where st="Structures_H.thread_state.Running", simplified]
set_ntfn_valid_objs' cur_tcb_lift sts_st_tcb'
hoare_convert_imp [OF setNotification_nosch]
| simp split del: if_split)+)[3]
apply (intro conjI[rotated];
(solves \<open>clarsimp simp: invs'_def valid_state'_def valid_pspace'_def\<close>)?)
apply clarsimp
apply (clarsimp simp: invs'_def valid_state'_def split del: if_split)
apply (drule(1) ct_not_in_ntfnQueue, simp+)
apply clarsimp
apply (frule ko_at_valid_objs', clarsimp)
apply (simp add: projectKOs)
apply (clarsimp simp: valid_obj'_def valid_ntfn'_def
split: list.splits)
apply (clarsimp simp: invs'_def valid_state'_def)
apply (clarsimp simp: st_tcb_at_refs_of_rev' valid_idle'_def pred_tcb_at'_def
dest!: sym_refs_ko_atD' sym_refs_st_tcb_atD' sym_refs_obj_atD'
split: list.splits)
apply (clarsimp simp: invs'_def valid_state'_def valid_pspace'_def)
apply (frule(1) ko_at_valid_objs')
apply (simp add: projectKOs)
apply (clarsimp simp: valid_obj'_def valid_ntfn'_def
split: list.splits option.splits)
apply (clarsimp elim!: if_live_then_nonz_capE' simp:invs'_def valid_state'_def)
apply (drule(1) sym_refs_ko_atD')
apply (clarsimp elim!: ko_wp_at'_weakenE
intro!: refs_of_live')
apply (clarsimp split del: if_split)+
apply (frule ko_at_valid_objs', clarsimp)
apply (simp add: projectKOs)
apply (clarsimp simp: valid_obj'_def valid_ntfn'_def split del: if_split)
apply (frule invs_sym')
apply (drule(1) sym_refs_obj_atD')
apply (clarsimp split del: if_split cong: if_cong
simp: st_tcb_at_refs_of_rev' ep_redux_simps' ntfn_bound_refs'_def)
apply (frule st_tcb_at_state_refs_ofD')
apply (erule delta_sym_refs)
apply (fastforce simp: split: if_split_asm)
apply (fastforce simp: tcb_bound_refs'_def set_eq_subset symreftype_inverse'
split: if_split_asm)
apply (clarsimp simp:invs'_def)
apply (frule ko_at_valid_objs')
apply (clarsimp simp: valid_pspace'_def valid_state'_def)
apply (simp add: projectKOs)
apply (clarsimp simp: valid_obj'_def valid_ntfn'_def split del: if_split)
apply (clarsimp simp:invs'_def valid_state'_def valid_pspace'_def)
apply (frule(1) ko_at_valid_objs')
apply (simp add: projectKOs)
apply (clarsimp simp: valid_obj'_def valid_ntfn'_def
split: list.splits option.splits)
apply (case_tac "ntfnBoundTCB nTFN", simp_all)
apply (wp set_ntfn_minor_invs')
apply (fastforce simp: valid_ntfn'_def invs'_def valid_state'_def
elim!: obj_at'_weakenE
dest!: global'_no_ex_cap)
apply (wp add: hoare_convert_imp [OF asUser_nosch]
hoare_convert_imp [OF setMRs_sch_act]
setThreadState_nonqueued_state_update sts_st_tcb'
del: cancelIPC_simple)
apply (clarsimp | wp cancelIPC_ct')+
apply (wp set_ntfn_minor_invs' gts_wp' | clarsimp)+
apply (frule pred_tcb_at')
by (wp set_ntfn_minor_invs'
| rule conjI
| clarsimp elim!: st_tcb_ex_cap''
| fastforce simp: invs'_def valid_state'_def receiveBlocked_def projectKOs
valid_obj'_def valid_ntfn'_def
split: thread_state.splits
dest!: global'_no_ex_cap st_tcb_ex_cap'' ko_at_valid_objs'
| fastforce simp: receiveBlocked_def projectKOs pred_tcb_at'_def obj_at'_def
dest!: invs_rct_ct_activatable'
split: thread_state.splits)+
lemma rfk_corres:
"corres dc (tcb_at t and invs) (tcb_at' t and invs')
(reply_from_kernel t r) (replyFromKernel t r)"
apply (case_tac r)
apply (clarsimp simp: replyFromKernel_def reply_from_kernel_def
badge_register_def badgeRegister_def)
apply (rule corres_guard_imp)
apply (rule corres_split_eqr [OF _ lipcb_corres])
apply (rule corres_split [OF _ user_setreg_corres])
apply (rule corres_split_eqr [OF _ set_mrs_corres])
apply (rule set_mi_corres)
apply (wp hoare_case_option_wp hoare_valid_ipc_buffer_ptr_typ_at'
| clarsimp)+
done
lemma rfk_invs':
"\<lbrace>invs' and tcb_at' t\<rbrace> replyFromKernel t r \<lbrace>\<lambda>rv. invs'\<rbrace>"
apply (simp add: replyFromKernel_def)
apply (cases r)
apply wpsimp
done
crunch nosch[wp]: replyFromKernel "\<lambda>s. P (ksSchedulerAction s)"
lemma complete_signal_corres:
"corres dc (ntfn_at ntfnptr and tcb_at tcb and pspace_aligned and valid_objs
\<comment> \<open>and obj_at (\<lambda>ko. ko = Notification ntfn \<and> Ipc_A.isActive ntfn) ntfnptr*\<close> )
(ntfn_at' ntfnptr and tcb_at' tcb and valid_pspace' and obj_at' isActive ntfnptr)
(complete_signal ntfnptr tcb) (completeSignal ntfnptr tcb)"
apply (simp add: complete_signal_def completeSignal_def)
apply (rule corres_guard_imp)
apply (rule_tac R'="\<lambda>ntfn. ntfn_at' ntfnptr and tcb_at' tcb and valid_pspace'
and valid_ntfn' ntfn and (\<lambda>_. isActive ntfn)"
in corres_split [OF _ get_ntfn_corres])
apply (rule corres_gen_asm2)
apply (case_tac "ntfn_obj rv")
apply (clarsimp simp: ntfn_relation_def isActive_def
split: ntfn.splits Structures_H.notification.splits)+
apply (rule corres_guard2_imp)
apply (simp add: badgeRegister_def badge_register_def)
apply (rule corres_split[OF set_ntfn_corres user_setreg_corres])
apply (clarsimp simp: ntfn_relation_def)
apply (wp set_simple_ko_valid_objs get_simple_ko_wp getNotification_wp | clarsimp simp: valid_ntfn'_def)+
apply (clarsimp simp: valid_pspace'_def)
apply (frule_tac P="(\<lambda>k. k = ntfn)" in obj_at_valid_objs', assumption)
apply (clarsimp simp: projectKOs valid_obj'_def valid_ntfn'_def obj_at'_def)
done
lemma do_nbrecv_failed_transfer_corres:
"corres dc (tcb_at thread)
(tcb_at' thread)
(do_nbrecv_failed_transfer thread)
(doNBRecvFailedTransfer thread)"
unfolding do_nbrecv_failed_transfer_def doNBRecvFailedTransfer_def
by (simp add: badgeRegister_def badge_register_def, rule user_setreg_corres)
lemma receive_ipc_corres:
assumes "is_ep_cap cap" and "cap_relation cap cap'"
shows "
corres dc (einvs and valid_sched and tcb_at thread and valid_cap cap and ex_nonz_cap_to thread
and cte_wp_at (\<lambda>c. c = cap.NullCap) (thread, tcb_cnode_index 3))
(invs' and tcb_at' thread and valid_cap' cap')
(receive_ipc thread cap isBlocking) (receiveIPC thread cap' isBlocking)"
apply (insert assms)
apply (simp add: receive_ipc_def receiveIPC_def
split del: if_split)
apply (case_tac cap, simp_all add: isEndpointCap_def)
apply (rename_tac word1 word2 right)
apply clarsimp
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ get_ep_corres])
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ gbn_corres])
apply (rule_tac r'="ntfn_relation" in corres_split)
apply (rule corres_if)
apply (clarsimp simp: ntfn_relation_def Ipc_A.isActive_def Endpoint_H.isActive_def
split: Structures_A.ntfn.splits Structures_H.notification.splits)
apply clarsimp
apply (rule complete_signal_corres)
apply (rule_tac P="einvs and valid_sched and tcb_at thread and
ep_at word1 and valid_ep ep and
obj_at (\<lambda>k. k = Endpoint ep) word1
and cte_wp_at (\<lambda>c. c = cap.NullCap) (thread, tcb_cnode_index 3)
and ex_nonz_cap_to thread" and
P'="invs' and tcb_at' thread and ep_at' word1 and
valid_ep' epa"
in corres_inst)
apply (case_tac ep)
\<comment> \<open>IdleEP\<close>
apply (simp add: ep_relation_def)
apply (rule corres_guard_imp)
apply (case_tac isBlocking; simp)
apply (rule corres_split [OF _ sts_corres])
apply (rule set_ep_corres)
apply (simp add: ep_relation_def)
apply simp
apply wp+
apply (rule corres_guard_imp, rule do_nbrecv_failed_transfer_corres, simp)
apply simp
apply (clarsimp simp add: invs_def valid_state_def valid_pspace_def
valid_tcb_state_def st_tcb_at_tcb_at)
apply auto[1]
\<comment> \<open>SendEP\<close>
apply (simp add: ep_relation_def)
apply (rename_tac list)
apply (rule_tac F="list \<noteq> []" in corres_req)
apply (clarsimp simp: valid_ep_def)
apply (case_tac list, simp_all split del: if_split)[1]
apply (rule corres_guard_imp)
apply (rule corres_split [OF _ set_ep_corres])
apply (rule corres_split [OF _ gts_corres])
apply (rule_tac
F="\<exists>data.
sender_state =
Structures_A.thread_state.BlockedOnSend word1 data"
in corres_gen_asm)
apply (clarsimp simp: isSend_def case_bool_If
case_option_If if3_fold
split del: if_split cong: if_cong)
apply (rule corres_split [OF _ dit_corres])
apply (simp split del: if_split cong: if_cong)
apply (fold dc_def)[1]
apply (rule_tac P="valid_objs and valid_mdb and valid_list
and valid_sched
and cur_tcb
and valid_reply_caps
and pspace_aligned and pspace_distinct
and st_tcb_at (Not \<circ> awaiting_reply) a
and st_tcb_at (Not \<circ> halted) a
and tcb_at thread and valid_reply_masters
and cte_wp_at (\<lambda>c. c = cap.NullCap)
(thread, tcb_cnode_index 3)"
and P'="tcb_at' a and tcb_at' thread and cur_tcb'
and Invariants_H.valid_queues
and valid_queues'
and valid_pspace'
and valid_objs'
and (\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s)"
in corres_guard_imp [OF corres_if])
apply (simp add: fault_rel_optionation_def)
apply (rule corres_if2 [OF _ setup_caller_corres sts_corres])
apply simp
apply simp
apply (rule corres_split [OF _ sts_corres])
apply (rule possibleSwitchTo_corres)
apply simp
apply (wp sts_st_tcb_at' set_thread_state_runnable_weak_valid_sched_action
| simp)+
apply (wp sts_st_tcb_at'_cases sts_valid_queues setThreadState_valid_queues'
setThreadState_st_tcb
| simp)+
apply (clarsimp simp: st_tcb_at_tcb_at st_tcb_def2 valid_sched_def
valid_sched_action_def)
apply (clarsimp split: if_split_asm)
apply (clarsimp | wp do_ipc_transfer_tcb_caps)+
apply (rule_tac Q="\<lambda>_ s. sch_act_wf (ksSchedulerAction s) s"
in hoare_post_imp, erule sch_act_wf_weak)
apply (wp sts_st_tcb' gts_st_tcb_at | simp)+
apply (case_tac lista, simp_all add: ep_relation_def)[1]
apply (simp cong: list.case_cong)
apply wp
apply simp
apply (wp weak_sch_act_wf_lift_linear setEndpoint_valid_mdb' set_ep_valid_objs')
apply (clarsimp split: list.split)
apply (clarsimp simp add: invs_def valid_state_def st_tcb_at_tcb_at)
apply (clarsimp simp add: valid_ep_def valid_pspace_def)
apply (drule(1) sym_refs_obj_atD[where P="\<lambda>ko. ko = Endpoint e" for e])
apply (fastforce simp: st_tcb_at_refs_of_rev elim: st_tcb_weakenE)
apply (auto simp: valid_ep'_def invs'_def valid_state'_def split: list.split)[1]
\<comment> \<open>RecvEP\<close>
apply (simp add: ep_relation_def)
apply (rule_tac corres_guard_imp)
apply (case_tac isBlocking; simp)
apply (rule corres_split [OF _ sts_corres])
apply (rule set_ep_corres)
apply (simp add: ep_relation_def)
apply simp
apply wp+
apply (rule corres_guard_imp, rule do_nbrecv_failed_transfer_corres, simp)
apply simp
apply (clarsimp simp: valid_tcb_state_def)
apply (clarsimp simp add: valid_tcb_state'_def)
apply (rule corres_option_split[rotated 2])
apply (rule get_ntfn_corres)
apply clarsimp
apply (rule corres_trivial, simp add: ntfn_relation_def default_notification_def
default_ntfn_def)
apply (wp get_simple_ko_wp[where f=Notification] getNotification_wp gbn_wp gbn_wp'
hoare_vcg_all_lift hoare_vcg_imp_lift hoare_vcg_if_lift
| wpc | simp add: ep_at_def2[symmetric, simplified] | clarsimp)+
apply (clarsimp simp: valid_cap_def invs_psp_aligned invs_valid_objs pred_tcb_at_def
valid_obj_def valid_tcb_def valid_bound_ntfn_def
dest!: invs_valid_objs
elim!: obj_at_valid_objsE
split: option.splits)
apply (auto simp: valid_cap'_def invs_valid_pspace' valid_obj'_def valid_tcb'_def
valid_bound_ntfn'_def obj_at'_def projectKOs pred_tcb_at'_def
dest!: invs_valid_objs' obj_at_valid_objs'
split: option.splits)
done
lemma receive_signal_corres:
"\<lbrakk> is_ntfn_cap cap; cap_relation cap cap' \<rbrakk> \<Longrightarrow>
corres dc (invs and st_tcb_at active thread and valid_cap cap and ex_nonz_cap_to thread)
(invs' and tcb_at' thread and valid_cap' cap')
(receive_signal thread cap isBlocking) (receiveSignal thread cap' isBlocking)"
apply (simp add: receive_signal_def receiveSignal_def)
apply (case_tac cap, simp_all add: isEndpointCap_def)
apply (rename_tac word1 word2 rights)
apply (rule corres_guard_imp)
apply (rule_tac R="\<lambda>rv. invs and tcb_at thread and st_tcb_at active thread and
ntfn_at word1 and ex_nonz_cap_to thread and
valid_ntfn rv and
obj_at (\<lambda>k. k = Notification rv) word1" and
R'="\<lambda>rv'. invs' and tcb_at' thread and ntfn_at' word1 and
valid_ntfn' rv'"
in corres_split [OF _ get_ntfn_corres])
apply clarsimp
apply (case_tac "ntfn_obj rv")
\<comment> \<open>IdleNtfn\<close>
apply (simp add: ntfn_relation_def)
apply (rule corres_guard_imp)
apply (case_tac isBlocking; simp)
apply (rule corres_split [OF _ sts_corres])
apply (rule set_ntfn_corres)
apply (simp add: ntfn_relation_def)
apply simp
apply wp+
apply (rule corres_guard_imp, rule do_nbrecv_failed_transfer_corres, simp+)
\<comment> \<open>WaitingNtfn\<close>
apply (simp add: ntfn_relation_def)
apply (rule corres_guard_imp)
apply (case_tac isBlocking; simp)
apply (rule corres_split[OF _ sts_corres])
apply (rule set_ntfn_corres)
apply (simp add: ntfn_relation_def)
apply simp
apply wp+
apply (rule corres_guard_imp)
apply (rule do_nbrecv_failed_transfer_corres, simp+)
\<comment> \<open>ActiveNtfn\<close>
apply (simp add: ntfn_relation_def)
apply (rule corres_guard_imp)
apply (simp add: badgeRegister_def badge_register_def)
apply (rule corres_split [OF _ user_setreg_corres])
apply (rule set_ntfn_corres)
apply (simp add: ntfn_relation_def)
apply wp+
apply (fastforce simp: invs_def valid_state_def valid_pspace_def
elim!: st_tcb_weakenE)
apply (clarsimp simp: invs'_def valid_state'_def valid_pspace'_def)
apply wp+
apply (clarsimp simp add: ntfn_at_def2 valid_cap_def st_tcb_at_tcb_at)
apply (clarsimp simp add: valid_cap'_def)
done
lemma tg_sp':
"\<lbrace>P\<rbrace> threadGet f p \<lbrace>\<lambda>t. obj_at' (\<lambda>t'. f t' = t) p and P\<rbrace>"
including no_pre
apply (simp add: threadGet_def)
apply wp
apply (rule hoare_strengthen_post)
apply (rule getObject_tcb_sp)
apply clarsimp
apply (erule obj_at'_weakenE)
apply simp
done
declare lookup_cap_valid' [wp]
lemma send_fault_ipc_corres:
"valid_fault f \<Longrightarrow> fr f f' \<Longrightarrow>
corres (fr \<oplus> dc)
(einvs and st_tcb_at active thread and ex_nonz_cap_to thread)
(invs' and sch_act_not thread and tcb_at' thread)
(send_fault_ipc thread f) (sendFaultIPC thread f')"
apply (simp add: send_fault_ipc_def sendFaultIPC_def
liftE_bindE Let_def)
apply (rule corres_guard_imp)
apply (rule corres_split [where r'="\<lambda>fh fh'. fh = to_bl fh'"])
apply simp
apply (rule corres_splitEE)
prefer 2
apply (rule corres_cap_fault)
apply (rule lookup_cap_corres, rule refl)
apply (rule_tac P="einvs and st_tcb_at active thread
and valid_cap handler_cap and ex_nonz_cap_to thread"
and P'="invs' and tcb_at' thread and sch_act_not thread
and valid_cap' handlerCap"
in corres_inst)
apply (case_tac handler_cap,
simp_all add: isCap_defs lookup_failure_map_def
case_bool_If If_rearrage
split del: if_split cong: if_cong)[1]
apply (rule corres_guard_imp)
apply (rule corres_if2 [OF refl])
apply (simp add: dc_def[symmetric])
apply (rule corres_split [OF send_ipc_corres threadset_corres], simp_all)[1]
apply (simp add: tcb_relation_def fault_rel_optionation_def exst_same_def)+
apply (wp thread_set_invs_trivial thread_set_no_change_tcb_state
thread_set_typ_at ep_at_typ_at ex_nonz_cap_to_pres
thread_set_cte_wp_at_trivial thread_set_not_state_valid_sched
| simp add: tcb_cap_cases_def)+
apply ((wp threadSet_invs_trivial threadSet_tcb'
| simp add: tcb_cte_cases_def
| wp (once) sch_act_sane_lift)+)[1]
apply (rule corres_trivial, simp add: lookup_failure_map_def)
apply (clarsimp simp: st_tcb_at_tcb_at split: if_split)
apply (simp add: valid_cap_def)
apply (clarsimp simp: valid_cap'_def inQ_def)
apply auto[1]
apply (clarsimp simp: lookup_failure_map_def)
apply wp+
apply (rule threadget_corres)
apply (simp add: tcb_relation_def)
apply wp+
apply (fastforce elim: st_tcb_at_tcb_at)
apply fastforce
done
lemma gets_the_noop_corres:
assumes P: "\<And>s. P s \<Longrightarrow> f s \<noteq> None"
shows "corres dc P P' (gets_the f) (return x)"
apply (clarsimp simp: corres_underlying_def gets_the_def
return_def gets_def bind_def get_def)
apply (clarsimp simp: assert_opt_def return_def dest!: P)
done
lemma hdf_corres:
"corres dc (tcb_at thread)
(tcb_at' thread and (\<lambda>s. weak_sch_act_wf (ksSchedulerAction s) s))
(handle_double_fault thread f ft)
(handleDoubleFault thread f' ft')"
apply (simp add: handle_double_fault_def handleDoubleFault_def)
apply (rule corres_guard_imp)
apply (subst bind_return [symmetric],
rule corres_split' [OF sts_corres])
apply simp
apply (rule corres_noop2)
apply (simp add: exs_valid_def return_def)
apply (rule hoare_eq_P)
apply wp
apply (rule asUser_inv)
apply (rule getRestartPC_inv)
apply (wp no_fail_getRestartPC)+
apply (wp|simp)+
done
crunch tcb' [wp]: sendFaultIPC "tcb_at' t" (wp: crunch_wps)
crunch typ_at'[wp]: receiveIPC "\<lambda>s. P (typ_at' T p s)"
(wp: crunch_wps)
lemmas receiveIPC_typ_ats[wp] = typ_at_lifts [OF receiveIPC_typ_at']
crunch typ_at'[wp]: receiveSignal "\<lambda>s. P (typ_at' T p s)"
(wp: crunch_wps)
lemmas receiveAIPC_typ_ats[wp] = typ_at_lifts [OF receiveSignal_typ_at']
declare cart_singleton_empty[simp]
declare cart_singleton_empty2[simp]
crunch aligned'[wp]: setupCallerCap "pspace_aligned'"
(wp: crunch_wps)
crunch distinct'[wp]: setupCallerCap "pspace_distinct'"
(wp: crunch_wps)
crunch cur_tcb[wp]: setupCallerCap "cur_tcb'"
(wp: crunch_wps)
lemma setupCallerCap_state_refs_of[wp]:
"\<lbrace>\<lambda>s. P ((state_refs_of' s) (sender := {r \<in> state_refs_of' s sender. snd r = TCBBound}))\<rbrace>
setupCallerCap sender rcvr grant
\<lbrace>\<lambda>rv s. P (state_refs_of' s)\<rbrace>"
apply (simp add: setupCallerCap_def getThreadCallerSlot_def
getThreadReplySlot_def)
apply (wp hoare_drop_imps)
apply (simp add: fun_upd_def cong: if_cong)
done
crunch sch_act_wf: setupCallerCap
"\<lambda>s. sch_act_wf (ksSchedulerAction s) s"
(wp: crunch_wps ssa_sch_act sts_sch_act rule: sch_act_wf_lift)
lemma setCTE_valid_queues[wp]:
"\<lbrace>Invariants_H.valid_queues\<rbrace> setCTE ptr val \<lbrace>\<lambda>rv. Invariants_H.valid_queues\<rbrace>"
by (wp valid_queues_lift setCTE_pred_tcb_at')
crunch vq[wp]: cteInsert "Invariants_H.valid_queues"
(wp: crunch_wps)
crunch vq[wp]: getThreadCallerSlot "Invariants_H.valid_queues"
(wp: crunch_wps)
crunch vq[wp]: getThreadReplySlot "Invariants_H.valid_queues"
(wp: crunch_wps)
lemma setupCallerCap_vq[wp]:
"\<lbrace>Invariants_H.valid_queues and (\<lambda>s. \<forall>p. send \<notin> set (ksReadyQueues s p))\<rbrace>
setupCallerCap send recv grant \<lbrace>\<lambda>_. Invariants_H.valid_queues\<rbrace>"
apply (simp add: setupCallerCap_def)
apply (wp crunch_wps sts_valid_queues)
apply (fastforce simp: valid_queues_def obj_at'_def inQ_def)
done
crunch vq'[wp]: setupCallerCap "valid_queues'"
(wp: crunch_wps)
lemma is_derived_ReplyCap' [simp]:
"\<And>m p g. is_derived' m p (capability.ReplyCap t False g) =
(\<lambda>c. \<exists> g. c = capability.ReplyCap t True g)"
apply (subst fun_eq_iff)
apply clarsimp
apply (case_tac x, simp_all add: is_derived'_def isCap_simps
badge_derived'_def
vsCapRef_def)
done
lemma unique_master_reply_cap':
"\<And>c t. isReplyCap c \<and> capReplyMaster c \<and> capTCBPtr c = t \<longleftrightarrow>
(\<exists>g . c = capability.ReplyCap t True g)"
by (fastforce simp: isCap_simps conj_comms)
lemma getSlotCap_cte_wp_at:
"\<lbrace>\<top>\<rbrace> getSlotCap sl \<lbrace>\<lambda>rv. cte_wp_at' (\<lambda>c. cteCap c = rv) sl\<rbrace>"
apply (simp add: getSlotCap_def)
apply (wp getCTE_wp)
apply (clarsimp simp: cte_wp_at_ctes_of)
done
crunch no_0_obj'[wp]: setThreadState no_0_obj'
lemma setupCallerCap_vp[wp]:
"\<lbrace>valid_pspace' and tcb_at' sender and tcb_at' rcvr\<rbrace>
setupCallerCap sender rcvr grant \<lbrace>\<lambda>rv. valid_pspace'\<rbrace>"
apply (simp add: valid_pspace'_def setupCallerCap_def getThreadCallerSlot_def
getThreadReplySlot_def locateSlot_conv getSlotCap_def)
apply (wp getCTE_wp)
apply (rule_tac Q="\<lambda>_. valid_pspace' and
tcb_at' sender and tcb_at' rcvr"
in hoare_post_imp)
apply (clarsimp simp: valid_cap'_def o_def cte_wp_at_ctes_of isCap_simps
valid_pspace'_def)
apply (frule(1) ctes_of_valid', simp add: valid_cap'_def capAligned_def)
apply clarsimp
apply (wp | simp add: valid_pspace'_def valid_tcb_state'_def)+
done
declare haskell_assert_inv[wp del]
lemma setupCallerCap_iflive[wp]:
"\<lbrace>if_live_then_nonz_cap' and ex_nonz_cap_to' sender\<rbrace>
setupCallerCap sender rcvr grant
\<lbrace>\<lambda>rv. if_live_then_nonz_cap'\<rbrace>"
unfolding setupCallerCap_def getThreadCallerSlot_def
getThreadReplySlot_def locateSlot_conv
by (wp getSlotCap_cte_wp_at
| simp add: unique_master_reply_cap'
| strengthen eq_imp_strg
| wp (once) hoare_drop_imp[where f="getCTE rs" for rs])+
lemma setupCallerCap_ifunsafe[wp]:
"\<lbrace>if_unsafe_then_cap' and valid_objs' and
ex_nonz_cap_to' rcvr and tcb_at' rcvr\<rbrace>
setupCallerCap sender rcvr grant
\<lbrace>\<lambda>rv. if_unsafe_then_cap'\<rbrace>"
unfolding setupCallerCap_def getThreadCallerSlot_def
getThreadReplySlot_def locateSlot_conv
apply (wp getSlotCap_cte_wp_at
| simp add: unique_master_reply_cap' | strengthen eq_imp_strg
| wp (once) hoare_drop_imp[where f="getCTE rs" for rs])+
apply (rule_tac Q="\<lambda>rv. valid_objs' and tcb_at' rcvr and ex_nonz_cap_to' rcvr"
in hoare_post_imp)
apply (clarsimp simp: ex_nonz_tcb_cte_caps' tcbCallerSlot_def
objBits_def objBitsKO_def dom_def cte_level_bits_def)
apply (wp sts_valid_objs' | simp)+
apply (clarsimp simp: valid_tcb_state'_def)+
done
lemma setupCallerCap_global_refs'[wp]:
"\<lbrace>valid_global_refs'\<rbrace>
setupCallerCap sender rcvr grant
\<lbrace>\<lambda>rv. valid_global_refs'\<rbrace>"
unfolding setupCallerCap_def getThreadCallerSlot_def
getThreadReplySlot_def locateSlot_conv
apply (wp getSlotCap_cte_wp_at
| simp add: o_def unique_master_reply_cap'
| strengthen eq_imp_strg
| wp (once) getCTE_wp | clarsimp simp: cte_wp_at_ctes_of)+
(* at setThreadState *)
apply (rule_tac Q="\<lambda>_. valid_global_refs'" in hoare_post_imp, wpsimp+)
done
crunch valid_arch'[wp]: setupCallerCap "valid_arch_state'"
(wp: hoare_drop_imps)
crunch typ'[wp]: setupCallerCap "\<lambda>s. P (typ_at' T p s)"
crunch irq_node'[wp]: setupCallerCap "\<lambda>s. P (irq_node' s)"
(wp: hoare_drop_imps)
lemma setupCallerCap_irq_handlers'[wp]:
"\<lbrace>valid_irq_handlers'\<rbrace>
setupCallerCap sender rcvr grant
\<lbrace>\<lambda>rv. valid_irq_handlers'\<rbrace>"
unfolding setupCallerCap_def getThreadCallerSlot_def
getThreadReplySlot_def locateSlot_conv
by (wp hoare_drop_imps | simp)+
lemma cteInsert_cap_to':
"\<lbrace>ex_nonz_cap_to' p and cte_wp_at' (\<lambda>c. cteCap c = NullCap) dest\<rbrace>
cteInsert cap src dest
\<lbrace>\<lambda>rv. ex_nonz_cap_to' p\<rbrace>"
apply (simp add: cteInsert_def ex_nonz_cap_to'_def
updateCap_def setUntypedCapAsFull_def
split del: if_split)
apply (rule hoare_pre, rule hoare_vcg_ex_lift)
apply (wp updateMDB_weak_cte_wp_at
setCTE_weak_cte_wp_at
| simp
| rule hoare_drop_imps)+
apply (wp getCTE_wp)
apply clarsimp
apply (rule_tac x=cref in exI)
apply (rule conjI)
apply (clarsimp simp: cte_wp_at_ctes_of)+
done
crunch cap_to'[wp]: setExtraBadge "ex_nonz_cap_to' p"
crunch cap_to'[wp]: doIPCTransfer "ex_nonz_cap_to' p"
(ignore: transferCapsToSlots
wp: crunch_wps transferCapsToSlots_pres2 cteInsert_cap_to' hoare_vcg_const_Ball_lift
simp: zipWithM_x_mapM ball_conj_distrib)
lemma st_tcb_idle':
"\<lbrakk>valid_idle' s; st_tcb_at' P t s\<rbrakk> \<Longrightarrow>
(t = ksIdleThread s) \<longrightarrow> P IdleThreadState"
by (clarsimp simp: valid_idle'_def pred_tcb_at'_def obj_at'_def)
crunch idle'[wp]: getThreadCallerSlot "valid_idle'"
crunch idle'[wp]: getThreadReplySlot "valid_idle'"
crunch it[wp]: setupCallerCap "\<lambda>s. P (ksIdleThread s)"
(simp: updateObject_cte_inv wp: crunch_wps)
lemma setupCallerCap_idle'[wp]:
"\<lbrace>valid_idle' and valid_pspace' and
(\<lambda>s. st \<noteq> ksIdleThread s \<and> rt \<noteq> ksIdleThread s)\<rbrace>
setupCallerCap st rt gr
\<lbrace>\<lambda>_. valid_idle'\<rbrace>"
by (simp add: setupCallerCap_def capRange_def | wp hoare_drop_imps)+
crunch idle'[wp]: doIPCTransfer "valid_idle'"
(wp: crunch_wps simp: crunch_simps ignore: transferCapsToSlots)
crunch it[wp]: setExtraBadge "\<lambda>s. P (ksIdleThread s)"
crunch it[wp]: receiveIPC "\<lambda>s. P (ksIdleThread s)"
(ignore: transferCapsToSlots
wp: transferCapsToSlots_pres2 crunch_wps hoare_vcg_const_Ball_lift
simp: crunch_simps ball_conj_distrib)
crunch irq_states' [wp]: setupCallerCap valid_irq_states'
(wp: crunch_wps)
crunch pde_mappings' [wp]: setupCallerCap valid_pde_mappings'
(wp: crunch_wps)
crunch irqs_masked' [wp]: receiveIPC "irqs_masked'"
(wp: crunch_wps rule: irqs_masked_lift)
crunch ct_not_inQ[wp]: getThreadCallerSlot "ct_not_inQ"
crunch ct_not_inQ[wp]: getThreadReplySlot "ct_not_inQ"
lemma setupCallerCap_ct_not_inQ[wp]:
"\<lbrace>ct_not_inQ\<rbrace> setupCallerCap sender receiver grant \<lbrace>\<lambda>_. ct_not_inQ\<rbrace>"
apply (simp add: setupCallerCap_def)
apply (wp hoare_drop_imp setThreadState_ct_not_inQ)
done
crunch ksQ'[wp]: copyMRs "\<lambda>s. P (ksReadyQueues s)"
(wp: mapM_wp' hoare_drop_imps simp: crunch_simps)
crunch ksQ[wp]: doIPCTransfer "\<lambda>s. P (ksReadyQueues s)"
(wp: hoare_drop_imps hoare_vcg_split_case_option
mapM_wp'
simp: split_def zipWithM_x_mapM)
crunch ct'[wp]: doIPCTransfer "\<lambda>s. P (ksCurThread s)"
(wp: hoare_drop_imps hoare_vcg_split_case_option
mapM_wp'
simp: split_def zipWithM_x_mapM)
lemma asUser_ct_not_inQ[wp]:
"\<lbrace>ct_not_inQ\<rbrace> asUser t m \<lbrace>\<lambda>rv. ct_not_inQ\<rbrace>"
apply (simp add: asUser_def split_def)
apply (wp hoare_drop_imps threadSet_not_inQ | simp)+
done
crunch ct_not_inQ[wp]: copyMRs "ct_not_inQ"
(wp: mapM_wp' hoare_drop_imps simp: crunch_simps)
crunch ct_not_inQ[wp]: doIPCTransfer "ct_not_inQ"
(ignore: getRestartPC setRegister transferCapsToSlots
wp: hoare_drop_imps hoare_vcg_split_case_option
mapM_wp'
simp: split_def zipWithM_x_mapM)
lemma ntfn_q_refs_no_bound_refs': "rf : ntfn_q_refs_of' (ntfnObj ob) \<Longrightarrow> rf ~: ntfn_bound_refs' (ntfnBoundTCB ob')"
by (auto simp add: ntfn_q_refs_of'_def ntfn_bound_refs'_def
split: Structures_H.ntfn.splits)
lemma completeSignal_invs:
"\<lbrace>invs' and tcb_at' tcb\<rbrace>
completeSignal ntfnptr tcb
\<lbrace>\<lambda>_. invs'\<rbrace>"
apply (simp add: completeSignal_def)
apply (rule hoare_seq_ext[OF _ get_ntfn_sp'])
apply (rule hoare_pre)
apply (wp set_ntfn_minor_invs' | wpc | simp)+
apply (rule_tac Q="\<lambda>_ s. (state_refs_of' s ntfnptr = ntfn_bound_refs' (ntfnBoundTCB ntfn))
\<and> ntfn_at' ntfnptr s
\<and> valid_ntfn' (ntfnObj_update (\<lambda>_. Structures_H.ntfn.IdleNtfn) ntfn) s
\<and> ((\<exists>y. ntfnBoundTCB ntfn = Some y) \<longrightarrow> ex_nonz_cap_to' ntfnptr s)
\<and> ntfnptr \<noteq> ksIdleThread s"
in hoare_strengthen_post)
apply ((wp hoare_vcg_ex_lift static_imp_wp | wpc | simp add: valid_ntfn'_def)+)[1]
apply (clarsimp simp: obj_at'_def state_refs_of'_def typ_at'_def ko_wp_at'_def projectKOs split: option.splits)
apply (blast dest: ntfn_q_refs_no_bound_refs')
apply wp
apply (subgoal_tac "valid_ntfn' ntfn s")
apply (subgoal_tac "ntfnptr \<noteq> ksIdleThread s")
apply (fastforce simp: valid_ntfn'_def valid_bound_tcb'_def projectKOs ko_at_state_refs_ofD'
elim: obj_at'_weakenE
if_live_then_nonz_capD'[OF invs_iflive'
obj_at'_real_def[THEN meta_eq_to_obj_eq,
THEN iffD1]])
apply (fastforce simp: valid_idle'_def pred_tcb_at'_def obj_at'_def projectKOs
dest!: invs_valid_idle')
apply (fastforce dest: invs_valid_objs' ko_at_valid_objs'
simp: valid_obj'_def projectKOs)[1]
done
lemma setupCallerCap_urz[wp]:
"\<lbrace>untyped_ranges_zero' and valid_pspace' and tcb_at' sender\<rbrace>
setupCallerCap sender t g \<lbrace>\<lambda>rv. untyped_ranges_zero'\<rbrace>"
apply (simp add: setupCallerCap_def getSlotCap_def
getThreadCallerSlot_def getThreadReplySlot_def
locateSlot_conv)
apply (wp getCTE_wp')
apply (rule_tac Q="\<lambda>_. untyped_ranges_zero' and valid_mdb' and valid_objs'" in hoare_post_imp)
apply (clarsimp simp: cte_wp_at_ctes_of cteCaps_of_def untyped_derived_eq_def
isCap_simps)
apply (wp sts_valid_pspace_hangers)
apply (clarsimp simp: valid_tcb_state'_def)
done
lemmas threadSet_urz = untyped_ranges_zero_lift[where f="cteCaps_of", OF _ threadSet_cteCaps_of]
crunch urz[wp]: doIPCTransfer "untyped_ranges_zero'"
(ignore: threadSet wp: threadSet_urz crunch_wps simp: zipWithM_x_mapM)
crunch gsUntypedZeroRanges[wp]: receiveIPC "\<lambda>s. P (gsUntypedZeroRanges s)"
(wp: crunch_wps transferCapsToSlots_pres1 simp: zipWithM_x_mapM ignore: constOnFailure)
crunch ctes_of[wp]: possibleSwitchTo "\<lambda>s. P (ctes_of s)"
(wp: crunch_wps ignore: constOnFailure)
lemmas possibleSwitchToTo_cteCaps_of[wp]
= cteCaps_of_ctes_of_lift[OF possibleSwitchTo_ctes_of]
(* t = ksCurThread s *)
lemma ri_invs' [wp]:
"\<lbrace>invs' and sch_act_not t
and ct_in_state' simple'
and st_tcb_at' simple' t
and (\<lambda>s. \<forall>p. t \<notin> set (ksReadyQueues s p))
and ex_nonz_cap_to' t
and (\<lambda>s. \<forall>r \<in> zobj_refs' cap. ex_nonz_cap_to' r s)\<rbrace>
receiveIPC t cap isBlocking
\<lbrace>\<lambda>_. invs'\<rbrace>" (is "\<lbrace>?pre\<rbrace> _ \<lbrace>_\<rbrace>")
apply (clarsimp simp: receiveIPC_def)
apply (rule hoare_seq_ext [OF _ get_ep_sp'])
apply (rule hoare_seq_ext [OF _ gbn_sp'])
apply (rule hoare_seq_ext)
(* set up precondition for old proof *)
apply (rule_tac R="ko_at' ep (capEPPtr cap) and ?pre" in hoare_vcg_if_split)
apply (wp completeSignal_invs)
apply (case_tac ep)
\<comment> \<open>endpoint = RecvEP\<close>
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre, wpc, wp valid_irq_node_lift)
apply (simp add: valid_ep'_def)
apply (wp sts_sch_act' hoare_vcg_const_Ball_lift valid_irq_node_lift
sts_valid_queues setThreadState_ct_not_inQ
asUser_urz
| simp add: doNBRecvFailedTransfer_def cteCaps_of_def)+
apply (clarsimp simp: valid_tcb_state'_def pred_tcb_at' o_def)
apply (rule conjI, clarsimp elim!: obj_at'_weakenE)
apply (frule obj_at_valid_objs')
apply (clarsimp simp: valid_pspace'_def)
apply (drule(1) sym_refs_ko_atD')
apply (drule simple_st_tcb_at_state_refs_ofD')
apply (drule bound_tcb_at_state_refs_ofD')
apply (clarsimp simp: st_tcb_at_refs_of_rev' valid_ep'_def
valid_obj'_def projectKOs tcb_bound_refs'_def
dest!: isCapDs)
apply (rule conjI, clarsimp)
apply (drule (1) bspec)
apply (clarsimp dest!: st_tcb_at_state_refs_ofD')
apply (clarsimp simp: set_eq_subset)
apply (rule conjI, erule delta_sym_refs)
apply (clarsimp split: if_split_asm)
apply (rename_tac list one two three fur five six seven eight nine ten eleven)
apply (subgoal_tac "set list \<times> {EPRecv} \<noteq> {}")
apply (thin_tac "\<forall>a b. t \<notin> set (ksReadyQueues one (a, b))") \<comment> \<open>causes slowdown\<close>
apply (safe ; solves \<open>auto\<close>)
apply fastforce
apply fastforce
apply (clarsimp split: if_split_asm)
apply (fastforce simp: valid_pspace'_def global'_no_ex_cap idle'_not_queued)
\<comment> \<open>endpoint = IdleEP\<close>
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre, wpc, wp valid_irq_node_lift)
apply (simp add: valid_ep'_def)
apply (wp sts_sch_act' valid_irq_node_lift
sts_valid_queues setThreadState_ct_not_inQ
asUser_urz
| simp add: doNBRecvFailedTransfer_def cteCaps_of_def)+
apply (clarsimp simp: pred_tcb_at' valid_tcb_state'_def o_def)
apply (rule conjI, clarsimp elim!: obj_at'_weakenE)
apply (subgoal_tac "t \<noteq> capEPPtr cap")
apply (drule simple_st_tcb_at_state_refs_ofD')
apply (drule ko_at_state_refs_ofD')
apply (drule bound_tcb_at_state_refs_ofD')
apply (clarsimp dest!: isCapDs)
apply (rule conjI, erule delta_sym_refs)
apply (clarsimp split: if_split_asm)
apply (clarsimp simp: tcb_bound_refs'_def
dest: symreftype_inverse'
split: if_split_asm)
apply (fastforce simp: global'_no_ex_cap)
apply (clarsimp simp: obj_at'_def pred_tcb_at'_def projectKOs)
\<comment> \<open>endpoint = SendEP\<close>
apply (simp add: invs'_def valid_state'_def)
apply (rename_tac list)
apply (case_tac list, simp_all split del: if_split)
apply (rename_tac sender queue)
apply (rule hoare_pre)
apply (wp valid_irq_node_lift hoare_drop_imps setEndpoint_valid_mdb'
set_ep_valid_objs' sts_st_tcb' sts_sch_act' sts_valid_queues
setThreadState_ct_not_inQ possibleSwitchTo_valid_queues
possibleSwitchTo_valid_queues'
possibleSwitchTo_ct_not_inQ hoare_vcg_all_lift
setEndpoint_ksQ setEndpoint_ct'
| simp add: valid_tcb_state'_def case_bool_If
case_option_If
split del: if_split cong: if_cong
| wp (once) sch_act_sane_lift hoare_vcg_conj_lift hoare_vcg_all_lift
untyped_ranges_zero_lift)+
apply (clarsimp split del: if_split simp: pred_tcb_at')
apply (frule obj_at_valid_objs')
apply (clarsimp simp: valid_pspace'_def)
apply (frule(1) ct_not_in_epQueue, clarsimp, clarsimp)
apply (drule(1) sym_refs_ko_atD')
apply (drule simple_st_tcb_at_state_refs_ofD')
apply (clarsimp simp: projectKOs valid_obj'_def valid_ep'_def
st_tcb_at_refs_of_rev' conj_ac
split del: if_split
cong: if_cong)
apply (frule_tac t=sender in valid_queues_not_runnable'_not_ksQ)
apply (erule pred_tcb'_weakenE, clarsimp)
apply (subgoal_tac "sch_act_not sender s")
prefer 2
apply (clarsimp simp: pred_tcb_at'_def obj_at'_def)
apply (drule st_tcb_at_state_refs_ofD')
apply (simp only: conj_ac(1, 2)[where Q="sym_refs R" for R])
apply (subgoal_tac "distinct (ksIdleThread s # capEPPtr cap # t # sender # queue)")
apply (rule conjI)
apply (clarsimp simp: ep_redux_simps' cong: if_cong)
apply (erule delta_sym_refs)
apply (clarsimp split: if_split_asm)
apply (fastforce simp: tcb_bound_refs'_def
dest: symreftype_inverse'
split: if_split_asm)
apply (clarsimp simp: singleton_tuple_cartesian split: list.split
| rule conjI | drule(1) bspec
| drule st_tcb_at_state_refs_ofD' bound_tcb_at_state_refs_ofD'
| clarsimp elim!: if_live_state_refsE)+
apply (case_tac cap, simp_all add: isEndpointCap_def)
apply (clarsimp simp: global'_no_ex_cap)
apply (rule conjI
| clarsimp simp: singleton_tuple_cartesian split: list.split
| clarsimp elim!: if_live_state_refsE
| clarsimp simp: global'_no_ex_cap idle'_not_queued' idle'_no_refs tcb_bound_refs'_def
| drule(1) bspec | drule st_tcb_at_state_refs_ofD'
| clarsimp simp: set_eq_subset dest!: bound_tcb_at_state_refs_ofD' )+
apply (rule hoare_pre)
apply (wp getNotification_wp | wpc | clarsimp)+
done
(* t = ksCurThread s *)
lemma rai_invs'[wp]:
"\<lbrace>invs' and sch_act_not t
and st_tcb_at' simple' t
and (\<lambda>s. \<forall>p. t \<notin> set (ksReadyQueues s p))
and ex_nonz_cap_to' t
and (\<lambda>s. \<forall>r \<in> zobj_refs' cap. ex_nonz_cap_to' r s)
and (\<lambda>s. \<exists>ntfnptr. isNotificationCap cap
\<and> capNtfnPtr cap = ntfnptr
\<and> obj_at' (\<lambda>ko. ntfnBoundTCB ko = None \<or> ntfnBoundTCB ko = Some t)
ntfnptr s)\<rbrace>
receiveSignal t cap isBlocking
\<lbrace>\<lambda>_. invs'\<rbrace>"
apply (simp add: receiveSignal_def)
apply (rule hoare_seq_ext [OF _ get_ntfn_sp'])
apply (rename_tac ep)
apply (case_tac "ntfnObj ep")
\<comment> \<open>ep = IdleNtfn\<close>
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre)
apply (wp valid_irq_node_lift sts_sch_act' typ_at_lifts
sts_valid_queues setThreadState_ct_not_inQ
asUser_urz
| simp add: valid_ntfn'_def doNBRecvFailedTransfer_def | wpc)+
apply (clarsimp simp: pred_tcb_at' valid_tcb_state'_def)
apply (rule conjI, clarsimp elim!: obj_at'_weakenE)
apply (subgoal_tac "capNtfnPtr cap \<noteq> t")
apply (frule valid_pspace_valid_objs')
apply (frule (1) ko_at_valid_objs')
apply (clarsimp simp: projectKOs)
apply (clarsimp simp: valid_obj'_def valid_ntfn'_def)
apply (rule conjI, clarsimp simp: obj_at'_def split: option.split)
apply (drule simple_st_tcb_at_state_refs_ofD'
ko_at_state_refs_ofD' bound_tcb_at_state_refs_ofD')+
apply (clarsimp dest!: isCapDs)
apply (rule conjI, erule delta_sym_refs)
apply (clarsimp split: if_split_asm)
apply (fastforce simp: tcb_bound_refs'_def symreftype_inverse'
split: if_split_asm)
apply (clarsimp dest!: global'_no_ex_cap)
apply (clarsimp simp: pred_tcb_at'_def obj_at'_def projectKOs)
\<comment> \<open>ep = ActiveNtfn\<close>
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre)
apply (wp valid_irq_node_lift sts_valid_objs' typ_at_lifts static_imp_wp
asUser_urz
| simp add: valid_ntfn'_def)+
apply (clarsimp simp: pred_tcb_at' valid_pspace'_def)
apply (frule (1) ko_at_valid_objs')
apply (clarsimp simp: projectKOs)
apply (clarsimp simp: valid_obj'_def valid_ntfn'_def isCap_simps)
apply (drule simple_st_tcb_at_state_refs_ofD'
ko_at_state_refs_ofD')+
apply (erule delta_sym_refs)
apply (clarsimp split: if_split_asm simp: global'_no_ex_cap)+
\<comment> \<open>ep = WaitingNtfn\<close>
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre)
apply (wp hoare_vcg_const_Ball_lift valid_irq_node_lift sts_sch_act'
sts_valid_queues setThreadState_ct_not_inQ typ_at_lifts
asUser_urz
| simp add: valid_ntfn'_def doNBRecvFailedTransfer_def | wpc)+
apply (clarsimp simp: valid_tcb_state'_def)
apply (frule_tac t=t in not_in_ntfnQueue)
apply (simp)
apply (simp)
apply (erule pred_tcb'_weakenE, clarsimp)
apply (frule ko_at_valid_objs')
apply (clarsimp simp: valid_pspace'_def)
apply (simp add: projectKOs)
apply (clarsimp simp: valid_obj'_def)
apply (clarsimp simp: valid_ntfn'_def pred_tcb_at')
apply (rule conjI, clarsimp elim!: obj_at'_weakenE)
apply (rule conjI, clarsimp simp: obj_at'_def split: option.split)
apply (drule(1) sym_refs_ko_atD')
apply (drule simple_st_tcb_at_state_refs_ofD')
apply (drule bound_tcb_at_state_refs_ofD')
apply (clarsimp simp: st_tcb_at_refs_of_rev'
dest!: isCapDs)
apply (rule conjI, erule delta_sym_refs)
apply (clarsimp split: if_split_asm)
apply (rename_tac list one two three four five six seven eight nine)
apply (subgoal_tac "set list \<times> {NTFNSignal} \<noteq> {}")
apply safe[1]
apply (auto simp: symreftype_inverse' ntfn_bound_refs'_def tcb_bound_refs'_def)[5]
apply (fastforce simp: tcb_bound_refs'_def
split: if_split_asm)
apply (clarsimp dest!: global'_no_ex_cap)
done
lemma getCTE_cap_to_refs[wp]:
"\<lbrace>\<top>\<rbrace> getCTE p \<lbrace>\<lambda>rv s. \<forall>r\<in>zobj_refs' (cteCap rv). ex_nonz_cap_to' r s\<rbrace>"
apply (rule hoare_strengthen_post [OF getCTE_sp])
apply (clarsimp simp: ex_nonz_cap_to'_def)
apply (fastforce elim: cte_wp_at_weakenE')
done
lemma lookupCap_cap_to_refs[wp]:
"\<lbrace>\<top>\<rbrace> lookupCap t cref \<lbrace>\<lambda>rv s. \<forall>r\<in>zobj_refs' rv. ex_nonz_cap_to' r s\<rbrace>,-"
apply (simp add: lookupCap_def lookupCapAndSlot_def split_def
getSlotCap_def)
apply (wp | simp)+
done
lemma arch_stt_objs' [wp]:
"\<lbrace>valid_objs'\<rbrace> Arch.switchToThread t \<lbrace>\<lambda>rv. valid_objs'\<rbrace>"
apply (simp add: ARM_H.switchToThread_def)
apply wp
done
declare zipWithM_x_mapM [simp]
lemma cteInsert_invs_bits[wp]:
"\<lbrace>\<lambda>s. sch_act_wf (ksSchedulerAction s) s\<rbrace>
cteInsert a b c
\<lbrace>\<lambda>rv s. sch_act_wf (ksSchedulerAction s) s\<rbrace>"
"\<lbrace>Invariants_H.valid_queues\<rbrace> cteInsert a b c \<lbrace>\<lambda>rv. Invariants_H.valid_queues\<rbrace>"
"\<lbrace>cur_tcb'\<rbrace> cteInsert a b c \<lbrace>\<lambda>rv. cur_tcb'\<rbrace>"
"\<lbrace>\<lambda>s. P (state_refs_of' s)\<rbrace>
cteInsert a b c
\<lbrace>\<lambda>rv s. P (state_refs_of' s)\<rbrace>"
apply (wp sch_act_wf_lift valid_queues_lift
cur_tcb_lift tcb_in_cur_domain'_lift)+
done
lemma possibleSwitchTo_sch_act_not:
"\<lbrace>sch_act_not t' and K (t \<noteq> t')\<rbrace> possibleSwitchTo t \<lbrace>\<lambda>rv. sch_act_not t'\<rbrace>"
apply (simp add: possibleSwitchTo_def setSchedulerAction_def curDomain_def)
apply (wp hoare_drop_imps | wpc | simp)+
done
crunch vms'[wp]: possibleSwitchTo valid_machine_state'
crunch pspace_domain_valid[wp]: possibleSwitchTo pspace_domain_valid
crunch ct_idle_or_in_cur_domain'[wp]: possibleSwitchTo ct_idle_or_in_cur_domain'
crunch ct'[wp]: possibleSwitchTo "\<lambda>s. P (ksCurThread s)"
crunch it[wp]: possibleSwitchTo "\<lambda>s. P (ksIdleThread s)"
crunch irqs_masked'[wp]: possibleSwitchTo "irqs_masked'"
crunch urz[wp]: possibleSwitchTo "untyped_ranges_zero'"
(simp: crunch_simps unless_def wp: crunch_wps)
lemma si_invs'[wp]:
"\<lbrace>invs' and st_tcb_at' simple' t
and (\<lambda>s. \<forall>p. t \<notin> set (ksReadyQueues s p))
and sch_act_not t
and ex_nonz_cap_to' ep and ex_nonz_cap_to' t\<rbrace>
sendIPC bl call ba cg cgr t ep
\<lbrace>\<lambda>rv. invs'\<rbrace>"
supply if_split[split del]
apply (simp add: sendIPC_def split del: if_split)
apply (rule hoare_seq_ext [OF _ get_ep_sp'])
apply (case_tac epa)
\<comment> \<open>epa = RecvEP\<close>
apply simp
apply (rename_tac list)
apply (case_tac list)
apply simp
apply (simp split del: if_split add: invs'_def valid_state'_def)
apply (rule hoare_pre)
apply (rule_tac P="a\<noteq>t" in hoare_gen_asm)
apply (wp valid_irq_node_lift
sts_valid_objs' set_ep_valid_objs' setEndpoint_valid_mdb' sts_st_tcb' sts_sch_act'
possibleSwitchTo_sch_act_not sts_valid_queues setThreadState_ct_not_inQ
possibleSwitchTo_ksQ' possibleSwitchTo_ct_not_inQ hoare_vcg_all_lift sts_ksQ'
hoare_convert_imp [OF doIPCTransfer_sch_act doIPCTransfer_ct']
hoare_convert_imp [OF setEndpoint_nosch setEndpoint_ct']
hoare_drop_imp [where f="threadGet tcbFault t"]
| rule_tac f="getThreadState a" in hoare_drop_imp
| wp (once) hoare_drop_imp[where R="\<lambda>_ _. call"]
hoare_drop_imp[where R="\<lambda>_ _. \<not> call"]
hoare_drop_imp[where R="\<lambda>_ _. cg"]
| simp add: valid_tcb_state'_def case_bool_If
case_option_If
cong: if_cong
split del: if_split
| wp (once) sch_act_sane_lift tcb_in_cur_domain'_lift hoare_vcg_const_imp_lift)+
apply (clarsimp simp: pred_tcb_at' cong: conj_cong imp_cong
split del: if_split)
apply (frule obj_at_valid_objs', clarsimp)
apply (frule(1) sym_refs_ko_atD')
apply (clarsimp simp: projectKOs valid_obj'_def valid_ep'_def
st_tcb_at_refs_of_rev' pred_tcb_at'
conj_comms fun_upd_def[symmetric]
split del: if_split)
apply (frule pred_tcb_at')
apply (drule simple_st_tcb_at_state_refs_ofD' st_tcb_at_state_refs_ofD')+
apply (clarsimp simp: valid_pspace'_splits)
apply (subst fun_upd_idem[where x=t])
apply (clarsimp split: if_split)
apply (rule conjI, clarsimp simp: obj_at'_def projectKOs)
apply (drule bound_tcb_at_state_refs_ofD')
apply (fastforce simp: tcb_bound_refs'_def)
apply (subgoal_tac "ex_nonz_cap_to' a s")
prefer 2
apply (clarsimp elim!: if_live_state_refsE)
apply clarsimp
apply (rule conjI)
apply (drule bound_tcb_at_state_refs_ofD')
apply (fastforce simp: tcb_bound_refs'_def set_eq_subset)
apply (clarsimp simp: conj_ac)
apply (rule conjI, clarsimp simp: idle'_no_refs)
apply (rule conjI, clarsimp simp: global'_no_ex_cap)
apply (rule conjI)
apply (rule impI)
apply (frule(1) ct_not_in_epQueue, clarsimp, clarsimp)
apply (clarsimp)
apply (simp add: ep_redux_simps')
apply (rule conjI, clarsimp split: if_split)
apply (rule conjI, fastforce simp: tcb_bound_refs'_def set_eq_subset)
apply (clarsimp, erule delta_sym_refs;
solves\<open>auto simp: symreftype_inverse' tcb_bound_refs'_def split: if_split_asm\<close>)
apply (solves\<open>clarsimp split: list.splits\<close>)
\<comment> \<open>epa = IdleEP\<close>
apply (cases bl)
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre, wp valid_irq_node_lift)
apply (simp add: valid_ep'_def)
apply (wp valid_irq_node_lift sts_sch_act' sts_valid_queues
setThreadState_ct_not_inQ)
apply (clarsimp simp: valid_tcb_state'_def pred_tcb_at')
apply (rule conjI, clarsimp elim!: obj_at'_weakenE)
apply (subgoal_tac "ep \<noteq> t")
apply (drule simple_st_tcb_at_state_refs_ofD' ko_at_state_refs_ofD'
bound_tcb_at_state_refs_ofD')+
apply (rule conjI, erule delta_sym_refs)
apply (auto simp: tcb_bound_refs'_def symreftype_inverse'
split: if_split_asm)[2]
apply (fastforce simp: global'_no_ex_cap)
apply (clarsimp simp: pred_tcb_at'_def obj_at'_def projectKOs)
apply simp
apply wp
apply simp
\<comment> \<open>epa = SendEP\<close>
apply (cases bl)
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre, wp valid_irq_node_lift)
apply (simp add: valid_ep'_def)
apply (wp hoare_vcg_const_Ball_lift valid_irq_node_lift sts_sch_act'
sts_valid_queues setThreadState_ct_not_inQ)
apply (clarsimp simp: valid_tcb_state'_def pred_tcb_at')
apply (rule conjI, clarsimp elim!: obj_at'_weakenE)
apply (frule obj_at_valid_objs', clarsimp)
apply (frule(1) sym_refs_ko_atD')
apply (frule pred_tcb_at')
apply (drule simple_st_tcb_at_state_refs_ofD')
apply (drule bound_tcb_at_state_refs_ofD')
apply (clarsimp simp: valid_obj'_def valid_ep'_def
projectKOs st_tcb_at_refs_of_rev')
apply (rule conjI, clarsimp)
apply (drule (1) bspec)
apply (clarsimp dest!: st_tcb_at_state_refs_ofD' bound_tcb_at_state_refs_ofD'
simp: tcb_bound_refs'_def)
apply (clarsimp simp: set_eq_subset)
apply (rule conjI, erule delta_sym_refs)
subgoal by (fastforce simp: obj_at'_def projectKOs symreftype_inverse'
split: if_split_asm)
apply (fastforce simp: tcb_bound_refs'_def symreftype_inverse'
split: if_split_asm)
apply (fastforce simp: global'_no_ex_cap idle'_not_queued)
apply (simp | wp)+
done
lemma sfi_invs_plus':
"\<lbrace>invs' and st_tcb_at' simple' t
and sch_act_not t
and (\<lambda>s. \<forall>p. t \<notin> set (ksReadyQueues s p))
and ex_nonz_cap_to' t\<rbrace>
sendFaultIPC t f
\<lbrace>\<lambda>rv. invs'\<rbrace>, \<lbrace>\<lambda>rv. invs' and st_tcb_at' simple' t
and (\<lambda>s. \<forall>p. t \<notin> set (ksReadyQueues s p))
and sch_act_not t and (\<lambda>s. ksIdleThread s \<noteq> t)\<rbrace>"
apply (simp add: sendFaultIPC_def)
apply (wp threadSet_invs_trivial threadSet_pred_tcb_no_state
threadSet_cap_to'
| wpc | simp)+
apply (rule_tac Q'="\<lambda>rv s. invs' s \<and> sch_act_not t s
\<and> st_tcb_at' simple' t s
\<and> (\<forall>p. t \<notin> set (ksReadyQueues s p))
\<and> ex_nonz_cap_to' t s
\<and> t \<noteq> ksIdleThread s
\<and> (\<forall>r\<in>zobj_refs' rv. ex_nonz_cap_to' r s)"
in hoare_post_imp_R)
apply wp
apply (clarsimp simp: inQ_def pred_tcb_at')
apply (wp | simp)+
apply (clarsimp simp: eq_commute)
apply (subst(asm) global'_no_ex_cap, auto)
done
lemma hf_corres:
"fr f f' \<Longrightarrow>
corres dc (einvs and st_tcb_at active thread and ex_nonz_cap_to thread
and (%_. valid_fault f))
(invs' and sch_act_not thread
and (\<lambda>s. \<forall>p. thread \<notin> set(ksReadyQueues s p))
and st_tcb_at' simple' thread and ex_nonz_cap_to' thread)
(handle_fault thread f) (handleFault thread f')"
apply (simp add: handle_fault_def handleFault_def)
apply (rule corres_guard_imp)
apply (subst return_bind [symmetric],
rule corres_split [where P="tcb_at thread",
OF _ gets_the_noop_corres [where x="()"]])
apply (rule corres_split_catch)
apply (rule hdf_corres)
apply (rule_tac F="valid_fault f" in corres_gen_asm)
apply (rule send_fault_ipc_corres, assumption)
apply simp
apply wp+
apply (rule hoare_post_impErr, rule sfi_invs_plus', simp_all)[1]
apply clarsimp
apply (simp add: tcb_at_def)
apply wp+
apply (clarsimp simp: st_tcb_at_tcb_at st_tcb_def2 invs_def
valid_state_def valid_idle_def)
apply auto
done
lemma sts_invs_minor'':
"\<lbrace>st_tcb_at' (\<lambda>st'. tcb_st_refs_of' st' = tcb_st_refs_of' st
\<and> (st \<noteq> Inactive \<and> \<not> idle' st \<longrightarrow>
st' \<noteq> Inactive \<and> \<not> idle' st')) t
and (\<lambda>s. t = ksIdleThread s \<longrightarrow> idle' st)
and (\<lambda>s. (\<exists>p. t \<in> set (ksReadyQueues s p)) \<longrightarrow> runnable' st)
and (\<lambda>s. runnable' st \<and> obj_at' tcbQueued t s
\<longrightarrow> st_tcb_at' runnable' t s)
and (\<lambda>s. \<not> runnable' st \<longrightarrow> sch_act_not t s)
and invs'\<rbrace>
setThreadState st t
\<lbrace>\<lambda>rv. invs'\<rbrace>"
apply (simp add: invs'_def valid_state'_def)
apply (rule hoare_pre)
apply (wp valid_irq_node_lift sts_sch_act' sts_valid_queues
setThreadState_ct_not_inQ)
apply clarsimp
apply (rule conjI)
apply fastforce
apply (rule conjI)
apply (clarsimp simp: pred_tcb_at'_def)
apply (drule obj_at_valid_objs')
apply (clarsimp simp: valid_pspace'_def)
apply (clarsimp simp: valid_obj'_def valid_tcb'_def projectKOs)
subgoal by (cases st, auto simp: valid_tcb_state'_def
split: Structures_H.thread_state.splits)[1]
apply (rule conjI)
apply (clarsimp dest!: st_tcb_at_state_refs_ofD'
elim!: rsubst[where P=sym_refs]
intro!: ext)
apply (clarsimp elim!: st_tcb_ex_cap'')
done
lemma hf_invs' [wp]:
"\<lbrace>invs' and sch_act_not t
and (\<lambda>s. \<forall>p. t \<notin> set(ksReadyQueues s p))
and st_tcb_at' simple' t
and ex_nonz_cap_to' t and (\<lambda>s. t \<noteq> ksIdleThread s)\<rbrace>
handleFault t f \<lbrace>\<lambda>r. invs'\<rbrace>"
apply (simp add: handleFault_def)
apply wp
apply (simp add: handleDoubleFault_def)
apply (wp sts_invs_minor'' dmo_invs')+
apply (rule hoare_post_impErr, rule sfi_invs_plus',
simp_all)
apply (strengthen no_refs_simple_strg')
apply clarsimp
done
declare zipWithM_x_mapM [simp del]
lemma gts_st_tcb':
"\<lbrace>\<top>\<rbrace> getThreadState t \<lbrace>\<lambda>r. st_tcb_at' (\<lambda>st. st = r) t\<rbrace>"
apply (rule hoare_strengthen_post)
apply (rule gts_sp')
apply simp
done
declare setEndpoint_ct' [wp]
lemma setupCallerCap_pred_tcb_unchanged:
"\<lbrace>pred_tcb_at' proj P t and K (t \<noteq> t')\<rbrace>
setupCallerCap t' t'' g
\<lbrace>\<lambda>rv. pred_tcb_at' proj P t\<rbrace>"
apply (simp add: setupCallerCap_def getThreadCallerSlot_def
getThreadReplySlot_def)
apply (wp sts_pred_tcb_neq' hoare_drop_imps)
apply clarsimp
done
lemma si_blk_makes_simple':
"\<lbrace>st_tcb_at' simple' t and K (t \<noteq> t')\<rbrace>
sendIPC True call bdg x x' t' ep
\<lbrace>\<lambda>rv. st_tcb_at' simple' t\<rbrace>"
apply (simp add: sendIPC_def)
apply (rule hoare_seq_ext [OF _ get_ep_inv'])
apply (case_tac xa, simp_all)
apply (rename_tac list)
apply (case_tac list, simp_all add: case_bool_If case_option_If
split del: if_split cong: if_cong)
apply (rule hoare_pre)
apply (wp sts_st_tcb_at'_cases setupCallerCap_pred_tcb_unchanged
hoare_drop_imps)
apply (clarsimp simp: pred_tcb_at' del: disjCI)
apply (wp sts_st_tcb_at'_cases)
apply clarsimp
apply (wp sts_st_tcb_at'_cases)
apply clarsimp
done
lemma si_blk_makes_runnable':
"\<lbrace>st_tcb_at' runnable' t and K (t \<noteq> t')\<rbrace>
sendIPC True call bdg x x' t' ep
\<lbrace>\<lambda>rv. st_tcb_at' runnable' t\<rbrace>"
apply (simp add: sendIPC_def)
apply (rule hoare_seq_ext [OF _ get_ep_inv'])
apply (case_tac xa, simp_all)
apply (rename_tac list)
apply (case_tac list, simp_all add: case_bool_If case_option_If
split del: if_split cong: if_cong)
apply (rule hoare_pre)
apply (wp sts_st_tcb_at'_cases setupCallerCap_pred_tcb_unchanged
hoare_vcg_const_imp_lift hoare_drop_imps
| simp)+
apply (clarsimp del: disjCI simp: pred_tcb_at' elim!: pred_tcb'_weakenE)
apply (wp sts_st_tcb_at'_cases)
apply clarsimp
apply (wp sts_st_tcb_at'_cases)
apply clarsimp
done
crunches possibleSwitchTo, completeSignal
for pred_tcb_at'[wp]: "pred_tcb_at' proj P t"
lemma sendSignal_st_tcb'_Running:
"\<lbrace>st_tcb_at' (\<lambda>st. st = Running \<or> P st) t\<rbrace>
sendSignal ntfnptr bdg
\<lbrace>\<lambda>_. st_tcb_at' (\<lambda>st. st = Running \<or> P st) t\<rbrace>"
apply (simp add: sendSignal_def)
apply (wp sts_st_tcb_at'_cases cancelIPC_st_tcb_at' gts_wp' getNotification_wp static_imp_wp
| wpc | clarsimp simp: pred_tcb_at')+
done
end
end
|
import algebra.big_operators.ring
import data.real.basic
@[ext] structure point := (x : ℝ) (y : ℝ) (z : ℝ)
#check point.ext
example (a b : point) (hx : a.x = b.x) (hy : a.y = b.y) (hz : a.z = b.z) :
a = b :=
begin
ext,
assumption',
end
def my_point1 : point :=
{ x := 2,
y := -1,
z := 4 }
def my_point2 :=
{ point .
x := 2,
y := -1,
z := 4 }
def my_point3 : point := ⟨2, -1, 4⟩
def my_point4 := point.mk 2 (-1) 4
structure point' := build :: (x : ℝ) (y : ℝ) (z : ℝ)
#check point'.build 2 (-1) 4
namespace point
def add (a b : point) : point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩
protected theorem add_comm (a b : point) : add a b = add b a :=
begin
rw [add, add],
ext; dsimp,
repeat { apply add_comm },
end
theorem add_x (a b : point) : (a.add b).x = a.x + b.x := rfl
def add_alt : point → point → point
| ⟨x₁, y₁, z₁⟩ ⟨x₂, y₂, z₂⟩ := ⟨x₁ + x₂, y₁ + y₂, z₁ + z₂⟩
theorem add_alt_comm (a b : point) : add_alt a b = add_alt b a :=
begin
rcases a with ⟨xa, ya, za⟩,
rcases b with ⟨xb, yb, zb⟩,
simp [add_alt, add_comm],
end
protected theorem add_assoc (a b c : point) :
(a.add b).add c = a.add (b.add c) :=
by { simp [add, add_assoc]}
def smul (r : ℝ) (a : point) : point :=
⟨r * a.x, r * a.y, r * a.z⟩
theorem smul_distrib (r : ℝ) (a b : point) :
(smul r a).add (smul r b) = smul r (a.add b) :=
by { simp [add, smul, mul_add],}
end point
structure standard_two_simplex :=
(x y z: ℝ)
(x_nonneg : 0 ≤ x)
(y_nonneg : 0 ≤ y)
(z_nonneg : 0 ≤ z)
(sum_eq : x + y + z = 1)
namespace standard_two_simplex
def swap_xy (a : standard_two_simplex) : standard_two_simplex :=
{
x := a.y,
y := a.x,
z := a.z,
x_nonneg := a.y_nonneg,
y_nonneg := a.x_nonneg,
z_nonneg := a.z_nonneg,
sum_eq := by rw [add_comm a.y a.x, a.sum_eq],
}
noncomputable theory
def midpoint (a b : standard_two_simplex) : standard_two_simplex :=
{
x := (a.x + b.x) / 2,
y := (a.y + b.y) / 2,
z := (a.z + b.z) / 2,
x_nonneg := div_nonneg (add_nonneg a.x_nonneg b.x_nonneg) (by norm_num),
y_nonneg := div_nonneg (add_nonneg a.y_nonneg b.y_nonneg) (by norm_num),
z_nonneg := div_nonneg (add_nonneg a.z_nonneg b.z_nonneg) (by norm_num),
sum_eq := by { field_simp, linarith [a.sum_eq, b.sum_eq]}
}
def weighted_average (lambda : real)
(lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1)
(a b : standard_two_simplex) :
standard_two_simplex :=
{
x := lambda * a.x + (1 - lambda) * b.x,
y := lambda * a.y + (1 - lambda) * b.y,
z := lambda * a.z + (1 - lambda) * b.z,
x_nonneg := by { apply add_nonneg, all_goals { apply mul_nonneg}, assumption,
from a.x_nonneg, linarith [lambda_le], from b.x_nonneg },
y_nonneg := by { apply add_nonneg, all_goals { apply mul_nonneg}, assumption,
from a.y_nonneg, linarith [lambda_le], from b.y_nonneg },
z_nonneg := by { apply add_nonneg, all_goals { apply mul_nonneg}, assumption,
from a.z_nonneg, linarith [lambda_le], from b.z_nonneg },
sum_eq :=
begin
transitivity (a.x + a.y + a.z) * lambda + (b.x + b.y + b.z) * (1 - lambda),
{ ring },
simp [a.sum_eq, b.sum_eq]
end
}
end standard_two_simplex
open_locale big_operators
structure standard_simplex (n : ℕ) :=
(v : fin n → ℝ)
(nonneg : ∀ i : fin n, 0 ≤ v i)
(sum_eq_one : ∑ i, v i = 1)
namespace standard_simplex
def midpoint (n : ℕ) (a b : standard_simplex n) : standard_simplex n :=
{ v := λ i, (a.v i + b.v i) / 2,
nonneg :=
begin
intro i,
apply div_nonneg,
{ linarith [a.nonneg i, b.nonneg i] },
norm_num
end,
sum_eq_one :=
begin
simp [div_eq_mul_inv, ←finset.sum_mul, finset.sum_add_distrib,
a.sum_eq_one, b.sum_eq_one],
field_simp
end }
end standard_simplex
structure is_linear (f : ℝ → ℝ) :=
(is_additive : ∀ x y, f (x + y) = f x + f y)
(preserves_mul : ∀ x c, f (c * x) = c * f x)
section
variables (f : ℝ → ℝ) (linf : is_linear f)
#check linf.is_additive
#check linf.preserves_mul
end
def preal := { y : ℝ | 0 < y}
section
variable x : preal
#check x.val
#check x.property
end
def standard_two_simplex' :=
{ p : ℝ × ℝ × ℝ // 0 ≤ p.1 ∧ 0 ≤ p.2.1 ∧ 0 ≤ p.2.2 ∧ p.1 + p.2.1 + p.2.2 = 1 }
def standard_simplex' (n : ℕ) :=
{ v : fin n → ℝ // (∀ i : fin n, 0 ≤ v i) ∧ (∑ i, v i = 1) }
def std_simplex := Σ n : ℕ, standard_simplex n
section
variable s : std_simplex
#check s.fst
#check s.snd
#check s.1
#check s.2
end |
# Julia docs: https://docs.julialang.org/en/latest/manual/variables-and-scoping/
x = 42
function f()
y = x + 3 # equivalent to `local y = x + 3`
@show y
end
f()
y
# x is global whereas y is local (to the function f)
# we can create a global variables from a local scope
# but we must be explicit about it.
function g()
global y = x + 3
@show y
end
g()
y
# we ALWAYS need to be explicit when writing to globals from a local scope:
function h()
x = x + 3
@show x
end
h()
function h2()
global x = x + 3
@show x
end
h2()
# This fact can lead to subtle somewhat unintuitive errors:
a = 0
for i in 1:10
a += 1
end
# Note that if we do not use global scope, everything is simple and intuitive:
function k()
a = 0
for i in 1:10
a += 1
end
a
end
k()
# Variables are inherited from non-global scope
function nested()
function inner()
# Try with and without "local"
j = 2
k = j + 1
end
j = 0
k = 0
return inner(), j, k
end
nested()
function inner()
j = 2 # Try with and without "local"
k = j + 1
end
function nested()
j = 0
k = 0
return inner(), j, k
end
nested()
|
[GOAL]
G : Type u_1
inst✝⁴ : Group G
A : Type u_2
inst✝³ : AddGroup A
H✝ : Type u_3
inst✝² : Group H✝
inst✝¹ : IsSimpleGroup G
inst✝ : Nontrivial H✝
f : G →* H✝
hf : Function.Surjective ↑f
H : Subgroup H✝
iH : Normal H
⊢ H = ⊥ ∨ H = ⊤
[PROOFSTEP]
refine' (iH.comap f).eq_bot_or_eq_top.imp (fun h => _) fun h => _
[GOAL]
case refine'_1
G : Type u_1
inst✝⁴ : Group G
A : Type u_2
inst✝³ : AddGroup A
H✝ : Type u_3
inst✝² : Group H✝
inst✝¹ : IsSimpleGroup G
inst✝ : Nontrivial H✝
f : G →* H✝
hf : Function.Surjective ↑f
H : Subgroup H✝
iH : Normal H
h : comap f H = ⊥
⊢ H = ⊥
[PROOFSTEP]
rw [← map_bot f, ← h, map_comap_eq_self_of_surjective hf]
[GOAL]
case refine'_2
G : Type u_1
inst✝⁴ : Group G
A : Type u_2
inst✝³ : AddGroup A
H✝ : Type u_3
inst✝² : Group H✝
inst✝¹ : IsSimpleGroup G
inst✝ : Nontrivial H✝
f : G →* H✝
hf : Function.Surjective ↑f
H : Subgroup H✝
iH : Normal H
h : comap f H = ⊤
⊢ H = ⊤
[PROOFSTEP]
rw [← comap_top f] at h
[GOAL]
case refine'_2
G : Type u_1
inst✝⁴ : Group G
A : Type u_2
inst✝³ : AddGroup A
H✝ : Type u_3
inst✝² : Group H✝
inst✝¹ : IsSimpleGroup G
inst✝ : Nontrivial H✝
f : G →* H✝
hf : Function.Surjective ↑f
H : Subgroup H✝
iH : Normal H
h : comap f H = comap f ⊤
⊢ H = ⊤
[PROOFSTEP]
exact comap_injective hf h
|
theory IMPExpressions
imports Main
begin
type_synonym vname = string
datatype aexp = N int | V vname | Plus aexp aexp
type_synonym val = int
type_synonym state = "vname \<Rightarrow> val"
fun aval :: "aexp \<Rightarrow> state \<Rightarrow> val" where
"aval (N n) s = n" |
"aval (V x) s = s x" |
"aval (Plus a1 a2) s = aval a1 s + aval a2 s"
definition exp :: "aexp" where "exp = (Plus (N 5) (V ''x''))"
value "aval exp ((\<lambda> x. 0)(''x'' := 1))"
fun asimp_const :: "aexp \<Rightarrow> aexp" where
"asimp_const (N n) = N n" |
"asimp_const (V x) = V x" |
"asimp_const (Plus a1 a2) =
(case (asimp_const a1, asimp_const a2) of
(N n1, N n2) \<Rightarrow> N(n1 + n2) |
(b1, b2) \<Rightarrow> Plus b1 b2)"
lemma "aval (asimp_const a) s = aval a s"
apply(induction a)
apply(auto split: aexp.split)
done
fun plus :: "aexp \<Rightarrow> aexp \<Rightarrow> aexp" where
"plus (N i1) (N i2) = N(i1 + i2)" |
"plus (N i) a = (if i=0 then a else Plus (N i) a)" |
"plus a (N i) = (if i=0 then a else Plus a (N i))" |
"plus a1 a2 = Plus a1 a2"
lemma aval_plus: "aval (plus a1 a2) s = aval a1 s + aval a2 s"
apply(induction rule: plus.induct)
apply(auto)
done
fun asimp :: "aexp \<Rightarrow> aexp" where
"asimp (N n) = N n" |
"asimp (V x) = V x" |
"asimp (Plus a1 a2) = plus (asimp a1) (asimp a2)"
lemma "aval (asimp a) s = aval a s"
apply(induction a)
apply(auto simp add: aval_plus)
done
fun optimal_plus :: "aexp \<Rightarrow> aexp \<Rightarrow> bool" where
"optimal_plus (N _) (N _) = False" |
"optimal_plus a1 a2 = True"
fun optimal :: "aexp \<Rightarrow> bool" where
"optimal (N _) = True" |
"optimal (V _) = True" |
"optimal (Plus a1 a2) = ((optimal a1) \<and> (optimal a2) \<and> (optimal_plus a1 a2))"
theorem "optimal(asimp_const a)"
apply(induction a)
apply(auto split: aexp.split)
done
fun full_plus :: "aexp \<Rightarrow> aexp \<Rightarrow> aexp" where
"full_plus (N n1) (N n2) = N (n1 + n2)" |
"full_plus (N n1) (Plus a (N n2)) = (Plus a (N (n1 + n2)))" |
"full_plus (Plus a (N n1)) (N n2) = (Plus a (N (n1 + n2)))" |
"full_plus a1 a2 = (Plus a1 a2)"
lemma full_plus_aval: "aval (full_plus a1 a2) s = aval a1 s + aval a2 s"
apply(induction rule: full_plus.induct)
apply(auto)
done
fun full_asimp :: "aexp \<Rightarrow> aexp" where
"full_asimp (N n) = N n" |
"full_asimp (V x) = V x" |
"full_asimp (Plus a1 a2) = full_plus (full_asimp a1) (full_asimp a2)"
value "full_asimp (Plus (N 1) (Plus (V ''x'') (N 2)))"
theorem "aval (full_asimp a) s = aval a s"
apply(induction a arbitrary: s)
apply(auto simp add: full_plus_aval)
done
fun subst :: "vname \<Rightarrow> aexp \<Rightarrow> aexp \<Rightarrow> aexp" where
"subst v e (V x) = (if v = x then e else (V x))" |
"subst v e (Plus a1 a2) = (Plus (subst v e a1) (subst v e a2))" |
"subst v e a = a"
value "subst ''x'' (N 2) (Plus (V ''x'') (N 1))"
lemma subst_preserves_semantics: "aval (subst x a e) s = aval e (s(x := aval a s))"
apply(induction e)
apply(auto)
done
theorem "aval a1 s = aval a2 s \<Longrightarrow> aval (subst x a1 e) s = aval (subst x a2 e) s"
apply(simp add: subst_preserves_semantics)
done
end |
/-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Yury Kudryashov
-/
import data.finsupp.basic
import data.multiset.antidiagonal
/-!
# The `finsupp` counterpart of `multiset.antidiagonal`.
The antidiagonal of `s : α →₀ ℕ` consists of
all pairs `(t₁, t₂) : (α →₀ ℕ) × (α →₀ ℕ)` such that `t₁ + t₂ = s`.
-/
noncomputable theory
open_locale classical big_operators
namespace finsupp
open finset
variables {α : Type*}
/-- The `finsupp` counterpart of `multiset.antidiagonal`: the antidiagonal of
`s : α →₀ ℕ` consists of all pairs `(t₁, t₂) : (α →₀ ℕ) × (α →₀ ℕ)` such that `t₁ + t₂ = s`.
The finitely supported function `antidiagonal s` is equal to the multiplicities of these pairs. -/
def antidiagonal' (f : α →₀ ℕ) : ((α →₀ ℕ) × (α →₀ ℕ)) →₀ ℕ :=
(f.to_multiset.antidiagonal.map (prod.map multiset.to_finsupp multiset.to_finsupp)).to_finsupp
/-- The antidiagonal of `s : α →₀ ℕ` is the finset of all pairs `(t₁, t₂) : (α →₀ ℕ) × (α →₀ ℕ)`
such that `t₁ + t₂ = s`. -/
def antidiagonal (f : α →₀ ℕ) : finset ((α →₀ ℕ) × (α →₀ ℕ)) :=
f.antidiagonal'.support
@[simp] lemma mem_antidiagonal {f : α →₀ ℕ} {p : (α →₀ ℕ) × (α →₀ ℕ)} :
p ∈ antidiagonal f ↔ p.1 + p.2 = f :=
begin
rcases p with ⟨p₁, p₂⟩,
simp [antidiagonal, antidiagonal', ← and.assoc, ← finsupp.to_multiset.apply_eq_iff_eq]
end
lemma swap_mem_antidiagonal {n : α →₀ ℕ} {f : (α →₀ ℕ) × (α →₀ ℕ)} :
f.swap ∈ antidiagonal n ↔ f ∈ antidiagonal n :=
by simp only [mem_antidiagonal, add_comm, prod.swap]
lemma antidiagonal_filter_fst_eq (f g : α →₀ ℕ)
[D : Π (p : (α →₀ ℕ) × (α →₀ ℕ)), decidable (p.1 = g)] :
(antidiagonal f).filter (λ p, p.1 = g) = if g ≤ f then {(g, f - g)} else ∅ :=
begin
ext ⟨a, b⟩,
suffices : a = g → (a + b = f ↔ g ≤ f ∧ b = f - g),
{ simpa [apply_ite ((∈) (a, b)), ← and.assoc, @and.right_comm _ (a = _), and.congr_left_iff] },
unfreezingI {rintro rfl}, split,
{ rintro rfl, exact ⟨le_add_right le_rfl, (add_tsub_cancel_left _ _).symm⟩ },
{ rintro ⟨h, rfl⟩, exact add_tsub_cancel_of_le h }
end
lemma antidiagonal_filter_snd_eq (f g : α →₀ ℕ)
[D : Π (p : (α →₀ ℕ) × (α →₀ ℕ)), decidable (p.2 = g)] :
(antidiagonal f).filter (λ p, p.2 = g) = if g ≤ f then {(f - g, g)} else ∅ :=
begin
ext ⟨a, b⟩,
suffices : b = g → (a + b = f ↔ g ≤ f ∧ a = f - g),
{ simpa [apply_ite ((∈) (a, b)), ← and.assoc, and.congr_left_iff] },
unfreezingI {rintro rfl}, split,
{ rintro rfl, exact ⟨le_add_left le_rfl, (add_tsub_cancel_right _ _).symm⟩ },
{ rintro ⟨h, rfl⟩, exact tsub_add_cancel_of_le h }
end
@[simp] lemma antidiagonal_zero : antidiagonal (0 : α →₀ ℕ) = singleton (0,0) :=
by rw [antidiagonal, antidiagonal', multiset.to_finsupp_support]; refl
@[to_additive]
lemma prod_antidiagonal_swap {M : Type*} [comm_monoid M] (n : α →₀ ℕ)
(f : (α →₀ ℕ) → (α →₀ ℕ) → M) :
∏ p in antidiagonal n, f p.1 p.2 = ∏ p in antidiagonal n, f p.2 p.1 :=
finset.prod_bij (λ p hp, p.swap) (λ p, swap_mem_antidiagonal.2) (λ p hp, rfl)
(λ p₁ p₂ _ _ h, prod.swap_injective h)
(λ p hp, ⟨p.swap, swap_mem_antidiagonal.2 hp, p.swap_swap.symm⟩)
/-- The set `{m : α →₀ ℕ | m ≤ n}` as a `finset`. -/
def Iic_finset (n : α →₀ ℕ) : finset (α →₀ ℕ) :=
(antidiagonal n).image prod.fst
@[simp] lemma mem_Iic_finset {m n : α →₀ ℕ} : m ∈ Iic_finset n ↔ m ≤ n :=
by simp [Iic_finset, le_iff_exists_add, eq_comm]
@[simp] lemma coe_Iic_finset (n : α →₀ ℕ) : ↑(Iic_finset n) = set.Iic n :=
by { ext, simp }
/-- Let `n : α →₀ ℕ` be a finitely supported function.
The set of `m : α →₀ ℕ` that are coordinatewise less than or equal to `n`,
is a finite set. -/
lemma finite_le_nat (n : α →₀ ℕ) : set.finite {m | m ≤ n} :=
by simpa using (Iic_finset n).finite_to_set
/-- Let `n : α →₀ ℕ` be a finitely supported function.
The set of `m : α →₀ ℕ` that are coordinatewise less than or equal to `n`,
but not equal to `n` everywhere, is a finite set. -/
lemma finite_lt_nat (n : α →₀ ℕ) : set.finite {m | m < n} :=
(finite_le_nat n).subset $ λ m, le_of_lt
end finsupp
|
From Coq Require Import String List ZArith.
From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs.
Local Open Scope Z_scope.
Definition _Q : ident := 65%positive.
Definition ___builtin_annot : ident := 14%positive.
Definition ___builtin_annot_intval : ident := 15%positive.
Definition ___builtin_bswap : ident := 8%positive.
Definition ___builtin_bswap16 : ident := 10%positive.
Definition ___builtin_bswap32 : ident := 9%positive.
Definition ___builtin_bswap64 : ident := 40%positive.
Definition ___builtin_clz : ident := 41%positive.
Definition ___builtin_clzl : ident := 42%positive.
Definition ___builtin_clzll : ident := 43%positive.
Definition ___builtin_ctz : ident := 44%positive.
Definition ___builtin_ctzl : ident := 45%positive.
Definition ___builtin_ctzll : ident := 46%positive.
Definition ___builtin_debug : ident := 58%positive.
Definition ___builtin_fabs : ident := 11%positive.
Definition ___builtin_fmadd : ident := 49%positive.
Definition ___builtin_fmax : ident := 47%positive.
Definition ___builtin_fmin : ident := 48%positive.
Definition ___builtin_fmsub : ident := 50%positive.
Definition ___builtin_fnmadd : ident := 51%positive.
Definition ___builtin_fnmsub : ident := 52%positive.
Definition ___builtin_fsqrt : ident := 12%positive.
Definition ___builtin_membar : ident := 16%positive.
Definition ___builtin_memcpy_aligned : ident := 13%positive.
Definition ___builtin_nop : ident := 57%positive.
Definition ___builtin_read16_reversed : ident := 53%positive.
Definition ___builtin_read32_reversed : ident := 54%positive.
Definition ___builtin_va_arg : ident := 18%positive.
Definition ___builtin_va_copy : ident := 19%positive.
Definition ___builtin_va_end : ident := 20%positive.
Definition ___builtin_va_start : ident := 17%positive.
Definition ___builtin_write16_reversed : ident := 55%positive.
Definition ___builtin_write32_reversed : ident := 56%positive.
Definition ___compcert_i64_dtos : ident := 25%positive.
Definition ___compcert_i64_dtou : ident := 26%positive.
Definition ___compcert_i64_sar : ident := 37%positive.
Definition ___compcert_i64_sdiv : ident := 31%positive.
Definition ___compcert_i64_shl : ident := 35%positive.
Definition ___compcert_i64_shr : ident := 36%positive.
Definition ___compcert_i64_smod : ident := 33%positive.
Definition ___compcert_i64_smulh : ident := 38%positive.
Definition ___compcert_i64_stod : ident := 27%positive.
Definition ___compcert_i64_stof : ident := 29%positive.
Definition ___compcert_i64_udiv : ident := 32%positive.
Definition ___compcert_i64_umod : ident := 34%positive.
Definition ___compcert_i64_umulh : ident := 39%positive.
Definition ___compcert_i64_utod : ident := 28%positive.
Definition ___compcert_i64_utof : ident := 30%positive.
Definition ___compcert_va_composite : ident := 24%positive.
Definition ___compcert_va_float64 : ident := 23%positive.
Definition ___compcert_va_int32 : ident := 21%positive.
Definition ___compcert_va_int64 : ident := 22%positive.
Definition _a : ident := 1%positive.
Definition _b : ident := 2%positive.
Definition _elem : ident := 3%positive.
Definition _exit : ident := 61%positive.
Definition _fifo : ident := 7%positive.
Definition _fifo_empty : ident := 70%positive.
Definition _fifo_get : ident := 71%positive.
Definition _fifo_new : ident := 66%positive.
Definition _fifo_put : ident := 69%positive.
Definition _free : ident := 60%positive.
Definition _h : ident := 67%positive.
Definition _head : ident := 5%positive.
Definition _i : ident := 73%positive.
Definition _j : ident := 74%positive.
Definition _main : ident := 75%positive.
Definition _make_elem : ident := 72%positive.
Definition _malloc : ident := 59%positive.
Definition _n : ident := 62%positive.
Definition _next : ident := 4%positive.
Definition _p : ident := 63%positive.
Definition _surely_malloc : ident := 64%positive.
Definition _t : ident := 68%positive.
Definition _tail : ident := 6%positive.
Definition _t'1 : ident := 76%positive.
Definition _t'2 : ident := 77%positive.
Definition _t'3 : ident := 78%positive.
Definition _t'4 : ident := 79%positive.
Definition f_surely_malloc := {|
fn_return := (tptr tvoid);
fn_callconv := cc_default;
fn_params := ((_n, tuint) :: nil);
fn_vars := nil;
fn_temps := ((_p, (tptr tvoid)) :: (_t'1, (tptr tvoid)) :: nil);
fn_body :=
(Ssequence
(Ssequence
(Scall (Some _t'1)
(Evar _malloc (Tfunction (Tcons tuint Tnil) (tptr tvoid) cc_default))
((Etempvar _n tuint) :: nil))
(Sset _p (Etempvar _t'1 (tptr tvoid))))
(Ssequence
(Sifthenelse (Eunop Onotbool (Etempvar _p (tptr tvoid)) tint)
(Scall None (Evar _exit (Tfunction (Tcons tint Tnil) tvoid cc_default))
((Econst_int (Int.repr 1) tint) :: nil))
Sskip)
(Sreturn (Some (Etempvar _p (tptr tvoid))))))
|}.
Definition f_fifo_new := {|
fn_return := (tptr (Tstruct _fifo noattr));
fn_callconv := cc_default;
fn_params := nil;
fn_vars := nil;
fn_temps := ((_Q, (tptr (Tstruct _fifo noattr))) :: (_t'1, (tptr tvoid)) ::
nil);
fn_body :=
(Ssequence
(Ssequence
(Scall (Some _t'1)
(Evar _surely_malloc (Tfunction (Tcons tuint Tnil) (tptr tvoid)
cc_default))
((Esizeof (Tstruct _fifo noattr) tuint) :: nil))
(Sset _Q
(Ecast (Etempvar _t'1 (tptr tvoid)) (tptr (Tstruct _fifo noattr)))))
(Ssequence
(Sassign
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _head (tptr (Tstruct _elem noattr)))
(Ecast (Econst_int (Int.repr 0) tint) (tptr tvoid)))
(Ssequence
(Sassign
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _tail (tptr (Tstruct _elem noattr)))
(Ecast (Econst_int (Int.repr 0) tint) (tptr tvoid)))
(Sreturn (Some (Etempvar _Q (tptr (Tstruct _fifo noattr))))))))
|}.
Definition f_fifo_put := {|
fn_return := tvoid;
fn_callconv := cc_default;
fn_params := ((_Q, (tptr (Tstruct _fifo noattr))) ::
(_p, (tptr (Tstruct _elem noattr))) :: nil);
fn_vars := nil;
fn_temps := ((_h, (tptr (Tstruct _elem noattr))) ::
(_t, (tptr (Tstruct _elem noattr))) :: nil);
fn_body :=
(Ssequence
(Sassign
(Efield
(Ederef (Etempvar _p (tptr (Tstruct _elem noattr)))
(Tstruct _elem noattr)) _next (tptr (Tstruct _elem noattr)))
(Ecast (Econst_int (Int.repr 0) tint) (tptr tvoid)))
(Ssequence
(Sset _h
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _head (tptr (Tstruct _elem noattr))))
(Sifthenelse (Ebinop Oeq (Etempvar _h (tptr (Tstruct _elem noattr)))
(Ecast (Econst_int (Int.repr 0) tint) (tptr tvoid)) tint)
(Ssequence
(Sassign
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _head (tptr (Tstruct _elem noattr)))
(Etempvar _p (tptr (Tstruct _elem noattr))))
(Sassign
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _tail (tptr (Tstruct _elem noattr)))
(Etempvar _p (tptr (Tstruct _elem noattr)))))
(Ssequence
(Sset _t
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _tail (tptr (Tstruct _elem noattr))))
(Ssequence
(Sassign
(Efield
(Ederef (Etempvar _t (tptr (Tstruct _elem noattr)))
(Tstruct _elem noattr)) _next (tptr (Tstruct _elem noattr)))
(Etempvar _p (tptr (Tstruct _elem noattr))))
(Sassign
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _tail (tptr (Tstruct _elem noattr)))
(Etempvar _p (tptr (Tstruct _elem noattr)))))))))
|}.
Definition f_fifo_empty := {|
fn_return := tint;
fn_callconv := cc_default;
fn_params := ((_Q, (tptr (Tstruct _fifo noattr))) :: nil);
fn_vars := nil;
fn_temps := ((_h, (tptr (Tstruct _elem noattr))) :: nil);
fn_body :=
(Ssequence
(Sset _h
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _head (tptr (Tstruct _elem noattr))))
(Sreturn (Some (Ebinop Oeq (Etempvar _h (tptr (Tstruct _elem noattr)))
(Ecast (Econst_int (Int.repr 0) tint) (tptr tvoid)) tint))))
|}.
Definition f_fifo_get := {|
fn_return := (tptr (Tstruct _elem noattr));
fn_callconv := cc_default;
fn_params := ((_Q, (tptr (Tstruct _fifo noattr))) :: nil);
fn_vars := nil;
fn_temps := ((_h, (tptr (Tstruct _elem noattr))) ::
(_n, (tptr (Tstruct _elem noattr))) :: nil);
fn_body :=
(Ssequence
(Sset _h
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _head (tptr (Tstruct _elem noattr))))
(Ssequence
(Sset _n
(Efield
(Ederef (Etempvar _h (tptr (Tstruct _elem noattr)))
(Tstruct _elem noattr)) _next (tptr (Tstruct _elem noattr))))
(Ssequence
(Sassign
(Efield
(Ederef (Etempvar _Q (tptr (Tstruct _fifo noattr)))
(Tstruct _fifo noattr)) _head (tptr (Tstruct _elem noattr)))
(Etempvar _n (tptr (Tstruct _elem noattr))))
(Sreturn (Some (Etempvar _h (tptr (Tstruct _elem noattr))))))))
|}.
Definition f_make_elem := {|
fn_return := (tptr (Tstruct _elem noattr));
fn_callconv := cc_default;
fn_params := ((_a, tint) :: (_b, tint) :: nil);
fn_vars := nil;
fn_temps := ((_p, (tptr (Tstruct _elem noattr))) :: (_t'1, (tptr tvoid)) ::
nil);
fn_body :=
(Ssequence
(Ssequence
(Scall (Some _t'1)
(Evar _surely_malloc (Tfunction (Tcons tuint Tnil) (tptr tvoid)
cc_default))
((Esizeof (Tstruct _elem noattr) tuint) :: nil))
(Sset _p (Etempvar _t'1 (tptr tvoid))))
(Ssequence
(Sassign
(Efield
(Ederef (Etempvar _p (tptr (Tstruct _elem noattr)))
(Tstruct _elem noattr)) _a tint) (Etempvar _a tint))
(Ssequence
(Sassign
(Efield
(Ederef (Etempvar _p (tptr (Tstruct _elem noattr)))
(Tstruct _elem noattr)) _b tint) (Etempvar _b tint))
(Sreturn (Some (Etempvar _p (tptr (Tstruct _elem noattr))))))))
|}.
Definition f_main := {|
fn_return := tint;
fn_callconv := cc_default;
fn_params := nil;
fn_vars := nil;
fn_temps := ((_i, tint) :: (_j, tint) ::
(_Q, (tptr (Tstruct _fifo noattr))) ::
(_p, (tptr (Tstruct _elem noattr))) ::
(_t'4, (tptr (Tstruct _elem noattr))) ::
(_t'3, (tptr (Tstruct _elem noattr))) ::
(_t'2, (tptr (Tstruct _elem noattr))) ::
(_t'1, (tptr (Tstruct _fifo noattr))) :: nil);
fn_body :=
(Ssequence
(Ssequence
(Ssequence
(Scall (Some _t'1)
(Evar _fifo_new (Tfunction Tnil (tptr (Tstruct _fifo noattr))
cc_default)) nil)
(Sset _Q (Etempvar _t'1 (tptr (Tstruct _fifo noattr)))))
(Ssequence
(Ssequence
(Scall (Some _t'2)
(Evar _make_elem (Tfunction (Tcons tint (Tcons tint Tnil))
(tptr (Tstruct _elem noattr)) cc_default))
((Econst_int (Int.repr 1) tint) ::
(Econst_int (Int.repr 10) tint) :: nil))
(Sset _p (Etempvar _t'2 (tptr (Tstruct _elem noattr)))))
(Ssequence
(Scall None
(Evar _fifo_put (Tfunction
(Tcons (tptr (Tstruct _fifo noattr))
(Tcons (tptr (Tstruct _elem noattr)) Tnil))
tvoid cc_default))
((Etempvar _Q (tptr (Tstruct _fifo noattr))) ::
(Etempvar _p (tptr (Tstruct _elem noattr))) :: nil))
(Ssequence
(Ssequence
(Scall (Some _t'3)
(Evar _make_elem (Tfunction (Tcons tint (Tcons tint Tnil))
(tptr (Tstruct _elem noattr)) cc_default))
((Econst_int (Int.repr 2) tint) ::
(Econst_int (Int.repr 20) tint) :: nil))
(Sset _p (Etempvar _t'3 (tptr (Tstruct _elem noattr)))))
(Ssequence
(Scall None
(Evar _fifo_put (Tfunction
(Tcons (tptr (Tstruct _fifo noattr))
(Tcons (tptr (Tstruct _elem noattr)) Tnil))
tvoid cc_default))
((Etempvar _Q (tptr (Tstruct _fifo noattr))) ::
(Etempvar _p (tptr (Tstruct _elem noattr))) :: nil))
(Ssequence
(Ssequence
(Scall (Some _t'4)
(Evar _fifo_get (Tfunction
(Tcons (tptr (Tstruct _fifo noattr))
Tnil) (tptr (Tstruct _elem noattr))
cc_default))
((Etempvar _Q (tptr (Tstruct _fifo noattr))) :: nil))
(Sset _p (Etempvar _t'4 (tptr (Tstruct _elem noattr)))))
(Ssequence
(Sset _i
(Efield
(Ederef (Etempvar _p (tptr (Tstruct _elem noattr)))
(Tstruct _elem noattr)) _a tint))
(Ssequence
(Sset _j
(Efield
(Ederef (Etempvar _p (tptr (Tstruct _elem noattr)))
(Tstruct _elem noattr)) _b tint))
(Ssequence
(Scall None
(Evar _free (Tfunction (Tcons (tptr tvoid) Tnil) tvoid
cc_default))
((Etempvar _p (tptr (Tstruct _elem noattr))) :: nil))
(Sreturn (Some (Ebinop Oadd (Etempvar _i tint)
(Etempvar _j tint) tint))))))))))))
(Sreturn (Some (Econst_int (Int.repr 0) tint))))
|}.
Definition composites : list composite_definition :=
(Composite _elem Struct
((_a, tint) :: (_b, tint) :: (_next, (tptr (Tstruct _elem noattr))) ::
nil)
noattr ::
Composite _fifo Struct
((_head, (tptr (Tstruct _elem noattr))) ::
(_tail, (tptr (Tstruct _elem noattr))) :: nil)
noattr :: nil).
Definition global_definitions : list (ident * globdef fundef type) :=
((___builtin_bswap,
Gfun(External (EF_builtin "__builtin_bswap"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons tuint Tnil) tuint cc_default)) ::
(___builtin_bswap32,
Gfun(External (EF_builtin "__builtin_bswap32"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons tuint Tnil) tuint cc_default)) ::
(___builtin_bswap16,
Gfun(External (EF_builtin "__builtin_bswap16"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons tushort Tnil) tushort cc_default)) ::
(___builtin_fabs,
Gfun(External (EF_builtin "__builtin_fabs"
(mksignature (AST.Tfloat :: nil) (Some AST.Tfloat)
cc_default)) (Tcons tdouble Tnil) tdouble cc_default)) ::
(___builtin_fsqrt,
Gfun(External (EF_builtin "__builtin_fsqrt"
(mksignature (AST.Tfloat :: nil) (Some AST.Tfloat)
cc_default)) (Tcons tdouble Tnil) tdouble cc_default)) ::
(___builtin_memcpy_aligned,
Gfun(External (EF_builtin "__builtin_memcpy_aligned"
(mksignature
(AST.Tint :: AST.Tint :: AST.Tint :: AST.Tint :: nil)
None cc_default))
(Tcons (tptr tvoid)
(Tcons (tptr tvoid) (Tcons tuint (Tcons tuint Tnil)))) tvoid
cc_default)) ::
(___builtin_annot,
Gfun(External (EF_builtin "__builtin_annot"
(mksignature (AST.Tint :: nil) None
{|cc_vararg:=true; cc_unproto:=false; cc_structret:=false|}))
(Tcons (tptr tschar) Tnil) tvoid
{|cc_vararg:=true; cc_unproto:=false; cc_structret:=false|})) ::
(___builtin_annot_intval,
Gfun(External (EF_builtin "__builtin_annot_intval"
(mksignature (AST.Tint :: AST.Tint :: nil) (Some AST.Tint)
cc_default)) (Tcons (tptr tschar) (Tcons tint Tnil))
tint cc_default)) ::
(___builtin_membar,
Gfun(External (EF_builtin "__builtin_membar"
(mksignature nil None cc_default)) Tnil tvoid cc_default)) ::
(___builtin_va_start,
Gfun(External (EF_builtin "__builtin_va_start"
(mksignature (AST.Tint :: nil) None cc_default))
(Tcons (tptr tvoid) Tnil) tvoid cc_default)) ::
(___builtin_va_arg,
Gfun(External (EF_builtin "__builtin_va_arg"
(mksignature (AST.Tint :: AST.Tint :: nil) None
cc_default)) (Tcons (tptr tvoid) (Tcons tuint Tnil))
tvoid cc_default)) ::
(___builtin_va_copy,
Gfun(External (EF_builtin "__builtin_va_copy"
(mksignature (AST.Tint :: AST.Tint :: nil) None
cc_default))
(Tcons (tptr tvoid) (Tcons (tptr tvoid) Tnil)) tvoid cc_default)) ::
(___builtin_va_end,
Gfun(External (EF_builtin "__builtin_va_end"
(mksignature (AST.Tint :: nil) None cc_default))
(Tcons (tptr tvoid) Tnil) tvoid cc_default)) ::
(___compcert_va_int32,
Gfun(External (EF_external "__compcert_va_int32"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons (tptr tvoid) Tnil) tuint cc_default)) ::
(___compcert_va_int64,
Gfun(External (EF_external "__compcert_va_int64"
(mksignature (AST.Tint :: nil) (Some AST.Tlong)
cc_default)) (Tcons (tptr tvoid) Tnil) tulong
cc_default)) ::
(___compcert_va_float64,
Gfun(External (EF_external "__compcert_va_float64"
(mksignature (AST.Tint :: nil) (Some AST.Tfloat)
cc_default)) (Tcons (tptr tvoid) Tnil) tdouble
cc_default)) ::
(___compcert_va_composite,
Gfun(External (EF_external "__compcert_va_composite"
(mksignature (AST.Tint :: AST.Tint :: nil) (Some AST.Tint)
cc_default)) (Tcons (tptr tvoid) (Tcons tuint Tnil))
(tptr tvoid) cc_default)) ::
(___compcert_i64_dtos,
Gfun(External (EF_runtime "__compcert_i64_dtos"
(mksignature (AST.Tfloat :: nil) (Some AST.Tlong)
cc_default)) (Tcons tdouble Tnil) tlong cc_default)) ::
(___compcert_i64_dtou,
Gfun(External (EF_runtime "__compcert_i64_dtou"
(mksignature (AST.Tfloat :: nil) (Some AST.Tlong)
cc_default)) (Tcons tdouble Tnil) tulong cc_default)) ::
(___compcert_i64_stod,
Gfun(External (EF_runtime "__compcert_i64_stod"
(mksignature (AST.Tlong :: nil) (Some AST.Tfloat)
cc_default)) (Tcons tlong Tnil) tdouble cc_default)) ::
(___compcert_i64_utod,
Gfun(External (EF_runtime "__compcert_i64_utod"
(mksignature (AST.Tlong :: nil) (Some AST.Tfloat)
cc_default)) (Tcons tulong Tnil) tdouble cc_default)) ::
(___compcert_i64_stof,
Gfun(External (EF_runtime "__compcert_i64_stof"
(mksignature (AST.Tlong :: nil) (Some AST.Tsingle)
cc_default)) (Tcons tlong Tnil) tfloat cc_default)) ::
(___compcert_i64_utof,
Gfun(External (EF_runtime "__compcert_i64_utof"
(mksignature (AST.Tlong :: nil) (Some AST.Tsingle)
cc_default)) (Tcons tulong Tnil) tfloat cc_default)) ::
(___compcert_i64_sdiv,
Gfun(External (EF_runtime "__compcert_i64_sdiv"
(mksignature (AST.Tlong :: AST.Tlong :: nil)
(Some AST.Tlong) cc_default))
(Tcons tlong (Tcons tlong Tnil)) tlong cc_default)) ::
(___compcert_i64_udiv,
Gfun(External (EF_runtime "__compcert_i64_udiv"
(mksignature (AST.Tlong :: AST.Tlong :: nil)
(Some AST.Tlong) cc_default))
(Tcons tulong (Tcons tulong Tnil)) tulong cc_default)) ::
(___compcert_i64_smod,
Gfun(External (EF_runtime "__compcert_i64_smod"
(mksignature (AST.Tlong :: AST.Tlong :: nil)
(Some AST.Tlong) cc_default))
(Tcons tlong (Tcons tlong Tnil)) tlong cc_default)) ::
(___compcert_i64_umod,
Gfun(External (EF_runtime "__compcert_i64_umod"
(mksignature (AST.Tlong :: AST.Tlong :: nil)
(Some AST.Tlong) cc_default))
(Tcons tulong (Tcons tulong Tnil)) tulong cc_default)) ::
(___compcert_i64_shl,
Gfun(External (EF_runtime "__compcert_i64_shl"
(mksignature (AST.Tlong :: AST.Tint :: nil)
(Some AST.Tlong) cc_default))
(Tcons tlong (Tcons tint Tnil)) tlong cc_default)) ::
(___compcert_i64_shr,
Gfun(External (EF_runtime "__compcert_i64_shr"
(mksignature (AST.Tlong :: AST.Tint :: nil)
(Some AST.Tlong) cc_default))
(Tcons tulong (Tcons tint Tnil)) tulong cc_default)) ::
(___compcert_i64_sar,
Gfun(External (EF_runtime "__compcert_i64_sar"
(mksignature (AST.Tlong :: AST.Tint :: nil)
(Some AST.Tlong) cc_default))
(Tcons tlong (Tcons tint Tnil)) tlong cc_default)) ::
(___compcert_i64_smulh,
Gfun(External (EF_runtime "__compcert_i64_smulh"
(mksignature (AST.Tlong :: AST.Tlong :: nil)
(Some AST.Tlong) cc_default))
(Tcons tlong (Tcons tlong Tnil)) tlong cc_default)) ::
(___compcert_i64_umulh,
Gfun(External (EF_runtime "__compcert_i64_umulh"
(mksignature (AST.Tlong :: AST.Tlong :: nil)
(Some AST.Tlong) cc_default))
(Tcons tulong (Tcons tulong Tnil)) tulong cc_default)) ::
(___builtin_bswap64,
Gfun(External (EF_builtin "__builtin_bswap64"
(mksignature (AST.Tlong :: nil) (Some AST.Tlong)
cc_default)) (Tcons tulong Tnil) tulong cc_default)) ::
(___builtin_clz,
Gfun(External (EF_builtin "__builtin_clz"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons tuint Tnil) tint cc_default)) ::
(___builtin_clzl,
Gfun(External (EF_builtin "__builtin_clzl"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons tuint Tnil) tint cc_default)) ::
(___builtin_clzll,
Gfun(External (EF_builtin "__builtin_clzll"
(mksignature (AST.Tlong :: nil) (Some AST.Tint)
cc_default)) (Tcons tulong Tnil) tint cc_default)) ::
(___builtin_ctz,
Gfun(External (EF_builtin "__builtin_ctz"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons tuint Tnil) tint cc_default)) ::
(___builtin_ctzl,
Gfun(External (EF_builtin "__builtin_ctzl"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons tuint Tnil) tint cc_default)) ::
(___builtin_ctzll,
Gfun(External (EF_builtin "__builtin_ctzll"
(mksignature (AST.Tlong :: nil) (Some AST.Tint)
cc_default)) (Tcons tulong Tnil) tint cc_default)) ::
(___builtin_fmax,
Gfun(External (EF_builtin "__builtin_fmax"
(mksignature (AST.Tfloat :: AST.Tfloat :: nil)
(Some AST.Tfloat) cc_default))
(Tcons tdouble (Tcons tdouble Tnil)) tdouble cc_default)) ::
(___builtin_fmin,
Gfun(External (EF_builtin "__builtin_fmin"
(mksignature (AST.Tfloat :: AST.Tfloat :: nil)
(Some AST.Tfloat) cc_default))
(Tcons tdouble (Tcons tdouble Tnil)) tdouble cc_default)) ::
(___builtin_fmadd,
Gfun(External (EF_builtin "__builtin_fmadd"
(mksignature
(AST.Tfloat :: AST.Tfloat :: AST.Tfloat :: nil)
(Some AST.Tfloat) cc_default))
(Tcons tdouble (Tcons tdouble (Tcons tdouble Tnil))) tdouble
cc_default)) ::
(___builtin_fmsub,
Gfun(External (EF_builtin "__builtin_fmsub"
(mksignature
(AST.Tfloat :: AST.Tfloat :: AST.Tfloat :: nil)
(Some AST.Tfloat) cc_default))
(Tcons tdouble (Tcons tdouble (Tcons tdouble Tnil))) tdouble
cc_default)) ::
(___builtin_fnmadd,
Gfun(External (EF_builtin "__builtin_fnmadd"
(mksignature
(AST.Tfloat :: AST.Tfloat :: AST.Tfloat :: nil)
(Some AST.Tfloat) cc_default))
(Tcons tdouble (Tcons tdouble (Tcons tdouble Tnil))) tdouble
cc_default)) ::
(___builtin_fnmsub,
Gfun(External (EF_builtin "__builtin_fnmsub"
(mksignature
(AST.Tfloat :: AST.Tfloat :: AST.Tfloat :: nil)
(Some AST.Tfloat) cc_default))
(Tcons tdouble (Tcons tdouble (Tcons tdouble Tnil))) tdouble
cc_default)) ::
(___builtin_read16_reversed,
Gfun(External (EF_builtin "__builtin_read16_reversed"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons (tptr tushort) Tnil) tushort cc_default)) ::
(___builtin_read32_reversed,
Gfun(External (EF_builtin "__builtin_read32_reversed"
(mksignature (AST.Tint :: nil) (Some AST.Tint) cc_default))
(Tcons (tptr tuint) Tnil) tuint cc_default)) ::
(___builtin_write16_reversed,
Gfun(External (EF_builtin "__builtin_write16_reversed"
(mksignature (AST.Tint :: AST.Tint :: nil) None
cc_default)) (Tcons (tptr tushort) (Tcons tushort Tnil))
tvoid cc_default)) ::
(___builtin_write32_reversed,
Gfun(External (EF_builtin "__builtin_write32_reversed"
(mksignature (AST.Tint :: AST.Tint :: nil) None
cc_default)) (Tcons (tptr tuint) (Tcons tuint Tnil))
tvoid cc_default)) ::
(___builtin_nop,
Gfun(External (EF_builtin "__builtin_nop"
(mksignature nil None cc_default)) Tnil tvoid cc_default)) ::
(___builtin_debug,
Gfun(External (EF_external "__builtin_debug"
(mksignature (AST.Tint :: nil) None
{|cc_vararg:=true; cc_unproto:=false; cc_structret:=false|}))
(Tcons tint Tnil) tvoid
{|cc_vararg:=true; cc_unproto:=false; cc_structret:=false|})) ::
(_malloc,
Gfun(External EF_malloc (Tcons tuint Tnil) (tptr tvoid) cc_default)) ::
(_free, Gfun(External EF_free (Tcons (tptr tvoid) Tnil) tvoid cc_default)) ::
(_exit,
Gfun(External (EF_external "exit"
(mksignature (AST.Tint :: nil) None cc_default))
(Tcons tint Tnil) tvoid cc_default)) ::
(_surely_malloc, Gfun(Internal f_surely_malloc)) ::
(_fifo_new, Gfun(Internal f_fifo_new)) ::
(_fifo_put, Gfun(Internal f_fifo_put)) ::
(_fifo_empty, Gfun(Internal f_fifo_empty)) ::
(_fifo_get, Gfun(Internal f_fifo_get)) ::
(_make_elem, Gfun(Internal f_make_elem)) ::
(_main, Gfun(Internal f_main)) :: nil).
Definition public_idents : list ident :=
(_main :: _make_elem :: _fifo_get :: _fifo_empty :: _fifo_put :: _fifo_new ::
_surely_malloc :: _exit :: _free :: _malloc :: ___builtin_debug ::
___builtin_nop :: ___builtin_write32_reversed ::
___builtin_write16_reversed :: ___builtin_read32_reversed ::
___builtin_read16_reversed :: ___builtin_fnmsub :: ___builtin_fnmadd ::
___builtin_fmsub :: ___builtin_fmadd :: ___builtin_fmin ::
___builtin_fmax :: ___builtin_ctzll :: ___builtin_ctzl :: ___builtin_ctz ::
___builtin_clzll :: ___builtin_clzl :: ___builtin_clz ::
___builtin_bswap64 :: ___compcert_i64_umulh :: ___compcert_i64_smulh ::
___compcert_i64_sar :: ___compcert_i64_shr :: ___compcert_i64_shl ::
___compcert_i64_umod :: ___compcert_i64_smod :: ___compcert_i64_udiv ::
___compcert_i64_sdiv :: ___compcert_i64_utof :: ___compcert_i64_stof ::
___compcert_i64_utod :: ___compcert_i64_stod :: ___compcert_i64_dtou ::
___compcert_i64_dtos :: ___compcert_va_composite ::
___compcert_va_float64 :: ___compcert_va_int64 :: ___compcert_va_int32 ::
___builtin_va_end :: ___builtin_va_copy :: ___builtin_va_arg ::
___builtin_va_start :: ___builtin_membar :: ___builtin_annot_intval ::
___builtin_annot :: ___builtin_memcpy_aligned :: ___builtin_fsqrt ::
___builtin_fabs :: ___builtin_bswap16 :: ___builtin_bswap32 ::
___builtin_bswap :: nil).
Definition prog : Clight.program :=
mkprogram composites global_definitions public_idents _main Logic.I.
|
\chapter{Zen and the Art of High Performance Parallel Computing} |
```python
import matplotlib.pyplot as plt
import BondGraphTools
from BondGraphTools.config import config
from BondGraphTools.reaction_builder import Reaction_Network
julia = config.julia
```
# `BondGraphTools`
## Modelling Network Bioenergetics.
https://github.com/peter-cudmore/seminars/ANZIAM-2019
Dr. Peter Cudmore.
Systems Biology Labratory,
The School of Chemical and Biomedical Engineering,
The University of Melbourne.
In this talk i discuss
* Problems in compartmental modelling of cellular processes,
* Some solutions from engineering and physics,
* Software to make life easier.
For this talk; a *model* is a set of ordinary differential equations.
## Part 1: Problems in Cellular Process Modelling.
<center> </center>
<center><i>Parameters (or the lack thereof) are the bane of the mathematical biologists existence!</i></center>
Consinder $S + E = ES = E + P$ (one 'edge' of metabolism).
Assuming mass action, the dynamics are:
$$\begin{align}
\dot{[S]} &= k_1^b[ES] - k_1^f[E][S],\\
\dot{[E]} &= (k_1^b + k_2^f)[ES] - [E](k_1^f[S] + k_2^b[P]),\\
\dot{[ES]} &= -(k_1^b + k_2^f)[ES] + [E](k_1^f[S] + k_2^b[P]),\\
\dot{[P]} &= k_2^f[ES] - k_2^f[E][P].
\end{align}
$$
*What are the kinetic parameters $k_1^b, k_1^f, k_2^b, k_2^f$?*
*How do we find them for large systems?*
Can kinetic parameters be estimated from available data?
<center><h3>No!</h3></center>
When fitting data to a system of kinetics parameters may be:
- unobservable (for example, rate constants from equilibrium data),
- or *sloppy* (aways underdetermined for a set of data).
Do kinetic parameters generalise across different experiments (and hence can be tabulated)?
<center><h3>No!</h3></center>
At the very least kinetic parameters fail to generalise across temperatures.
For example; physiological conditions are around $37^\circ C$ while labs are around $21^\circ C$.
Do kinetic parameters violate the laws physics?
<center><h3>Often!</h3></center>
_The principal of detailed balance_ requires that at equilibirum each simple process should be balanced by its reverse process.
This puts constraints on the kinetic parameters which are often broken, for example, by setting $k^b_i = 0$ (no back reaction for that step).
An alternative is to think of kinetic parameters as derived from physical constants!
For instance:
- Oster, G. and Perelson, A. and Katchalsy, A. *Network Thermodynamics*. Nature 1971; 234:5329.
- Erderer, M. and Gilles, E. D. *Thermodynamically Feasible Kinetic Models of Reaction Networks*. Biophys J. 2007; 92(6): 1846–1857.
- Saa, P. A. and Nielsen, L. K. *Construction of feasible and accurate kinetic models of metabolism: A Bayesian approach.* Sci Rep. 2016;6:29635.
# Part 2: A Solution via Network Thermodynamics
<center> </center>
### Network Thermodynamics
Partitions $S + B = P$ into _components_.
1. Energy Storage.
2. Dissipative Processes.
3. Conservation Laws.
Here:
- Chem. potential acts like _pressure_ or _voltage_.
- Molar flow acts like _velocity_ or _current_.
```python
# Reaction Network from BondGraphTools
reaction = Reaction_Network(
"S + B = P", name="One Step Reaction"
)
model = reaction.as_network_model()
# Basic Visualisation.
from BondGraphTools import draw
figure = draw(model, size=(8,6))
```
### Kinetic parameters from Network Thermodynamics.
Partitions $S + B = P$ into _components_.
1. Energy Storage Compartments:
$S$, $B$ and $P$.
2. Dissipative Processes: (The chemical reaction itself).
3. Conservation Laws: (The flow from A is the flow from B and is equal to the flow into reaction).
Gibbs Energy:
$$\mathrm{d}G = P\mathrm{d}v +S\mathrm{d}T + \sum_i\mu_i\mathrm{d}n_i$$
- $\mu_i$ is the Chemical Potential of species $A_i$
- $n_i$ is the amount (in mols) of $A_i$
Chemical Potential is usually modelled as
$$\mu_i = PT\ln\left(\frac{k_in_i}{V}\right)$$ where $$k_i = \frac{1}{c^\text{ref}}\exp\left[\frac{\mu_i^\text{ref}}{PT}\right]$$
- $P$, $T$ and $V$ are pressure, temperature and volume respectively.
- $c^\text{ref}$ is the reference concentration (often $10^{-9} \text{mol/L}$).
- $\mu_i^\text{ref}$ is the reference potential.
<center><i> The reference potential can be tabulated, approximated and (in somecase) directly measured!</i> </center>
Reaction flow $v$ is assumed to obey the Marcelin-de Donder formula:
$$ v \propto \exp\left(\frac{A_f}{PT}\right) - \exp\left(\frac{A_r}{PT}\right)$$
where $A_f, A_r$ are the forward and reverse chemical affinities.
For $S + B = P$, $$A_f = \mu_S + \mu_B \quad \text{and}\quad A_r = \mu_P.$$
### Kinetic parameters from Network Thermodynamics.
For the equation $S + B= P$, in thermodynamic parameters:
$$
\dot{[P]} = \kappa(k_Sk_B[S][B] - k_P[P])
$$
Here $$k^f = \kappa k_Sk_B, \quad k^b = \kappa k_P, \quad \text{with} \quad k_i = \frac{1}{c^\text{ref}}\exp\left[\frac{\mu_i^\text{ref}}{PT}\right], \quad \kappa > 0.$$
*$k^f$ and $k^b$ are now related to physical constants!*
# Part 3: Network Thermodynamics with `BondGraphTools`
<center> </center>
```python
import BondGraphTools
help(BondGraphTools)
```
Help on package BondGraphTools:
NAME
BondGraphTools
DESCRIPTION
BondGraphTools
==============
BondGraphTools is a python library for symbolic modelling and control of multi-physics
systems using bond graphs. Bond graph modelling is a network base framework concerned
with the distribution of energy and the flow of power through lumped-element or
compartmental models of physical system.
Package Documentation::
https://bondgraphtools.readthedocs.io/
Source::
https://github.com/BondGraphTools/BondGraphTools
Bug reports:
https://github.com/BondGraphTools/BondGraphTools/issues
Simple Example
--------------
Build and simulate a RLC driven RLC circuit::
import BondGraphTools as bgt
# Create a new model
model = bgt.new(name="RLC")
# Create components
# 1 Ohm Resistor
resistor = bgt.new("R", name="R1", value=1.0)
# 1 Henry Inductor
inductor = bgt.new("L", name="L1", value=1.0)
# 1 Farad Capacitor
capacitor = bgt.new("C", name="C1", value=1.0)
# Conservation Law
law = bgt.new("0") # Common voltage conservation law
# Connect the components
connect(law, resistor)
connect(law, capacitor)
connect(law, inductor)
# produce timeseries data
t, x = simulate(model, x0=[1,1], timespan=[0, 10])
Bugs
----
Please report any bugs `here <https://github.com/BondGraphTools/BondGraphTools/issues>`_,
or fork the repository and submit a pull request.
License
-------
Released under the Apache 2.0 License::
Copyright (C) 2018
Peter Cudmore <[email protected]>
PACKAGE CONTENTS
actions
algebra
atomic
base
component_manager
compound
config
ds_model
exceptions
fileio
port_hamiltonian
reaction_builder
sim_tools
version
view
FILE
/Users/pete/Workspace/BondGraphTools/BondGraphTools/__init__.py
### Network Energetics
Network Energetics, which includes Network Thermodynamics partitions $S + B = P$ into _components_.
1. Energy Storage Compartments: $C: S$, $C: B$ and $C: P$.
2. Dissipative Processes: $R: r_{1;0}$
3. Conservation Laws: $1$ (common flow).
*Bond Graphs represent of energy networks.*
```python
#from BondGraphTools.reaction_builder
# import Reaction_Network
reaction = Reaction_Network(
"S + B = P", name="One Step Reaction"
)
model = reaction.as_network_model()
# Basic Visualisation.
from BondGraphTools import draw
figure = draw(model, size=(8,6))
```
```python
```
```python
# Initialise latex printing
from sympy import init_printing
init_printing()
# Print the equations of motion
model.constitutive_relations
```
```python
figure
```
```python
for v in model.state_vars:
(component, local_v) = model.state_vars[v]
meta_data = component.state_vars[local_v]
print(f"{v} is {component}\'s {meta_data}")
```
x_0 is C: S's Molar Amount
x_1 is C: B's Molar Amount
x_2 is C: P's Molar Amount
```python
#
#
figure
```
### A peak under the hood
In `BondGraphTools`, components have a number of power ports defined such that the power $P_i$ entering the $i$th port is $P_i = e_if_i$
The power vaiables $(e,f)$ are related to the component state variables $(x, \mathrm{d}x)$ by _constitutive relations_.
```python
from BondGraphTools import new
chemical_potential = new("Ce", library="BioChem")
chemical_potential.constitutive_relations
```
```python
figure
```
##### A peak under the hood (cont.)
The harpoons represent _shared power variables_.
For example the harpoon from port 1 on $R: r_{1;0}$ to $C:P$ indiciates that
$$
f^{C:P}_0 = - f^{R:r_{1;0}}_1 \qquad
e^{C:P}_0 = e^{R:r_{1;0}}_1
$$
so that power is conserved through the connection
$$
P^{C:P}_0 + P^{R:r_{1;0}}_1 = 0
$$
```python
```
```python
figure
```
##### A peak under the hood (cont.)
The resulting system is of the form:
$$
LX + V(X) = 0
$$
where
$$
X = \left(\frac{\mathrm{d}\mathbf{x}}{\mathrm{d}t},
\mathbf{e},
\mathbf{f},
\mathbf{x},
\mathbf{u}\right)^T
$$
- $\mathbf{e},\mathbf{f}$ vectors of power variables
- $\mathrm{d}\mathbf{x}, \mathbf{x}$ similarly state variables.
- and $\mathbf{u}$ control variables
- $L$ is a sparse matrix
- $V$ is a nonlinear vector field.
```python
```
### So what does this have to do with parameters?
Having a network energetics library allows for:
- automation via dataflow scripting (eq; `request`, `xlrd`),
- 'computational modularity' for model/parameter reuse,
- intergration with existing parameter estimators,
- use with your favourite data analysis technology.
*Enables the tabuation of paramaters!*
### Why Python?
- open source, commonly available and commonly used
- 'executable pseudocode' (easy to read) and excellent for rapid development
- great libraries for both science and general purpose computing
- excellent quality management tools
- pacakge management, version control
*`BondGraphTools` is developed with sustainable development practices.*
## `BondGraphTools` now and in the future.
#### Current Version
Version 0.3.6 (on PyPI) is being used by in the Systems Biology Lab:
- Prof. Peter Gawrthop (mitochondrial electron transport).
- Michael Pan (ionic homeostasis).
- Myself (coupled oscillators, synthetic biology)
#### Features Already Implemented
- Component libraries, (mechotronic and biochem)
- Numerical simulations,
- Control variables,
- Stiochiometric analysis
The big challenge: _scaling up_!
# Thanks for Listening!
Thanks to:
- Prof. Edmund Crampin Prof. Peter Gawthrop, Michael Pan & The Systems Biology Lab.
- The University of Melbourne
- The ARC Center of Excellence for Convergent Bio-Nano Science.
- ANZIAM Organisers and sessions chairs, and Victoria University.
Please check out `BondGraphTools`
- documentation at [bondgraphtools.readthedocs.io](http://bondgraphtools.readthedocs.io)
- source at [https://github.com/BondGraphTools](https://github.com/BondGraphTools)
```python
```
```python
```
|
\section{Conclusion}
\label{s:concl}
This paper presented the initial design and implementation of
\textit{Nail}, an interface generator for data formats. Nail helps
programmers to avoid memory corruption and ambiguity vulnerabilities
while reducing effort in parsing and generating real-world protocols
and file formats. Nail achieves this by reducing the expressive
power of the grammar, maintaining a \emph{semantic bijection} between
data formats and internal representations, and allowing programmers to
specify \emph{structural dependencies} in the data format. Preliminary
experience with implementing a DNS server using Nail suggests that this
is a promising approach.
The source code for our prototype of Nail is available at
\url{https://github.com/jbangert/nail}.
|
Require Import Thread0 Echo3 Bootstrap.
Module Type S.
Variable heapSize : nat.
End S.
Module Make(M : S).
Import M.
Module M'.
Definition globalSched : W := (heapSize + 50) * 4.
Definition globalSock : W := globalSched ^+ $4.
End M'.
Import M'.
Module E := Echo3.Make(M').
Import E.
Section boot.
Hypothesis heapSizeLowerBound : (3 <= heapSize)%nat.
Definition size := heapSize + 50 + 2.
Hypothesis mem_size : goodSize (size * 4)%nat.
Let heapSizeUpperBound : goodSize (heapSize * 4).
goodSize.
Qed.
Definition bootS := bootS heapSize 2.
Definition boot := bimport [[ "malloc"!"init" @ [Malloc.initS], "test"!"main" @ [E.mainS] ]]
bmodule "main" {{
bfunctionNoRet "main"() [bootS]
Sp <- (heapSize * 4)%nat;;
Assert [PREmain[_] globalSched =?> 2 * 0 =?> heapSize];;
Call "malloc"!"init"(0, heapSize)
[PREmain[_] globalSock =?> 1 * globalSched =?> 1 * mallocHeap 0];;
Goto "test"!"main"
end
}}.
Ltac t := unfold globalSched, localsInvariantMain, M'.globalSock, M'.globalSched; genesis.
Theorem ok0 : moduleOk boot.
vcgen; abstract t.
Qed.
Definition m1 := link boot E.T.m.
Definition m := link E.m m1.
Lemma ok1 : moduleOk m1.
link ok0 E.T.ok.
Qed.
Theorem ok : moduleOk m.
link E.ok ok1.
Qed.
Variable stn : settings.
Variable prog : program.
Hypothesis inj : forall l1 l2 w, Labels stn l1 = Some w
-> Labels stn l2 = Some w
-> l1 = l2.
Hypothesis agree : forall l pre bl,
LabelMap.MapsTo l (pre, bl) (XCAP.Blocks m)
-> exists w, Labels stn l = Some w
/\ prog w = Some bl.
Hypothesis agreeImp : forall l pre, LabelMap.MapsTo l pre (XCAP.Imports m)
-> exists w, Labels stn l = Some w
/\ prog w = None.
Hypothesis omitImp : forall l w,
Labels stn ("sys", l) = Some w
-> prog w = None.
Variable w : W.
Hypothesis at_start : Labels stn ("main", Global "main") = Some w.
Variable st : state.
Hypothesis mem_low : forall n, (n < size * 4)%nat -> st.(Mem) n <> None.
Hypothesis mem_high : forall w, $(size * 4) <= w -> st.(Mem) w = None.
Theorem safe : sys_safe stn prog (w, st).
safety ok.
Qed.
End boot.
End Make.
|
lemma in_components_nonempty: "c \<in> components s \<Longrightarrow> c \<noteq> {}" |
module Module where
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
_+_ : ℕ → ℕ → ℕ
zero + n = zero
suc m + n = suc (m + n)
import Data.Nat using (ℕ; zero; suc; _+_)
|
(* Title: HOL/Auth/n_germanSimp_lemma_on_inv__5.thy
Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
*)
header{*The n_germanSimp Protocol Case Study*}
theory n_germanSimp_lemma_on_inv__5 imports n_germanSimp_base
begin
section{*All lemmas on causal relation between inv__5 and some rule r*}
lemma n_SendInv__part__0Vsinv__5:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInv__part__0 i" apply fastforce done
from a2 obtain p__Inv3 p__Inv4 where a2:"p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4" apply fastforce done
have "(i=p__Inv4)\<or>(i=p__Inv3)\<or>(i~=p__Inv3\<and>i~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv3)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv3\<and>i~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_SendInv__part__1Vsinv__5:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInv__part__1 i" apply fastforce done
from a2 obtain p__Inv3 p__Inv4 where a2:"p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4" apply fastforce done
have "(i=p__Inv4)\<or>(i=p__Inv3)\<or>(i~=p__Inv3\<and>i~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv3)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv3\<and>i~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_SendInvAckVsinv__5:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInvAck i" apply fastforce done
from a2 obtain p__Inv3 p__Inv4 where a2:"p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4" apply fastforce done
have "(i=p__Inv4)\<or>(i=p__Inv3)\<or>(i~=p__Inv3\<and>i~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv3)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv3\<and>i~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_SendGntSVsinv__5:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendGntS i)" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_SendGntS i" apply fastforce done
from a2 obtain p__Inv3 p__Inv4 where a2:"p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4" apply fastforce done
have "(i=p__Inv4)\<or>(i=p__Inv3)\<or>(i~=p__Inv3\<and>i~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv4)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Ident ''ExGntd'')) (Const false)) (eqn (IVar (Field (Para (Ident ''Cache'') p__Inv3) ''State'')) (Const E))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv3)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv3\<and>i~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_SendGntEVsinv__5:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_SendGntE N i" apply fastforce done
from a2 obtain p__Inv3 p__Inv4 where a2:"p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4" apply fastforce done
have "(i=p__Inv4)\<or>(i=p__Inv3)\<or>(i~=p__Inv3\<and>i~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv3)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv3\<and>i~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_RecvGntSVsinv__5:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvGntS i" apply fastforce done
from a2 obtain p__Inv3 p__Inv4 where a2:"p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4" apply fastforce done
have "(i=p__Inv4)\<or>(i=p__Inv3)\<or>(i~=p__Inv3\<and>i~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv3)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv3\<and>i~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_RecvGntEVsinv__5:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvGntE i" apply fastforce done
from a2 obtain p__Inv3 p__Inv4 where a2:"p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4" apply fastforce done
have "(i=p__Inv4)\<or>(i=p__Inv3)\<or>(i~=p__Inv3\<and>i~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i=p__Inv3)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv4) ''Cmd'')) (Const GntS)) (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv3) ''Cmd'')) (Const GntE))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv3\<and>i~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_StoreVsinv__5:
assumes a1: "\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_RecvInvAckVsinv__5:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_RecvInvAck i" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_RecvReqE__part__0Vsinv__5:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_RecvReqE__part__0 N i" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_RecvReqE__part__1Vsinv__5:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_RecvReqE__part__1 N i" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_RecvReqSVsinv__5:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_RecvReqS N i" and
a2: "(\<exists> p__Inv3 p__Inv4. p__Inv3\<le>N\<and>p__Inv4\<le>N\<and>p__Inv3~=p__Inv4\<and>f=inv__5 p__Inv3 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
end
|
= = Influences and style = =
|
module plfa.part1.Negation where
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
open import Data.Nat using (ℕ; zero; suc; _<_)
open import Data.Empty using (⊥; ⊥-elim)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Data.Product using (_×_; _,_)
open import plfa.part1.Isomorphism using (_≃_; extensionality)
¬_ : Set → Set
¬ A = A → ⊥
¬-elim : ∀ {A : Set}
→ ¬ A
→ A
---
→ ⊥
¬-elim ¬x x = ¬x x
infix 3 ¬_
¬¬-intro : ∀ {A : Set}
→ A
-----
→ ¬ ¬ A
¬¬-intro x = λ{¬x → ¬x x}
¬¬¬-elim : ∀ {A : Set}
→ ¬ ¬ ¬ A
-------
→ ¬ A
¬¬¬-elim ¬¬¬x = λ x → ¬¬¬x (¬¬-intro x)
contraposition : ∀ {A B : Set}
→ (A → B)
-----------
→ (¬ B → ¬ A)
contraposition f ¬y x = ¬y (f x)
_≢_ : ∀ {A : Set} → A → A → Set
x ≢ y = ¬ (x ≡ y)
_ : 1 ≢ 2
_ = λ()
peano : ∀ {m : ℕ} → zero ≢ suc m
peano = λ()
id : ⊥ → ⊥
id x = x
id′ : ⊥ → ⊥
id′ ()
assimilation : ∀ {A : Set} (¬x ¬x′ : ¬ A) → ¬x ≡ ¬x′
assimilation ¬x ¬x′ = extensionality (λ x → ⊥-elim (¬x x))
assimilation' : ∀ {A : Set} {¬x ¬x′ : ¬ A} → ¬x ≡ ¬x′
assimilation' {A} {¬x} {¬x′} = assimilation ¬x ¬x′
<-irreflexive : ∀ {n : ℕ} → ¬ (n < n)
<-irreflexive (Data.Nat.s≤s x) = <-irreflexive x
⊎-dual-× : ∀ {A B : Set} → ¬ (A ⊎ B) ≃ (¬ A) × (¬ B)
⊎-dual-× = record {
to = λ {x → (λ z → x (inj₁ z)) , λ x₁ → x (inj₂ x₁) };
from = λ { (fst , snd) (inj₁ x) → fst x ;
(fst , snd) (inj₂ y) → snd y} ;
from∘to = λ {¬x → assimilation'} ;
to∘from = λ { (fst , snd) → refl} }
|
function [xout,yout]=rejectsample(f, n)
% [xout,yout]=rejectsample(f, n)
% rejection sampling from the 2D discrete distribution f
% n: number of samples
% the proposal distriburion is a uniform distribution on the range of f
sizef=size(f);
maxf=max(f(:));
nsofar=0;
while nsofar<n
xrand=sizef(1)*rand;
yrand=sizef(2)*rand;
u=maxf*rand;
if u<f(ceil(xrand), ceil(yrand))
nsofar=nsofar+1;
x(nsofar)=xrand;
y(nsofar)=yrand;
end
end
%to the middle of the pixels...
xout=x-0.5;
yout=y-0.5;
|
library(tidyverse)
fbnums <- 1:50
fbmap <- function(input, mod1, mod2, exp1, exp2) {
output <- ""
if (input %% mod1 == 0) {output <- paste0(output, exp1)}
if (input %% mod2 == 0) {output <- paste0(output, exp2)}
if (output == "") {output <- as.character(input)}
return(output)
}
output <- map_chr(fbnums, ~ fbmap(.x, 3, 5, "Fizz", "Buzz"))
print(output) |
import order
import data.finset
import data.pfun
import data.set.finite
import data.list.alist
import data.vector
open classical
open alist
noncomputable theory
-- Sadly, lean does not support good inductive types.
-- Hence we won't have arbitrary arity functions and relations.
structure Signature : Type :=
(consts : ℕ)
(funcs : ℕ)
(ops : ℕ)
(rels : ℕ)
@[derive [decidable_eq]]
structure Const (S : Signature) : Type :=
(const : ℕ)
(const_le : const < S.consts)
@[derive [decidable_eq]]
structure Func (S : Signature) : Type :=
(func : ℕ)
(func_le : func < S.funcs)
@[derive [decidable_eq]]
structure Op (S : Signature) : Type :=
(op : ℕ)
(op_le : op < S.ops)
@[derive [decidable_eq]]
structure Rel (S : Signature) : Type :=
(rel : ℕ)
(rel_le : rel < S.rels)
@[derive [decidable_eq, has_zero, has_one]]
def var := ℕ
@[derive [decidable_eq]]
inductive Term (S : Signature) : Type
| Var : var → Term
| ConstT : Const S → Term
| FuncT : Func S → Term → Term
| OpT : Op S → Term → Term → Term
instance var_has_coe {S : Signature} : has_coe var (Term S) :=
⟨λ v, Term.Var v⟩
instance const_has_coe {S : Signature} : has_coe (Const S) (Term S) :=
⟨λ c, Term.ConstT c⟩
instance func_has_coe {S : Signature} : has_coe_to_fun (Func S) (λ _, Term S → Term S) :=
⟨λ f, Term.FuncT f⟩
instance op_has_coe {S : Signature} : has_coe_to_fun (Op S) (λ _, Term S → Term S → Term S) :=
⟨λ o, Term.OpT o⟩
instance {S : Signature} : inhabited (Term S) :=
⟨Term.Var 0⟩
def vars (S : Signature) : Term S → set var :=
λ t, begin
induction t with v c f t st o t₁ t₂ st₁ st₂,
exact {v},
exact ∅,
exact st,
exact st₁ ∪ st₂,
end
@[derive decidable_eq]
inductive LogicalOp : Type
| To : LogicalOp
@[derive decidable_eq]
inductive Quantifier : Type
| All : Quantifier
@[derive [decidable_eq]]
inductive Formula (S : Signature) : Type
| Eq : Term S → Term S → Formula
| RelF : Rel S → Term S → Term S → Formula
| Not : Formula → Formula
| OpL : LogicalOp → Formula → Formula → Formula
| QuantifierL : Quantifier → var → Formula → Formula
instance {S : Signature} : inhabited (Formula S) :=
⟨Formula.Eq (Term.Var 0) (Term.Var 0)⟩
def free (S : Signature) : Formula S → set var :=
λ φ,
begin
induction φ with t₁ t₂ r t₁ t₂ φ sφ o φ₁ φ₂ sφ₁ sφ₂ q v φ sφ,
exact vars S t₁ ∪ vars S t₂,
exact vars S t₁ ∪ vars S t₂,
exact sφ,
exact sφ₁ ∪ sφ₂,
exact sφ \ {v},
end
def sentence {S : Signature} (φ : Formula S) : Prop := free S φ = ∅
namespace language
variable {S : Signature}
section term
end term
section vars
lemma vars_var {v : var} : vars S (Term.Var v) = {v} := rfl
lemma vars_const {c : Const S} : vars S (Term.ConstT c) = ∅ := rfl
lemma vars_func {f : Func S} {t : Term S} : vars S (Term.FuncT f t) = vars S t := rfl
lemma vars_op {o : Op S} {t₁ t₂ : Term S} :
vars S (Term.OpT o t₁ t₂) = vars S t₁ ∪ vars S t₂ := rfl
end vars
section formula
end formula
section free
lemma free_eq {t₁ t₂ : Term S} :
free S (Formula.Eq t₁ t₂) = vars S t₁ ∪ vars S t₂ := rfl
lemma free_rel {r : Rel S} {t₁ t₂ : Term S} :
free S (Formula.RelF r t₁ t₂) = vars S t₁ ∪ vars S t₂ := rfl
lemma free_not {φ : Formula S} :
free S (Formula.Not φ) = free S φ := rfl
lemma free_opl {o : LogicalOp} {φ₁ φ₂ : Formula S} :
free S (Formula.OpL o φ₁ φ₂) = free S φ₁ ∪ free S φ₂ := rfl
lemma free_quantifier {q : Quantifier} {v : var} {φ : Formula S} :
free S (Formula.QuantifierL q v φ) = free S φ \ {v} := rfl
end free
end language
-- @[derive [has_mem, has_singleton Formula, has_union, has_emptyc, has_subset, complete_lattice]]
def Theory (S : Signature) := set (Formula S)
|
(** ** DTMC *)
Require Import Reals.
Require Import List.
Require Import ListSet.
Open Scope R_scope.
Require Import State.
Require Import TransitionMatrix.Definitions.
Require Import TransitionMatrix.Real.
Require Import Probabilities.
Record DTMC : Type := { S: set State;
s0: State;
P: TransitionMatrix R;
T: set State }.
(** Well-formed DTMC *)
Definition wf_DTMC (d: DTMC) : Prop :=
(In d.(s0) d.(S))
/\ (incl d.(T) d.(S))
/\ (forall s: State, In s d.(S) <-> StateMaps.In s d.(P))
/\ (is_stochastic_matrix d.(P)).
(** Probability of going from a given state to any other within a set of target states. *)
Variable pr_set: DTMC -> State -> set State -> R.
Hypothesis wf_dtmc_yields_valid_probability:
forall (d: DTMC) (s: State) (Tgt: set State),
(wf_DTMC d /\ In s d.(S) /\ incl Tgt d.(T)) -> is_valid_prob (pr_set d s Tgt).
(** Probability of going from a given state to another within a DTMC. *)
Definition pr (d: DTMC) (s t: State): R := pr_set d s (set_add State.eq_dec t (empty_set State)).
|
module TreeQ
%default total
%access public export
||| A tree structure for combining queries, perhaps slightly less expressive
||| than a free monad, but easier to prove total, etc. I say less expressive,
||| because I do not believe it is a monad, whereas my applicative instance
||| seems pretty solid. Moreover, it has a nice monoid instance, given a monoid
||| on the type it is parameterized over (but requiring no effort from the query
||| GADT). I have also provided a generalized semigroup operation based on
||| pairing items together. However, regrettable, it does not seem to be
||| foldable, since some of it's data is based on a future promise and isn't
||| available yet. This means it is not traversable. However, I think this may
||| be okay: ultimately the point of traversing is to push the query to the
||| outside until we're ready to run it, so the traverse instances of list,
||| maybe and either should serve us well enough, since we just barely make the
||| minimum requirement (applicative) to play ball with them.
data QryTree : (Type -> Type) -> Type -> Type where
||| Pure for monad/applicative: lift a plain value into the tree
PureLeaf : a -> QryTree q a
||| Lift a query into the tree
LiftLeaf : q i -> (i -> a) -> QryTree q a
||| Gives us a monoid operation
Branch : QryTree q a -> QryTree q b -> ((a, b) -> c) -> QryTree q c
liftQ : q a -> QryTree q a
liftQ qry = LiftLeaf qry id
infixr 5 ^+^
||| Generalized semigroup operation
(^+^) : QryTree q a -> QryTree q b -> QryTree q (a, b)
q ^+^ r = Branch q r id
Semigroup a => Semigroup (QryTree q a) where
q <+> r = Branch q r (uncurry (<+>))
Monoid a => Monoid (QryTree q a) where
neutral = PureLeaf neutral
Functor q => Functor (QryTree q) where
map f (PureLeaf x) = PureLeaf (f x)
map f (LiftLeaf q handle) = LiftLeaf q (f . handle)
map f (Branch q r handle) = Branch q r (f . handle)
-- A foldable instance does not seem possible. You could start easily enough:
-- Foldable (QryTree q) where
-- foldr func init (PureLeaf x) = func x init
-- But where would you go from there?
-- foldr func init (LiftLeaf x f) = ?foldable_moldable_2
-- foldr func init (Branch x y f) = ?foldable_moldable_3
-- The data you have promised right now is stuck in the future...
||| The s combinator, with a dash of uncurrying
s' : (a -> (b -> c)) -> (d -> b) -> (a, d) -> c
s' f g (x, y) = f x (g y)
||| I am not any good at equality proofs in Idris. However, I am not content to
||| rest uncertain about whether this applicative instance is lawful! So here
||| you go: back to geometry class: a long-hand proof, in the comments!
|||
||| identity: pure id <*> v = v
||| PureLeaf id <*> v = v
||| | PureLeaf id <*> PureLeaf x = v
||| -> PureLeaf (id x) = v
||| -> PureLeaf x = v
||| -> v = v
||| -> QED
||| | PureLeaf id <*> LiftLeaf q g = v
||| -> LiftLeaf q (id . g) = v
||| -> LiftLeaf q g = v
||| -> v = v
||| -> QED
||| | PureLeaf id <*> Branch q r g = v
||| -> Branch q r (id . g) = v
||| -> Branch q r g = v
||| -> v = v
||| -> QED
||| -> QED
|||
||| composition: pure (.) <*> u <*> v <*> w = u <*> (v <*> w)
||| PureLeaf (.) <*> u <*> v <*> w = u <*> (v <*> w)
||| PureLeaf (\f g x => f (g x)) <*> u <*> v <*> w = u <*> (v <*> w)
||| | PureLeaf (.) <*> PureLeaf u' <*> v <*> w = PureLeaf u' <*> (v <*> w)
||| | PureLeaf (u' .) <*> PureLeaf v' <*> w = PureLeaf u' <*> (PureLeaf v' <*> w)
||| -> PureLeaf (u' . v') <*> w = PureLeaf u' <*> (PureLeaf v' <*> w)
||| | PureLeaf (\x => u' (v' x)) <*> PureLeaf w' = PureLeaf u' <*> (PureLeaf v' <*> PureLeaf w')
||| -> PureLeaf (u' (v' w')) = PureLeaf u' <*> PureLeaf (v' w')
||| -> PureLeaf (u' (v' w')) = PureLeaf (u' (v' w'))
||| -> QED
||| | PureLeaf (u' . v') <*> LiftLeaf q w' = PureLeaf u' <*> (PureLeaf v' <*> LiftLeaf q w')
||| -> LiftLeaf q ((u' . v') . w') = PureLeaf u' <*> (LiftLeaf q (v' . w'))
||| -> LiftLeaf q (u' . (v' . w')) = LiftLeaf q (u' . (v' . w'))
||| -> QED
||| | PureLeaf (u' . v') <*> Branch q r w' = PureLeaf u' <*> (PureLeaf v' <*> Branch q r w')
||| -> Branch q r ((u' . v') . w') = PureLeaf u' <*> (Branch q r (v' . w'))
||| -> Branch q r (u' . (v' . w')) = Branch q r (u' . (v' . w'))
||| -> QED
||| -> QED
||| | PureLeaf (u' .) <*> LiftLeaf q v' <*> w = PureLeaf u' <*> (LiftLeaf q v' <*> w)
||| -> LiftLeaf q ((u' .) . v') <*> w = PureLeaf u' <*> (LiftLeaf q v' <*> w)
||| -> LiftLeaf q ((\g x => u' (g x)) . v') <*> w = PureLeaf u' <*> (LiftLeaf q v' <*> w)
||| -> LiftLeaf q (\y => (\g x => u' (g x)) (v' y)) <*> w = PureLeaf u' <*> (LiftLeaf q v' <*> w)
||| -> LiftLeaf q (\y x => u' (v' y x)) <*> w = PureLeaf u' <*> (LiftLeaf q v' <*> w)
||| | LiftLeaf q (\y x => u' (v' y x)) <*> PureLeaf w' = PureLeaf u' <*> (LiftLeaf q v' <*> PureLeaf w')
||| -> LiftLeaf q (\z => (\y x => u' (v' y x)) z w') = PureLeaf u' <*> (LiftLeaf q (\y => v' y w'))
||| -> LiftLeaf q (\z => (\x => u' (v' z x)) w') = LiftLeaf q (\z => u' ((\y => v' y w') z))
||| -> LiftLeaf q (\z => u' (v' z w')) = LiftLeaf q (\z => u' (v' z w'))
||| -> QED
||| | LiftLeaf q (\y x => u' (v' y x)) <*> LiftLeaf r w' = PureLeaf u' <*> (LiftLeaf q v' <*> LiftLeaf r w')
||| -> Brand (LiftLeaf q id) (LiftLeaf r id) (s' (\y x => u' (v' y x)) w') = PureLeaf u' <*> (Branch (LiftLeaf q id) (LiftLeaf r id) (s' v' w'))
||| -> Brand (LiftLeaf q id) (LiftLeaf r id) (\(a, b) => (\y x => u' (v' y x)) a (w' b)) = Branch (LiftLeaf q id) (LiftLeaf r id) (u' . s' v' w')
||| -> ... (\(a, b) => (\x => u' (v' a x)) (w' b)) = ... (u' . s' v' w')
||| -> ... (\(a, b) => u' (v' a (w' b))) = ... (u' . s' v' w')
||| -> ... (\(a, b) => u' (s' v' w' (a, b))) = ... (u' . s' v' w')
||| -> ... (\(a, b) => (u' . s' v' w') (a, b)) = ... (u' . s' v' w')
||| -> ... (u' . s' v' w') = ... (u' . s' v' w')
||| -> QED
||| | LiftLeaf q (\y x => u' (v' y x)) <*> Branch r s w' = PureLeaf u' <*> (LiftLeaf q v' <*> Branch r s w')
||| -> Brand (LiftLeaf q id) (Breanch r s id) (s' (\y x => u' (v' y x)) w') = PureLeaf u' <*> (Branch (LiftLeaf q id) (Breanch r s id) (s' v' w'))
||| -> Brand (LiftLeaf q id) (Breanch r s id) (\(a, b) => (\y x => u' (v' y x)) a (w' b)) = Branch (LiftLeaf q id) (Breanch r s id) (u' . s' v' w')
||| -> ... (\(a, b) => (\x => u' (v' a x)) (w' b)) = ... (u' . s' v' w')
||| -> ... (\(a, b) => u' (v' a (w' b))) = ... (u' . s' v' w')
||| -> ... (\(a, b) => u' (s' v' w' (a, b))) = ... (u' . s' v' w')
||| -> ... (\(a, b) => (u' . s' v' w') (a, b)) = ... (u' . s' v' w')
||| -> ... (u' . s' v' w') = ... (u' . s' v' w')
||| -> QED
||| -> QED
||| Suddenly I do the math and realized that I'm only 2/9th's done... perhaps
||| there is a better way to approach this than doing it late at night. The
||| results so far are very promising in that it seems that the same laborious
||| technique should continue to work. Perhaps this could be reduced more easily
||| by introducing some lemmas. Or by figuring out how to do it with Idris. Or
||| by researching if it has been done before. Or one could argue this way: we
||| have at this point really encountered all the scenarios. Things work right
||| if pure comes before, or after; it cancels out. LiftLeaf and Branch
||| fundamentally have the same semanticcs, and the proof above regarding the
||| semantics of the S-combinator seem conclusive for all cases involving them.
||| It seems that for a proof of this length, it is foolhardy to continue
||| without computer assistance and checking. My sense that this is not a bogus
||| implementation of applicative is quite high at this point. I leave it as an
||| exercise for the reader to complete, where by "the reader" I mean "me, I
||| hope, at some later date."
|||
||| homomorphism: pure f <*> pure x = pure (f x)
||| PureLeaf f <*> PureLeaf x = PureLeaf (f x)
||| -> QED
|||
||| interchange: u <*> pure y = pure ($ y) <*> u
||| u <*> PureLeaf y = PureLeaf ($ y) <*> u
||| | PureLeaf f <*> PureLeaf y = PureLeaf ($ y) <*> PureLeaf f
||| -> PureLeaf (f y) = PureLeaf (f $ y)
||| -> PureLeaf (f y) = PureLeaf (f y)
||| -> QED
||| | LiftLeaf q f <*> PureLeaf y = PureLeaf ($ y) <*> LiftLeaf q f
||| -> LiftLeaf q f <*> PureLeaf y = PureLeaf ($ y) <*> LiftLeaf q f
||| -> LiftLeaf q (\z => f z y) = LiftLeaf q ((\x => \g => g x) y . f)
||| -> LiftLeaf q (\z => f z y) = LiftLeaf q ((\g => g y) . f)
||| -> LiftLeaf q (\z => f z y) = LiftLeaf q (\z => (\g => g y) (f z))
||| -> LiftLeaf q (\z => f z y) = LiftLeaf q (\z => f z y)
||| -> QED
||| | Branch q r f <*> PureLeaf y = PureLeaf ($ y) <*> Branch q r f
||| -> Branch q r f <*> PureLeaf y = PureLeaf ($ y) <*> Branch q r f
||| -> Branch q r (\z => f z y) = Branch q r ((\x => \g => g x) y . f)
||| -> Branch q r (\z => f z y) = Branch q r ((\g => g y) . f)
||| -> Branch q r (\z => f z y) = Branch q r (\z => (\g => g y) (f z))
||| -> Branch q r (\z => f z y) = Branch q r (\z => f z y)
||| -> QED
||| -> QED
|||
||| These are the four properties I found needful to prove based on my
||| understanding of Haskell's Control.Applicative documentation.
Functor q => Applicative (QryTree q) where
pure = PureLeaf
(PureLeaf f) <*> (PureLeaf x) =
PureLeaf (f x)
(PureLeaf f) <*> (LiftLeaf q g) =
LiftLeaf q (f . g)
(PureLeaf f) <*> (Branch q r g) =
Branch q r (f . g)
(LiftLeaf q f) <*> (PureLeaf x) =
LiftLeaf q (\y => f y x)
(LiftLeaf q f) <*> (LiftLeaf r g) =
Branch (LiftLeaf q id) (LiftLeaf r id) $ s' f g
(LiftLeaf q f) <*> (Branch r s g) =
Branch (LiftLeaf q id) (Branch r s id) $ s' f g
(Branch q r f) <*> (PureLeaf x) =
Branch q r (\y => f y x)
(Branch q r f) <*> (LiftLeaf s g) =
Branch (Branch q r id) (LiftLeaf s id) $ s' f g
(Branch q r f) <*> (Branch s t g) =
Branch (Branch q r id) (Branch s t id) $ s' f g
-- How would you implement a monad?
-- Functor q => Monad (QryTree q) where
-- The first case would be easy:
-- (PureLeaf x) >>= f = f x
-- However, wouldn't you get stuck on these?
-- (LiftLeaf x g) >>= f = ?monads_yikes_2
-- (Branch x y g) >>= f = ?monads_yikes_3
-- It seems that we have insufficient power to smash down the results, since we
-- cannot actually produce the tree from f in these cases, without introducing
-- another lambda abstraction: but if we do that, we have to wrap it in a tree:
-- but then, inside the lambda abstraction, we cannot destroy the tree that we
-- got out of the f; I take this as a proof that there is no monad instance.
||| Example specific query GADT
data FSQry : Type -> Type where
LsFiles : String -> FSQry (List String)
ReadText : String -> FSQry String
DirExists : String -> FSQry Bool
||| Example accompanying commands, to in conjunction with the FSQry, form a sort
||| of little filesystem DSL.
data FSCmd
= WriteLines String (List String)
| CreateDir String
| DeleteFile String
| DeleteDir String
lsFiles : String -> QryTree FSQry (List String)
lsFiles = liftQ . LsFiles
readText : String -> QryTree FSQry String
readText = liftQ . ReadText
consolidate' : String -> String -> List String -> List String -> List FSCmd
consolidate' from to files texts =
map DeleteFile files
++ [ DeleteDir from
, CreateDir to
, WriteLines (to ++ "/" ++ "consolidated.txt") texts
]
-- Very sadly, it here appears that our type has insufficient power.
--consolidate : String -> String -> QryTree FSQry (List FSCmd)
consolidate from to = ?tragedy
-- (\files => consolidate' from to files <$> traverse readText files)
-- <*> lsFiles from
|
using TDD
using Test
@testset "TDD.jl" begin
# Write your tests here.
#1.
undirected_graph = [
[2, 3], #nodes reacheable from node 1
[1], #nodes reacheable from node 2
[1], #nodes reacheable from node 3
[5], #nodes reacheable from node 4
[4] #nodes reacheable from node 5
]
A_undirected_graph = Bool[ #A short for "Adjacency Matrix Format"
1 1 1 0 0;
1 1 0 0 0;
1 0 1 0 0;
0 0 0 1 1;
0 0 0 1 1;
]
#based on Figure 1 from homework, node order 2 --> 1 --> 3; 4 --> 5
directed_graph = [
[3], #nodes reacheable from node 1
[1], #nodes reacheable from node 2
[], #nodes reacheable from node 3
[5], #nodes reacheable from node 4
[] #nodes reacheable from node 5
]
A_directed_graph = Bool[
1 0 1 0 0;
1 1 0 0 0;
0 0 1 0 0;
0 0 0 1 1;
0 0 0 0 1;
]
#new test crazy case - a unidirectional train directed graph
# 8 --> 7 --> 6 --> 5 --> 4 --> 3 --> 2 --> 1
train_graph = [
[], #nodes reacheable from node 1
[1], #nodes reacheable from node 2
[2],
[3],
[4],
[5],
[6],
[7] #nodes reacheable from node 8
]
A_train_graph = Bool[
1 0 0 0 0 0 0 0;
1 1 0 0 0 0 0 0;
0 1 1 0 0 0 0 0;
0 0 1 1 0 0 0 0;
0 0 0 1 1 0 0 0;
0 0 0 0 1 1 0 0;
0 0 0 0 0 1 1 0;
0 0 0 0 0 0 1 1;
]
@test DCneighbors(undirected_graph, 1) == Set([3, 2, 1]) #Sets are unordered
@test DCneighbors(undirected_graph, 2) == Set([2, 1])
@test DCneighbors(undirected_graph, 3) == Set([3, 1])
@test DCneighbors(undirected_graph, 4) == Set([4, 5])
@test DCneighbors(undirected_graph, 5) == Set([5, 4])
@test DCneighbors(directed_graph, 1) == Set([1, 3])
@test DCneighbors(directed_graph, 2) == Set([2, 1])
@test DCneighbors(directed_graph, 3) == Set([3])
@test DCneighbors(directed_graph, 4) == Set([4, 5])
@test DCneighbors(directed_graph, 5) == Set([5])
@test DCneighbors(train_graph, 1) == Set([1])
@test DCneighbors(train_graph, 2) == Set([2,1])
@test DCneighbors(train_graph, 3) == Set([3,2])
@test DCneighbors(train_graph, 4) == Set([4,3])
@test DCneighbors(train_graph, 5) == Set([5,4])
@test DCneighbors(train_graph, 6) == Set([6,5])
@test DCneighbors(train_graph, 7) == Set([7,6])
@test DCneighbors(train_graph, 8) == Set([8,7])
@test_throws ErrorException("node does not exist") DCneighbors(undirected_graph, 6)
#2
@test ICneighbors(undirected_graph, 1) == Set([1, 2, 3])
@test ICneighbors(undirected_graph, 2) == Set([1, 2, 3])
@test ICneighbors(undirected_graph, 3) == Set([1, 2, 3])
@test ICneighbors(undirected_graph, 4) == Set([4, 5])
@test ICneighbors(undirected_graph, 5) == Set([4, 5])
@test ICneighbors(directed_graph, 1) == Set([1, 2, 3])
@test ICneighbors(directed_graph, 2) == Set([1, 2, 3])
@test ICneighbors(directed_graph, 3) == Set([1, 2, 3])
@test ICneighbors(directed_graph, 4) == Set([4, 5])
@test ICneighbors(directed_graph, 5) == Set([4, 5])
@test_throws ErrorException("node does not exist") ICneighbors(undirected_graph, 6)
#new tests
@test ICneighbors(train_graph, 1) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(train_graph, 2) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(train_graph, 3) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(train_graph, 4) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(train_graph, 5) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(train_graph, 6) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(train_graph, 7) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(train_graph, 8) == Set([1, 2, 3,4,5,6,7,8])
#3
@test AllComponents(directed_graph) == Set( [ Set([1, 2, 3]), Set([4, 5]) ] ) #for some reason need to wrap Set argument in []
@test AllComponents(undirected_graph) == Set( [ Set([1, 2, 3]), Set([4, 5]) ] )
@test AllComponents(train_graph) == Set( [ Set([1, 2, 3,4,5,6,7,8]) ] )
#4 tests for adjacency matrix format -- see matrices above, tests below (copied, changed matrices input)
@test DCneighbors(A_undirected_graph, 1) == Set([3, 2, 1]) #Sets are unordered
@test DCneighbors(A_undirected_graph, 2) == Set([2, 1]) #passes erreously
@test DCneighbors(A_undirected_graph, 3) == Set([3, 1]) #passes erreously
@test DCneighbors(A_undirected_graph, 4) == Set([4, 5])
@test DCneighbors(A_undirected_graph, 5) == Set([5, 4])
@test DCneighbors(A_directed_graph, 1) == Set([1, 3])
@test DCneighbors(A_directed_graph, 2) == Set([2, 1]) #passes erreously
@test DCneighbors(A_directed_graph, 3) == Set([3])
@test DCneighbors(A_directed_graph, 4) == Set([4, 5])
@test DCneighbors(A_directed_graph, 5) == Set([5])
@test DCneighbors(A_train_graph, 1) == Set([1]) #passes erreously
@test DCneighbors(A_train_graph, 2) == Set([2,1]) #passes erreously
@test DCneighbors(A_train_graph, 3) == Set([3,2])
@test DCneighbors(A_train_graph, 4) == Set([4,3])
@test DCneighbors(A_train_graph, 5) == Set([5,4])
@test DCneighbors(A_train_graph, 6) == Set([6,5])
@test DCneighbors(A_train_graph, 7) == Set([7,6])
@test DCneighbors(A_train_graph, 8) == Set([8,7])
@test_throws ErrorException("node does not exist") DCneighbors(undirected_graph, 6) #passes erreously (though expected? this is technicallythetruth)
#4-2
@test ICneighbors(A_undirected_graph, 1) == Set([1, 2, 3])
@test ICneighbors(A_undirected_graph, 2) == Set([1, 2, 3])
@test ICneighbors(A_undirected_graph, 3) == Set([1, 2, 3])
@test ICneighbors(A_undirected_graph, 4) == Set([4, 5])
@test ICneighbors(A_undirected_graph, 5) == Set([4, 5])
@test ICneighbors(A_directed_graph, 1) == Set([1, 2, 3])
@test ICneighbors(A_directed_graph, 2) == Set([1, 2, 3])
@test ICneighbors(A_directed_graph, 3) == Set([1, 2, 3])
@test ICneighbors(A_directed_graph, 4) == Set([4, 5])
@test ICneighbors(A_directed_graph, 5) == Set([4, 5])
@test_throws ErrorException("node does not exist") ICneighbors(undirected_graph, 6) #passes erreously (though expected? this is technicallythetruth)
#new tests
@test ICneighbors(A_train_graph, 1) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(A_train_graph, 2) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(A_train_graph, 3) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(A_train_graph, 4) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(A_train_graph, 5) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(A_train_graph, 6) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(A_train_graph, 7) == Set([1, 2, 3,4,5,6,7,8])
@test ICneighbors(A_train_graph, 8) == Set([1, 2, 3,4,5,6,7,8])
#4-3
@test AllComponents(A_directed_graph) == Set( [ Set([1, 2, 3]), Set([4, 5]) ] ) #for some reason need to wrap Set argument in []
@test AllComponents(A_undirected_graph) == Set( [ Set([1, 2, 3]), Set([4, 5]) ] )
@test AllComponents(A_train_graph) == Set( [ Set([1, 2, 3,4,5,6,7,8]) ] )
#note at this point, 7 tests for Adjacency Matrix input pass, even though I have not implemented this...
#need to go back figure out which tests erreously passed
#I assume the error exceptions. But also which others?
#Yep erroneous passes labelled in comments see above. Now gotta figure out why
#relevant bugs are in DCneighbors
#Ok so ICneighbors if input some Bool_matrix and a node, it does Bool_matrix[node] which just returns true/false, so makes sense all those tests fail right now
#AllComponents depends on ICneighbors so also makes sense those tests fail
#But DCneighbors does something different
#If I run DCneighbors(A_undirected_graph, somenode) for example it returns some Set{Int64} which may or may not pass the test
#Because it is just doing `Set(vcat(node, graph_input[node]))` which returns a Set{Int64}([node, 0 or 1 depending on if indexed value from Bool_matrix]) which may or may not be the right answer
#not gonna fix DCneighbors right now so that it correctly fails the tests, afraid gonna mess something up
#just keep this in mind. When I implement the functions with multiple dispatch specifying method for input Bool matrix this will end up being moot
end
|
import Data.Fin
fsprf : x === y -> FS x = FS y
fsprf p = cong _ p
|
(*
File: dTermDef.thy
Time-stamp: <2020-06-22T04:14:01Z>
Author: JRF
Web: http://jrf.cocolog-nifty.com/software/2016/01/post.html
Logic Image: Logics_ZF (of Isabelle2020)
*)
theory dTermDef imports ZF.Sum ZF.Nat Nth SubOcc LVariable begin
consts
dTerm :: i
dTag :: i
datatype
dTerm = dVar( "x: LVariable" )
| dBound( "n: nat" )
| dLam( "M: dTerm" )
| dApp( "M: dTerm", "N: dTerm")
datatype
dTag = TdVar( "x: LVariable" )
| TdBound( "n: nat" )
| TdLam
| TdApp
definition dArity :: "i=>i" where
"dArity(T) == dTag_case(%z. 0, %z. 0, 1, 2, T)"
definition dTerm_cons :: "[i, i]=>i" where
"dTerm_cons(T, l) = dTag_case(%z. dVar(z), %z. dBound(z),
dLam(nth(0, l)), dApp(nth(0, l), nth(1, l)), T)"
definition dOcc :: "i=>i" where
"dOcc(M) == dTerm_rec(
%x. Occ_cons(TdVar(x), []),
%n. Occ_cons(TdBound(n), []),
%N r. Occ_cons(TdLam, [r]),
%M N rm rn. Occ_cons(TdApp, [rm, rn]), M)"
definition dOccinv :: "i=>i" where
"dOccinv(x) == THE M. M: dTerm & x = dOcc(M)"
definition dSub :: "i=>i" where
"dSub(M) == {<l, dOccinv(Occ_Subtree(l, dOcc(M)))>. <l, T>: dOcc(M)}"
definition dsubterm :: "[i, i]=>i" where
"dsubterm(M, l) == THE N. <l, N>: dSub(M)"
lemma dTerm_rec_type:
assumes "M: dTerm"
and "!!x. [| x: LVariable |] ==> c(x): C(dVar(x))"
and "!!n. [| n: nat |] ==> b(n): C(dBound(n))"
and "!!M r. [| M: dTerm; r: C(M) |] ==>
h(M,r): C(dLam(M))"
and "!!M N rm rn. [| M: dTerm; N: dTerm;
rm: C(M); rn: C(N) |] ==> k(M,N,rm,rn): C(dApp(M,N))"
shows "dTerm_rec(c,b,h,k,M) : C(M)"
apply (rule assms(1) [THEN dTerm.induct])
apply (simp_all add: assms)
done
lemma dTerm_cons_eqns:
"dTerm_cons(TdVar(x), []) = dVar(x)"
"dTerm_cons(TdBound(n), []) = dBound(n)"
"dTerm_cons(TdLam, [M]) = dLam(M)"
"dTerm_cons(TdApp, [M, N]) = dApp(M, N)"
apply (simp_all add: dTerm_cons_def)
done
lemma dArity_eqns:
"dArity(TdVar(x)) = 0"
"dArity(TdBound(n)) = 0"
"dArity(TdLam) = 1"
"dArity(TdApp) = 2"
apply (simp_all add: dArity_def)
done
lemma dOcc_eqns:
"dOcc(dVar(x)) = Occ_cons(TdVar(x), [])"
"dOcc(dBound(n)) = Occ_cons(TdBound(n), [])"
"dOcc(dLam(M)) = Occ_cons(TdLam, [dOcc(M)])"
"dOcc(dApp(M, N)) = Occ_cons(TdApp, [dOcc(M), dOcc(N)])"
apply (simp_all add: dOcc_def)
done
lemma dTerm_Term_cons_intrs:
"x: LVariable ==> dTerm_cons(TdVar(x), []): dTerm"
"n: nat ==> dTerm_cons(TdBound(n), []): dTerm"
"[| M: dTerm |] ==> dTerm_cons(TdLam, [M]): dTerm"
"[| M: dTerm; N: dTerm |] ==> dTerm_cons(TdApp, [M, N]): dTerm"
apply (simp_all add: dTerm_cons_eqns)
apply (assumption | rule dTerm.intros)+
done
lemma dArity_type:
"T: dTag ==> dArity(T): nat"
apply (erule dTag.cases)
apply (simp_all add: dArity_eqns)
done
lemma dTerm_Occ_cons_cond:
"Occ_cons_cond(dTerm, dOcc, dTag, dArity)"
apply (rule Occ_cons_condI)
apply (elim dTag.cases)
apply (simp_all add: dArity_eqns)
apply (elim dTag.cases)
apply (simp_all add: dArity_eqns)
apply (rule bexI)
apply (rule dOcc_eqns)
apply (typecheck add: dTerm.intros)
apply (rule bexI)
apply (rule dOcc_eqns)
apply (typecheck add: dTerm.intros)
apply (elim bexE conjE)
apply (erule nth_0E)
apply assumption
apply simp
apply simp
apply (rule bexI)
apply (rule dOcc_eqns)
apply (typecheck add: dTerm.intros)
apply (elim bexE conjE)
apply (erule nth_0E)
apply assumption
apply simp
apply simp
apply (erule nth_0E)
apply assumption
apply simp
apply simp
apply (rule bexI)
apply (rule dOcc_eqns)
apply (typecheck add: dTerm.intros)
done
lemma dTerm_Occ_ind_cond:
"Occ_ind_cond(dTerm, dOcc, dTag, dArity, dTerm_cons)"
apply (rule Occ_ind_condI)
apply (erule dTerm.induct)
apply (drule bspec)
apply (drule_tac [2] bspec)
apply (drule_tac [3] mp)
apply (erule_tac [4] dTerm_cons_eqns [THEN subst])
apply (typecheck add: dTag.intros)
apply (simp add: dTerm_cons_eqns dArity_eqns dOcc_eqns)
apply (typecheck add: dTerm.intros)
apply (drule bspec)
apply (drule_tac [2] bspec)
apply (drule_tac [3] mp)
apply (erule_tac [4] dTerm_cons_eqns [THEN subst])
apply (typecheck add: dTag.intros)
apply (simp add: dTerm_cons_eqns dArity_eqns dOcc_eqns)
apply (typecheck add: dTerm.intros)
apply (drule bspec)
apply (drule_tac [2] bspec)
apply (drule_tac [3] mp)
apply (erule_tac [4] dTerm_cons_eqns [THEN subst])
apply (typecheck add: dTag.intros)
apply (simp add: dTerm_cons_eqns dArity_eqns dOcc_eqns)
apply (typecheck add: dTerm.intros)
apply (drule bspec)
apply (drule_tac [2] bspec)
apply (drule_tac [3] mp)
apply (erule_tac [4] dTerm_cons_eqns [THEN subst])
apply (typecheck add: dTag.intros)
apply (simp add: dTerm_cons_eqns dArity_eqns dOcc_eqns)
apply (typecheck add: dTerm.intros)
done
lemma dTerm_Term_cons_inj_cond:
"Term_cons_inj_cond(dTerm, dTag, dArity, dTerm_cons)"
apply (rule Term_cons_inj_condI)
apply (rule iffI)
apply (elim dTag.cases)
prefer 17
apply (elim dTag.cases)
apply (simp_all add: dTerm_cons_def dArity_def)
done
lemmas dTerm_Term_cons_typechecks = (* nth_typechecks *)
dTerm_Term_cons_intrs dTag.intros
dArity_type Occ_ind_cond_Occ_domain [OF dTerm_Occ_ind_cond]
Occ_ind_cond_Occ_in_Occ_range [OF dTerm_Occ_ind_cond]
PowI succI1 succI2 (* consI1 *)consI2 (* nat_0I nat_succI *)
declare dTerm_Term_cons_typechecks [TC]
lemmas dTerm_Term_cons_simps = dArity_eqns (* dTerm_cons_eqns [THEN sym] *)
declare dTerm_Term_cons_simps [simp]
lemmas dTerm_cons_eqns_sym = dTerm_cons_eqns [THEN sym]
end
|
Formal statement is: lemma filterlim_uminus_at_top: "(LIM x F. f x :> at_top) \<longleftrightarrow> (LIM x F. - (f x) :: real :> at_bot)" Informal statement is: The filter $\{f(x) \mid x \in F\}$ converges to $\infty$ if and only if the filter $\{-f(x) \mid x \in F\}$ converges to $-\infty$. |
If $I$ is a finite set and $F_i$ is a measurable set for each $i \in I$, then the measure of the union of the $F_i$ is less than or equal to the sum of the measures of the $F_i$. |
-- @@stderr --
dtrace: failed to compile script test/unittest/translators/err.D_XLATE_REDECL.RepeatTransDecl.d: [D_XLATE_REDECL] line 39: translator from struct input_struct * to struct output_struct has already been declared
|
function y = sum_square_pos( x, dim )
%SUM_SQUARE_POS Sum of squares of the positive parts.
% For vectors, SUM_SQUARE(X) is the sum of the squares of the positive
% parts of X; i.e., SUM( MAX(X,0)^2 ). X must be real.
%
% For matrices, SUM_SQUARE_POS(X) is a row vector containing the
% application of SUM_SQUARE_POS to each column. For N-D arrays, the
% SUM_SQUARE_POS operation is applied to the first non-singleton
% dimension of X.
%
% SUM_SQUARE_POS(X,DIM) takes the sum along the dimension DIM of X.
%
% Disciplined convex programming information:
% SUM_SQUARE_POS(X,...) is convex and nondecreasing in X. Thus, when
% used in CVX expressions, X must be convex (or affine). DIM must
% always be constant.
error( nargchk( 1, 2, nargin ) );
if nargin == 2,
y = sum( square_pos( x ), dim );
else
y = sum( square_pos( x ) );
end
% Copyright 2010 Michael C. Grant and Stephen P. Boyd.
% See the file COPYING.txt for full copyright information.
% The command 'cvx_where' will show where this file is located.
|
[STATEMENT]
lemma index_valid_indices_state: "index_valid as s \<Longrightarrow> indices_state s \<subseteq> fst ` as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. index_valid as s \<Longrightarrow> indices_state s \<subseteq> fst ` as
[PROOF STEP]
unfolding index_valid_def indices_state_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<forall>x b i. (Mapping.lookup (\<B>\<^sub>i\<^sub>l s) x = Some (i, b) \<longrightarrow> (i, Geq x b) \<in> as) \<and> (Mapping.lookup (\<B>\<^sub>i\<^sub>u s) x = Some (i, b) \<longrightarrow> (i, Leq x b) \<in> as) \<Longrightarrow> {i. \<exists>x b. Mapping.lookup (\<B>\<^sub>i\<^sub>l s) x = Some (i, b) \<or> Mapping.lookup (\<B>\<^sub>i\<^sub>u s) x = Some (i, b)} \<subseteq> fst ` as
[PROOF STEP]
by force |
module DietRecommender
using ProgressMeter
using Serialization
using DataFrames
using CSV
using Query
using JuMP
using Ipopt
using Juniper
using StatsBase: sample
include("get_data.jl")
include("optimize.jl")
include("return_diet.jl")
end # module
|
push!(LOAD_PATH, "../src/")
using Documenter, Normalize
# Check docstring examples
DocMeta.setdocmeta!(Normalize, :DocTestSetup, :(using Normalize, DataFrames); recursive=true)
makedocs(modules=[Normalize], sitename="Normalize.jl")
deploydocs(repo="https://github.com/muhadamanhuri/Normalize.jl.git") |
{-# OPTIONS --cubical --safe #-}
module Data.Fin.Injective where
open import Prelude
open import Data.Fin.Base
open import Data.Fin.Properties using (discreteFin)
open import Data.Nat
open import Data.Nat.Properties using (+-comm)
open import Function.Injective
private
variable n m : ℕ
infix 4 _≢ᶠ_ _≡ᶠ_
_≢ᶠ_ _≡ᶠ_ : Fin n → Fin n → Type _
n ≢ᶠ m = T (not (discreteFin n m .does))
n ≡ᶠ m = T (discreteFin n m .does)
_F↣_ : ℕ → ℕ → Type
n F↣ m = Σ[ f ⦂ (Fin n → Fin m) ] × ∀ {x y} → x ≢ᶠ y → f x ≢ᶠ f y
shift : (x y : Fin (suc n)) → x ≢ᶠ y → Fin n
shift f0 (fs y) x≢y = y
shift {suc _} (fs x) f0 x≢y = f0
shift {suc _} (fs x) (fs y) x≢y = fs (shift x y x≢y)
shift-inj : ∀ (x y z : Fin (suc n)) x≢y x≢z → y ≢ᶠ z → shift x y x≢y ≢ᶠ shift x z x≢z
shift-inj f0 (fs y) (fs z) x≢y x≢z x+y≢x+z = x+y≢x+z
shift-inj {suc _} (fs x) f0 (fs z) x≢y x≢z x+y≢x+z = tt
shift-inj {suc _} (fs x) (fs y) f0 x≢y x≢z x+y≢x+z = tt
shift-inj {suc _} (fs x) (fs y) (fs z) x≢y x≢z x+y≢x+z = shift-inj x y z x≢y x≢z x+y≢x+z
shrink : suc n F↣ suc m → n F↣ m
shrink (f , inj) .fst x = shift (f f0) (f (fs x)) (inj tt)
shrink (f , inj) .snd p = shift-inj (f f0) (f (fs _)) (f (fs _)) (inj tt) (inj tt) (inj p)
¬plus-inj : ∀ n m → ¬ (suc (n + m) F↣ m)
¬plus-inj zero zero (f , _) = f f0
¬plus-inj zero (suc m) inj = ¬plus-inj zero m (shrink inj)
¬plus-inj (suc n) m (f , p) = ¬plus-inj n m (f ∘ fs , p)
toFin-inj : (Fin n ↣ Fin m) → n F↣ m
toFin-inj f .fst = f .fst
toFin-inj (f , inj) .snd {x} {y} x≢ᶠy with discreteFin x y | discreteFin (f x) (f y)
... | no ¬p | yes p = ¬p (inj _ _ p)
... | no _ | no _ = tt
n≢sn+m : ∀ n m → Fin n ≢ Fin (suc (n + m))
n≢sn+m n m n≡m =
¬plus-inj m n
(toFin-inj
(subst
(_↣ Fin n)
(n≡m ; cong (Fin ∘ suc) (+-comm n m))
refl-↣))
Fin-inj : Injective Fin
Fin-inj n m eq with compare n m
... | equal _ = refl
... | less n k = ⊥-elim (n≢sn+m n k eq)
... | greater m k = ⊥-elim (n≢sn+m m k (sym eq))
|
rm(list=ls())
setwd("/Users/davidbeauchesne/Dropbox/PhD/PhD_obj2/Structure_Comm_EGSL/Predict_network/")
# Libraries
library(reshape2)
library(tidyr)
library(dplyr)
library(sp)
library(rgdal)
# Add fonts
#install.packages('showtext', dependencies = TRUE)
library(showtext)
showtext.auto()
xx <- font.files()
font.add(family = 'Triforce', regular = 'Triforce.ttf')
font.add(family = 'regText', regular = 'Alegreya-Regular.otf')
# font.add(family = 'Hylia', regular = 'HyliaSerifBeta-Regular.otf')
# font.add(family = 'HylianSymbols', regular = 'HylianSymbols.ttf')
# Functions
source('../../../PhD_RawData/script/function/colorBar.r')
source('../../../PhD_RawData/script/function/plotEGSL.r')
# Load files
# Species occurrence probabilities for the St. Lawrence
predEGSL <- readRDS('../EGSL_species_distribution/RData/predEGSL.rds')
# EGSL species list from JSDM analysis
sp <- readRDS('./RData/spEGSL.rds')
nSp <- nrow(sp) # number of taxa
# Complete list of EGSL species
load("../Interaction_catalog/RData/sp_egsl.RData")
# Network predictions with interactions per cell
networkPredict <- readRDS('./RData/networkPredict.rds')
networkFoodWeb <- readRDS('./RData/networkFoodWeb.rds')
# Load grid
egsl_grid <- readOGR(dsn = "../../../PhD_obj0/Study_Area/RData/", layer = "egsl_grid") # Load grid
# Measure link density
linkDensity <- numeric(length(networkFoodWeb))
for(i in 1:length(networkFoodWeb)){
if(is.null(networkFoodWeb[[i]])) {
next
} else {
linkDensity[i] <- sum(networkFoodWeb[[i]]) / nrow(networkFoodWeb[[i]])
}
}
# EGSL contour
egsl <- readOGR(dsn = "/Users/davidbeauchesne/Dropbox/PhD/PhD_RawData/data/EGSL", layer = "egsl")
# egsl <- rgeos::gSimplify(egsl, 100, topologyPreserve=TRUE)
# clip <- rgeos::gIntersection(egsl_grid, egsl, byid = TRUE, drop_lower_td = TRUE)
# Plot
# Color palette
rbPal <- colorRampPalette(c('#B8CEED','#0E1B32')) # color palette
cols <- rbPal(50)[as.numeric(cut(linkDensity, breaks = 50))]
textCol <- '#21120A'
# pdf('/users/davidbeauchesne/dropbox/phd/phd_obj2/Structure_Comm_EGSL/Predict_network/communication/linkDensity.pdf', width = 13, height = 13, pointsize = 25) # , units = 'in', res = 300
png('/users/davidbeauchesne/dropbox/phd/phd_obj2/Structure_Comm_EGSL/Predict_network/communication/linkDensity_CHONeII.png', width = 13, height = 13, pointsize = 25, units = 'in', res = 300)
layout(matrix(c(1,1,1,0,2,0),ncol=2), width = c(9,1), height = c(3,3,3))
# layout(matrix(c(1,1,0,1,1,2,1,1,0),ncol=3), width = c(3,3,3), height = c(9,1))
par(mar = c(0,0,0,0), bg = 'transparent', family = 'regText', col.lab = textCol, col.axis = textCol, col = textCol)
plot(egsl_grid, col = cols, border = cols)
# text(x = 527500, y = 950000, labels = 'Link density (l/s)', cex = 1.5, family = 'Triforce', adj = 0.5)
# text(x = 527500, y = 925000, labels = 'Link density (l/s)', cex = 2, family = 'Triforce', adj = 1)
plot(egsl, border = 'black', col = 'transparent', add = TRUE) # plot EGSL contour
# colorBar(rbPal(50), min = round(min(linkDensity, na.rm = T),1), max = round(max(linkDensity, na.rm = T),1), align = 'horizontal')
colorBar(rbPal(50), min = round(min(linkDensity, na.rm = T),1), max = round(max(linkDensity, na.rm = T),1), align = 'vertical')
dev.off()
|
module InfoWithImplicit
import public Language.Reflection.Pretty
import public Language.Reflection.Syntax
import public Language.Reflection.Types
import Data.Vect
import Mb
%language ElabReflection
data X : Vect n a -> Type where
XX : X []
export
inf : TypeInfo
inf = getInfo "X"
export
mbInf : TypeInfo
mbInf = getInfo "T"
-- `T` and its constructors are visible even when they are not exported
|
(* Title: HOL/Auth/n_germanSymIndex_lemma_inv__7_on_rules.thy
Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
*)
header{*The n_germanSymIndex Protocol Case Study*}
theory n_germanSymIndex_lemma_inv__7_on_rules imports n_germanSymIndex_lemma_on_inv__7
begin
section{*All lemmas on causal relation between inv__7*}
lemma lemma_inv__7_on_rules:
assumes b1: "r \<in> rules N" and b2: "(\<exists> p__Inv0 p__Inv2. p__Inv0\<le>N\<and>p__Inv2\<le>N\<and>p__Inv0~=p__Inv2\<and>f=inv__7 p__Inv0 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
proof -
have c1: "(\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvReqS N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvReqE N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendGntS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)\<or>
(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)"
apply (cut_tac b1, auto) done
moreover {
assume d1: "(\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_StoreVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqSVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqE__part__0Vsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendReqE__part__1Vsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqS N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvReqSVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqE N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvReqEVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInv__part__0Vsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInv__part__1Vsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendInvAckVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvInvAckVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendGntS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendGntSVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_SendGntEVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvGntSVsinv__7) done
}
moreover {
assume d1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)"
have "invHoldForRule s f r (invariants N)"
apply (cut_tac b2 d1, metis n_RecvGntEVsinv__7) done
}
ultimately show "invHoldForRule s f r (invariants N)"
by satx
qed
end
|
open import Relation.Nullary using (¬_; Dec; yes; no)
open import Relation.Binary using (Decidable)
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
open import Relation.Nullary.Decidable using (False; map)
open import Function.Equivalence as FE using ()
module AKS.Nat.Base where
open import Agda.Builtin.FromNat using (Number)
open import Data.Nat using (ℕ; _+_; _∸_; _*_; _≟_; _<ᵇ_; pred) public
open ℕ public
open import Data.Nat.Literals using (number)
instance
ℕ-number : Number ℕ
ℕ-number = number
data ℕ⁺ : Set where
ℕ+ : ℕ → ℕ⁺
_+⁺_ : ℕ⁺ → ℕ⁺ → ℕ⁺
ℕ+ n +⁺ ℕ+ m = ℕ+ (suc (n + m))
_*⁺_ : ℕ⁺ → ℕ⁺ → ℕ⁺
ℕ+ n *⁺ ℕ+ m = ℕ+ (n + m * (suc n))
_≟⁺_ : Decidable {A = ℕ⁺} _≡_
ℕ+ n ≟⁺ ℕ+ m = map (FE.equivalence (λ { refl → refl }) (λ { refl → refl })) (n ≟ m)
⟅_⇑⟆ : ∀ n {≢0 : False (n ≟ zero)} → ℕ⁺
⟅ suc n ⇑⟆ = ℕ+ n
⟅_⇓⟆ : ℕ⁺ → ℕ
⟅ ℕ+ n ⇓⟆ = suc n
instance
ℕ⁺-number : Number ℕ⁺
ℕ⁺-number = record
{ Constraint = λ n → False (n ≟ zero)
; fromNat = λ n {{≢0}} → ⟅ n ⇑⟆ {≢0}
}
infix 4 _≤_
record _≤_ (n : ℕ) (m : ℕ) : Set where
constructor lte
field
k : ℕ
≤-proof : n + k ≡ m
infix 4 _≥_
_≥_ : ℕ → ℕ → Set
n ≥ m = m ≤ n
infix 4 _≰_
_≰_ : ℕ → ℕ → Set
n ≰ m = ¬ (n ≤ m)
infix 4 _≱_
_≱_ : ℕ → ℕ → Set
n ≱ m = ¬ (m ≤ n)
infix 4 _<_
_<_ : ℕ → ℕ → Set
n < m = suc n ≤ m
infix 4 _≮_
_≮_ : ℕ → ℕ → Set
n ≮ m = ¬ (n < m)
infix 4 _>_
_>_ : ℕ → ℕ → Set
n > m = m < n
infix 4 _≯_
_≯_ : ℕ → ℕ → Set
n ≯ m = m ≮ n
|
Require Import VST.floyd.proofauto.
Require Import VST.floyd.library.
Require Import stringlist.
Require Import FunInd.
Require FMapWeakList.
Require Coq.Strings.String.
Require Import DecidableType.
Require Import Program.Basics. Open Scope program_scope.
Require Import Structures.OrdersEx.
Require Import VST.msl.wand_frame.
Require Import VST.msl.iter_sepcon.
Require Import VST.floyd.reassoc_seq.
Require Import VST.floyd.field_at_wand.
Require Import definitions.
Instance CompSpecs : compspecs. make_compspecs prog. Defined.
Definition Vprog : varspecs. mk_varspecs prog. Defined.
Set Default Timeout 20.
(* ------------------------ DEFINITIONS ------------------------ *)
(* string as a decidable type *)
Module Str_as_DT <: DecidableType.
Definition t := string.
Definition eq := @eq t.
Definition eq_refl := @eq_refl t.
Definition eq_sym := @eq_sym t.
Definition eq_trans := @eq_trans t.
Definition eq_dec : forall x y, { eq x y }+{ ~eq x y }.
Proof. apply string_dec. Qed.
End Str_as_DT.
Module stringlist := FMapWeakList.Make Str_as_DT.
Definition t_scell := Tstruct _scell noattr.
Definition t_stringlist := Tstruct _stringlist noattr.
(* convert between Coq string type & list of bytes *)
Fixpoint string_to_list_byte (s: string) : list byte :=
match s with
| EmptyString => nil
| String a s' => Byte.repr (Z.of_N (Ascii.N_of_ascii a)) :: string_to_list_byte s'
end.
Fixpoint length (s : string) : nat :=
match s with
| EmptyString => O
| String c s' => S (length s')
end.
Definition string_rep (s: string) (p: val) : mpred := !! (~ List.In Byte.zero (string_to_list_byte s)) &&
data_at Ews (tarray tschar (Z.of_nat(length(s)) + 1)) (map Vbyte (string_to_list_byte s ++ [Byte.zero])) p.
Lemma length_string_list_byte_eq:
forall str: string, Z.of_nat (length str) = Zlength (string_to_list_byte str).
Proof.
intros str. induction str.
- simpl. auto.
- unfold length; fold length. unfold string_to_list_byte; fold string_to_list_byte.
autorewrite with sublist. rewrite <- IHstr. apply Nat2Z.inj_succ.
Qed.
Definition string_rep_local_facts:
forall s p, string_rep s p |-- !! (is_pointer_or_null p /\
0 <= Z.of_nat (length s) + 1 <= Ptrofs.max_unsigned).
Proof.
intros. assert (K: string_rep s p |-- cstring Ews (string_to_list_byte s) p).
unfold string_rep. unfold cstring. rewrite length_string_list_byte_eq. entailer!.
sep_apply K. sep_apply cstring_local_facts. entailer!.
rewrite length_string_list_byte_eq. split.
assert (M: 0 <= Zlength (string_to_list_byte s)). apply Zlength_nonneg. omega.
rewrite <- initialize.max_unsigned_modulus in H. omega.
Qed.
Hint Resolve string_rep_local_facts: saturate_local.
Fixpoint scell_rep (l: list (string*V)) (p: val): mpred :=
match l with
| [] => !!(p = nullval) && emp
| (k, v) :: tl => EX q:val, EX str_ptr: val,
malloc_token Ews t_scell p *
data_at Ews t_scell (str_ptr, (V_repr v, q)) p *
string_rep k str_ptr *
malloc_token Ews (tarray tschar (Z.of_nat (length k) + 1)) str_ptr *
scell_rep tl q
end.
Definition scell_rep_local_facts:
forall l p, scell_rep l p |-- !! (is_pointer_or_null p /\ (p=nullval <-> l = [])).
Proof.
intros l. induction l as [ | [] tl]; intro p; simpl.
+ entailer!. easy.
+ Intros q str_ptr. unfold string_rep. entailer!. now apply field_compatible_nullval1 in H1.
Qed.
Hint Resolve scell_rep_local_facts: saturate_local.
Definition scell_rep_valid_pointer:
forall l p, scell_rep l p |-- valid_pointer p.
Proof. intros [|[]] p; cbn; entailer. Qed.
Hint Resolve scell_rep_valid_pointer: valid_pointer.
Import stringlist.
Definition stringlist_rep (lst: stringlist.t V) (p: val): mpred :=
let elts := elements lst in
EX cell_ptr: val,
malloc_token Ews t_stringlist p *
data_at Ews t_stringlist cell_ptr p *
scell_rep elts cell_ptr.
Definition stringlist_rep_local_facts:
forall lst p, stringlist_rep lst p |-- !! (is_pointer_or_null p).
Proof.
intros. unfold stringlist_rep. Intros cell_ptr. entailer!.
Qed.
(* ------------------------ STRLIB SPECS ------------------------ *)
Definition strcmp_spec :=
DECLARE _strcmp
WITH str1 : val, s1 : list byte, str2 : val, s2 : list byte
PRE [ 1 OF tptr tschar, 2 OF tptr tschar ]
PROP ()
LOCAL (temp 1 str1; temp 2 str2)
SEP (cstring Ews s1 str1; cstring Ews s2 str2)
POST [ tint ]
EX i : int,
PROP (if Int.eq_dec i Int.zero then s1 = s2 else s1 <> s2)
LOCAL (temp ret_temp (Vint i))
SEP (cstring Ews s1 str1; cstring Ews s2 str2).
Definition strcpy_spec :=
DECLARE _strcpy
WITH dest : val, n : Z, src : val, s : list byte
PRE [ 1 OF tptr tschar, 2 OF tptr tschar ]
PROP (Zlength s < n)
LOCAL (temp 1 dest; temp 2 src)
SEP (data_at_ Ews (tarray tschar n) dest; cstring Ews s src)
POST [ tptr tschar ]
PROP ()
LOCAL (temp ret_temp dest)
SEP (cstringn Ews s n dest; cstring Ews s src).
Definition strlen_spec :=
DECLARE _strlen
WITH s : list byte, str: val
PRE [ 1 OF tptr tschar ]
PROP ( )
LOCAL (temp 1 str)
SEP (cstring Ews s str)
POST [ size_t ]
PROP ()
LOCAL (temp ret_temp (Vptrofs (Ptrofs.repr (Zlength s))))
SEP (cstring Ews s str).
(* ------------------------ STRINGLIST.V SPECS ------------------------ *)
Definition stringlist_new_spec: ident * funspec :=
DECLARE _stringlist_new
WITH gv: globals
PRE [ ]
PROP()
LOCAL(gvars gv)
SEP(mem_mgr gv)
POST [ tptr t_stringlist]
EX p:val,
PROP()
LOCAL(temp ret_temp p)
SEP(stringlist_rep (stringlist.empty V) p; mem_mgr gv).
Definition copy_string_spec: ident * funspec :=
DECLARE _copy_string
WITH wsh: share, s : val, str : string, gv: globals
PRE [ _s OF tptr tschar ]
PROP ()
LOCAL (temp _s s; gvars gv)
SEP (string_rep str s; mem_mgr gv)
POST [ tptr tschar ]
EX p: val,
PROP ()
LOCAL (temp ret_temp p)
SEP (string_rep str s; string_rep str p;
malloc_token Ews (tarray tschar (Z.of_nat(length(str)) + 1)) p;
mem_mgr gv).
Definition new_scell_spec: ident * funspec :=
DECLARE _new_scell
WITH gv: globals, k: val, str: string, value: V, pnext: val, tl: list (string*V)
PRE [ _key OF tptr tschar, _value OF tptr tvoid, _next OF tptr t_scell ]
PROP()
LOCAL(gvars gv; temp _key k; temp _value (V_repr value); temp _next pnext)
SEP(string_rep str k; scell_rep tl pnext; mem_mgr gv)
POST [ tptr t_scell ]
EX p:val,
PROP()
LOCAL(temp ret_temp p)
SEP(string_rep str k * scell_rep ((str, value) :: tl) p; mem_mgr gv).
Definition Gprog : funspecs :=
ltac:(with_library prog [ strcmp_spec; strcpy_spec; strlen_spec;
stringlist_new_spec; copy_string_spec; new_scell_spec]).
(* --------------------------HELPERS-------------------------- *)
Lemma scell_rep_modus: forall lst1 lst2 q, scell_rep lst1 q * (scell_rep lst1 q -* scell_rep lst2 q)
|-- scell_rep lst2 q.
Proof.
intros. apply wand_frame_elim'. entailer!.
Qed.
Definition stringlist_hole_rep (lst1: list (string * V)) (lst: stringlist.t V) (p: val) (q: val): mpred :=
EX cell_ptr: val,
malloc_token Ews t_stringlist p *
data_at Ews t_stringlist cell_ptr p *
(scell_rep lst1 q * (scell_rep lst1 q -* scell_rep (elements lst) cell_ptr)).
Lemma ascii_range: forall a, 0 <= Z.of_N (Ascii.N_of_ascii a) <= Byte.max_unsigned.
Proof.
intros. destruct a. destruct b, b0, b1, b2, b3, b4, b5, b6; simpl; rep_omega.
Qed.
Lemma list_byte_eq: forall s str, string_to_list_byte s = string_to_list_byte str <-> s = str.
Proof.
split.
{ intros. generalize dependent str. induction s.
- intros. inversion H. destruct str.
+ auto.
+ inversion H1.
- intros. destruct str.
+ inversion H.
+ simpl in H. set (b:= Byte.repr (Z.of_N (Ascii.N_of_ascii a))) in *.
set (b0:= Byte.repr (Z.of_N (Ascii.N_of_ascii a0))) in *. assert (K: b = b0) by congruence.
unfold b, b0 in K.
apply f_equal with (f:= Byte.unsigned) in K. rewrite !Byte.unsigned_repr in K.
apply N2Z.inj in K.
apply f_equal with (f:= Ascii.ascii_of_N) in K.
rewrite !Ascii.ascii_N_embedding in K. f_equal. auto. inversion H. auto.
apply ascii_range. apply ascii_range. }
{ intros. f_equal. auto. }
Qed.
Lemma notin_lst_find_none: forall str lst,
~ Raw.PX.In str (elements (elt:=V) lst) -> find (elt:=V) str lst = None.
Proof.
intros. case_eq (find (elt := V) str lst).
- intros v hfind%find_2. unfold Raw.PX.In in H. unfold MapsTo in hfind.
unfold not in H. exfalso. apply H. exists v. auto.
- intros. auto.
Qed.
(* ------------------------ BODY PROOFS ------------------------ *)
Lemma body_stringlist_new: semax_body Vprog Gprog f_stringlist_new stringlist_new_spec.
Proof.
start_function.
forward_call (t_stringlist, gv).
{ split3; auto. cbn. computable. }
Intros p.
forward_if
(PROP ( )
LOCAL (temp _p p; gvars gv)
SEP (mem_mgr gv; malloc_token Ews t_stringlist p * data_at_ Ews t_stringlist p)).
{ destruct eq_dec; entailer. }
{ forward_call tt. entailer. }
{ forward. rewrite if_false by assumption. entailer. }
{ Intros. forward. forward. Exists p. entailer!.
unfold stringlist_rep. unfold stringlist.empty. simpl.
Exists nullval. entailer!. }
Qed.
Lemma body_copy_string: semax_body Vprog Gprog f_copy_string copy_string_spec.
Proof.
start_function. forward_call (string_to_list_byte str, s).
- unfold string_rep. unfold cstring. entailer!.
assert (L: Z.of_nat (length str) = Zlength (string_to_list_byte str)).
{ apply length_string_list_byte_eq. }
rewrite L. entailer!.
- unfold tint. forward. sep_apply cstring_local_facts. Intros.
forward_call (tarray tschar (Zlength (string_to_list_byte str) + 1), gv).
+ unfold cstring. simpl. entailer!.
repeat f_equal.
remember (Int64.unsigned (Int64.repr (Zlength (string_to_list_byte str) +
Int.signed (Int.repr 1)))) as z.
rewrite Int64.unsigned_repr_eq in Heqz.
rewrite <- Ptrofs.modulus_eq64 in Heqz; auto.
replace (Int.signed (Int.repr 1)) with 1 in *; auto.
replace ((Zlength (string_to_list_byte str) + 1) mod Ptrofs.modulus)
with (Zlength (string_to_list_byte str) + 1) in Heqz.
2: rewrite Zmod_small; auto; split; auto; rep_omega.
subst. admit.
+ split; auto. assert (M: 0 <= Zlength (string_to_list_byte str)).
apply Zlength_nonneg. rewrite sizeof_tarray_tschar; auto.
split. omega.
rewrite <- initialize.max_unsigned_modulus in H. omega.
omega.
+ autorewrite with norm. Intros p. forward_if (p <> nullval).
if_tac; entailer!.
* rewrite if_true by auto. forward_call tt. entailer!.
* forward. entailer!.
* Intros. rewrite if_false by auto.
forward_call (p, Zlength (string_to_list_byte str) + 1, s, string_to_list_byte str).
{ entailer!. }
{ omega. }
{ forward. Exists p. entailer!.
unfold cstringn, cstring, string_rep; entailer!.
autorewrite with sublist. rewrite <- length_string_list_byte_eq.
entailer!. }
Admitted.
Lemma body_new_scell: semax_body Vprog Gprog f_new_scell new_scell_spec.
Proof.
start_function.
forward_call (t_scell, gv).
{ now compute. }
Intros p. forward_if (p <> nullval).
if_tac; entailer!.
- forward_call tt. entailer!.
- forward. entailer!.
- Intros. rewrite if_false by auto. Intros.
forward_call (Ews, k, str, gv).
Intros cp. forward. forward. forward. forward.
Exists p. entailer!. unfold scell_rep at 2; fold scell_rep.
Exists pnext cp. entailer!.
Qed.
|
using Test
using MARY_fRG.Basics
@testset "长方形" begin
rect1 = Rectangle(Point2D(0., 0.), 1, 2)
println(rect1)
@test area(rect1) == 2
end
@testset "正方形" begin
squ1 = Square(Point2D(0., 0.), 2)
println(squ1)
@test area(squ1) == 4
end
|
module PiyushSati.Odds
import Evens
import Intro
--Answer 1
data IsOdd : Nat -> Type where
OneOdd : IsOdd (S Z)
SSOdd : (n: Nat) -> IsOdd n -> IsOdd (S(S n))
--Answer 2
ThreeOdd : IsOdd 3
ThreeOdd = SSOdd 1 OneOdd
--Answer 3
TwoEven: IsOdd 2-> Void
TwoEven OneOdd impossible
TwoEven (SSOdd _ _) impossible
--Answer 5
nEvenSnOdd: (n: Nat) -> IsEven n -> IsOdd (S n)
nEvenSnOdd Z ZEven = OneOdd
nEvenSnOdd (S (S n)) (SSEven n nEven) = SSOdd (S n) (nEvenSnOdd n nEven)
--Answer 4
nOddSnEven: (n: Nat) -> IsOdd n -> IsEven (S n)
nOddSnEven (S Z) OneOdd = SSEven Z ZEven
nOddSnEven (S (S n)) (SSOdd n nOdd) = SSEven (S n) (nOddSnEven n nOdd)
--Answer 6
nEvenOrOdd : (n: Nat) -> Either (IsEven n) (IsOdd n)
nEvenOrOdd Z = Left ZEven
nEvenOrOdd (S Z) = Right OneOdd
nEvenOrOdd (S n) = case (nEvenOrOdd n) of
(Left nEven) => Right (nEvenSnOdd n nEven)
(Right nOdd) => Left (nOddSnEven n nOdd)
--Answer 7
nEvenAndOdd : (n: Nat) -> IsEven n -> IsOdd n -> Void
nEvenAndOdd Z ZEven OneOdd impossible
nEvenAndOdd (S Z) (SSEven _ _) OneOdd impossible
nEvenAndOdd (S (S n)) (SSEven n x) (SSOdd n y) = nEvenAndOdd n x y
--Answer 8
SumTwoOdd : (n: Nat) -> (m: Nat) -> IsOdd n -> IsOdd m -> IsEven (add n m)
SumTwoOdd (S Z) m OneOdd mOdd = (nOddSnEven m mOdd)
SumTwoOdd (S (S n)) m (SSOdd n nOdd) mOdd = SSEven (add n m) (SumTwoOdd n m nOdd mOdd)
--
apNat : (f: Nat -> Nat) -> (n: Nat) -> (m: Nat) -> n = m -> f n = f m
apNat f m m Refl = Refl
--Answer 9
MinusOneByTwo : (n: Nat) -> IsOdd n -> (m: Nat ** S (double m) = n)
MinusOneByTwo (S Z) OneOdd = (Z **Refl)
MinusOneByTwo (S (S n)) (SSOdd n nOdd) = step where
step = case (MinusOneByTwo n nOdd) of
(m ** x) => ((S m) ** apNat (\l => S (S l)) (S(double m)) n x)
|
import QL.FOL.deduction
universes u v
open_locale logic_symbol
namespace fol
open logic subformula
variables (L : language.{u})
structure Structure (L : language.{u}) :=
(dom : Type u)
(fn : ∀ {n}, L.fn n → (fin n → dom) → dom)
(pr : ∀ {n}, L.pr n → (fin n → dom) → Prop)
instance Structure_coe {L : language} : has_coe_to_sort (Structure L) (Type*) := ⟨Structure.dom⟩
structure nonempty_Structure (L : language.{u}) extends Structure L :=
(dom_inhabited : inhabited dom)
instance nonempty_to_Structure_coe (L : language.{u}) : has_coe_t (nonempty_Structure L) (Structure L) := ⟨nonempty_Structure.to_Structure⟩
instance nonempty_Structure_dom_coe {L : language} : has_coe_to_sort (nonempty_Structure L) (Type*) :=
⟨λ S, ((S : Structure L) : Type*)⟩
instance (S : nonempty_Structure L) : inhabited S := S.dom_inhabited
structure finite_Structure (L : language.{u}) extends Structure L :=
(dom_finite : finite dom)
instance finite_Structure_coe (L : language.{u}) : has_coe_t (finite_Structure L) (Structure L) := ⟨finite_Structure.to_Structure⟩
variables {L} {μ : Type v} {μ₁ : Type*} {μ₂ : Type*}
open subterm subformula
namespace subterm
variables (S : Structure L) {n : ℕ} (Φ : μ → S) (e : fin n → S)
@[simp] def val (Φ : μ → S) (e : fin n → S) : subterm L μ n → S
| (&x) := Φ x
| (#x) := e x
| (function f v) := S.fn f (λ i, (v i).val)
lemma val_rew (s : μ₁ → subterm L μ₂ n) (Φ : μ₂ → S) (e : fin n → S) (t : subterm L μ₁ n) :
(rew s t).val S Φ e = t.val S (λ x, val S Φ e (s x)) e :=
by induction t; simp*
lemma val_map (f : μ₁ → μ₂) (Φ : μ₂ → S) (e : fin n → S) (t : subterm L μ₁ n) :
(map f t).val S Φ e = t.val S (λ x, Φ (f x)) e :=
by simp[map, val_rew]
lemma val_subst (u : subterm L μ n) (t : subterm L μ (n + 1)) :
(subst u t).val S Φ e = t.val S Φ (e <* u.val S Φ e) :=
by { induction t; simp*, case var : x { refine fin.last_cases _ _ x; simp } }
lemma val_lift (x : S) (t : subterm L μ n) :
t.lift.val S Φ (x *> e) = t.val S Φ e :=
by induction t; simp*
section bounded_subterm
variables {m : ℕ} {Ψ : fin m → S}
lemma val_mlift (x : S) (t : bounded_subterm L m n) :
t.mlift.val S (Ψ <* x) e = t.val S Ψ e :=
by simp[mlift, val_rew, val_map]
lemma val_push (x : S) (e : fin n → S) (t : bounded_subterm L m (n + 1)) :
val S (Ψ <* x) e t.push = val S Ψ (e <* x) t :=
by { induction t; simp*, case var : u { refine fin.last_cases _ _ u; simp } }
lemma val_pull (x : S) (e : fin n → S) (t : bounded_subterm L (m + 1) n) :
val S Ψ (e <* x) t.pull = val S (Ψ <* x) e t :=
by { induction t; simp*, case metavar : u { refine fin.last_cases _ _ u; simp } }
end bounded_subterm
end subterm
namespace subformula
variables {μ μ₁ μ₂} (S : Structure L) {n : ℕ} {Φ : μ → S} {e : fin n → S}
@[simp] def subval' (Φ : μ → S) : ∀ {n} (e : fin n → S), subformula L μ n → Prop
| n _ verum := true
| n e (relation p v) := S.pr p (subterm.val S Φ e ∘ v)
| n e (imply p q) := p.subval' e → q.subval' e
| n e (neg p) := ¬(p.subval' e)
| n e (fal p) := ∀ x : S.dom, (p.subval' (x *> e))
@[irreducible] def subval (Φ : μ → S) (e : fin n → S) : subformula L μ n →ₗ Prop :=
{ to_fun := subval' S Φ e,
map_neg' := λ _, by refl,
map_imply' := λ _ _, by refl,
map_and' := λ p q, by unfold has_inf.inf; simp[and]; refl,
map_or' := λ p q, by unfold has_sup.sup; simp[or, ←or_iff_not_imp_left]; refl,
map_top' := by refl,
map_bot' := by simp[bot_def]; unfold has_top.top has_negation.neg; simp }
@[reducible] def val (Φ : μ → S) : formula L μ →ₗ Prop := subformula.subval S Φ fin.nil
@[simp] lemma subval_relation {p} {r : L.pr p} {v} :
subval S Φ e (relation r v) ↔ S.pr r (λ i, subterm.val S Φ e (v i)) := by simp[subval]; refl
@[simp] lemma subval_fal {p : subformula L μ (n + 1)} :
subval S Φ e (∀'p) ↔ ∀ x : S, subval S Φ (x *> e) p := by simp[subval]; refl
@[simp] lemma subval_ex {p : subformula L μ (n + 1)} :
subval S Φ e (∃'p) ↔ ∃ x : S, subval S Φ (x *> e) p := by simp[ex_def]
lemma subval_rew {Φ : μ₂ → S} {n} {e : fin n → S} {s : μ₁ → subterm L μ₂ n} {p : subformula L μ₁ n} :
subval S Φ e (rew s p) ↔ subval S (λ x, subterm.val S Φ e (s x)) e p :=
by induction p using fol.subformula.ind_on; intros; simp[*, subterm.val_rew, subterm.val_lift]
lemma subval_map {Φ : μ₂ → S} {n} {e : fin n → S} {f : μ₁ → μ₂} {p : subformula L μ₁ n} :
subval S Φ e (map f p) ↔ subval S (λ x, Φ (f x)) e p :=
by simp[map, subval_rew]
@[simp] lemma subval_subst {n} {p : subformula L μ (n + 1)} : ∀ {e : fin n → S} {t : subterm L μ n},
subval S Φ e (subst t p) ↔ subval S Φ (e <* subterm.val S Φ e t) p :=
by apply ind_succ_on p; intros; simp[*, subterm.val_subst, subterm.val_lift, fin.left_right_concat_assoc]
section bounded_subformula
variables {m : ℕ} {Ψ : fin m → S}
lemma subval_mlift {x} {p : bounded_subformula L m n} :
subval S (Ψ <* x) e p.mlift = subval S Ψ e p := by simp[mlift, (∘), subval_map]
lemma subval_push {x} {n} {p : bounded_subformula L m (n + 1)} : ∀ {e : fin n → S},
subval S (Ψ <* x) e p.push ↔ subval S Ψ (e <* x) p :=
by apply ind_succ_on p; intros; simp[*, subterm.val_push, fin.left_right_concat_assoc]
lemma subval_pull {x} {n} {p : bounded_subformula L (m + 1) n} : ∀ {e : fin n → S},
subval S Ψ (e <* x) p.pull ↔ subval S (Ψ <* x) e p :=
by induction p using fol.subformula.ind_on generalizing Ψ; intros; simp[*, subterm.val_pull, fin.left_right_concat_assoc]
lemma subval_dummy {x} : ∀ {n} {e : fin n → S} {p : bounded_subformula L m n},
subval S Ψ (e <* x) p.dummy ↔ subval S Ψ e p :=
by simp[dummy, subval_pull, subval_mlift]
end bounded_subformula
end subformula
namespace nonempty_Structure
variables (M : nonempty_Structure L)
lemma coe_def : (M : Structure L) = M.to_Structure := rfl
@[simp] lemma fn_coe : @Structure.fn L (M : Structure L) = @Structure.fn L M.to_Structure := rfl
@[simp] lemma pr_coe : @Structure.pr L (M : Structure L) = @Structure.pr L M.to_Structure := rfl
instance : inhabited (nonempty_Structure L) :=
⟨{ dom := punit,
fn := λ k f v, punit.star,
pr := λ k r v, false,
dom_inhabited := punit.inhabited }⟩
end nonempty_Structure
namespace Structure
@[ext] lemma ext (S₁ S₂ : Structure L)
(hdom : @dom L S₁ = @dom L S₂)
(hfn : ∀ {k} (f : L.fn k), @fn L S₁ k f == @fn L S₂ k f)
(hpr : ∀ {k} (r : L.pr k), @pr L S₁ k r == @pr L S₂ k r) : S₁ = S₂ :=
begin
rcases S₁, rcases S₂, simp at hdom ⊢ hfn hpr, refine ⟨hdom, _, _⟩,
{ ext; simp, rintros k k rfl, ext; simp, rintros f f rfl, exact hfn f },
{ ext; simp, rintros k k rfl, ext; simp, rintros r r rfl, exact hpr r }
end
lemma eta (S : Structure L) : ({dom := S.dom, fn := @fn L S, pr := @pr L S} : Structure L) = S :=
by ext; simp
class Structure.proper_equal [L.has_equal] (S : Structure L)
(val_eq : ∀ {n : ℕ} {t u : subterm L μ n} {Φ e}, subformula.subval S Φ e (t =' u) ↔ (t.val S Φ e = u.val S Φ e))
def nonempty (S : Structure L) [c : inhabited S] : nonempty_Structure L :=
{ dom_inhabited := c, ..S }
variables (S : Structure L) [inhabited S]
@[simp] lemma coe_nonempty : (S.nonempty : Type*) = S := rfl
@[simp] lemma to_Structure_nonempty : (S.nonempty : Structure L) = S := by simp[nonempty, nonempty_Structure.coe_def, eta]
instance : inhabited (Structure L) :=
⟨(default : nonempty_Structure L)⟩
end Structure
namespace subformula
variables (S : Structure L) {Φ : μ → S}
notation S` ⊧[`:80 e`] `p :50 := val S e p
variables {S} {p q : formula L μ}
@[simp] lemma models_relation {k} {r : L.pr k} {v} :
S ⊧[Φ] relation r v ↔ S.pr r (λ i, subterm.val S Φ fin.nil (v i)) := by simp[val]
section bounded
variables {m : ℕ} {Ψ : fin m → S}
@[simp] lemma val_fal {p : bounded_subformula L m 1} :
S ⊧[Ψ] ∀'p ↔ ∀ x, S ⊧[Ψ <* x] p.push :=
by simp[val, subval_push, fin.concat_zero]
@[simp] lemma val_ex {p : bounded_subformula L m 1} :
S ⊧[Ψ] ∃'p ↔ ∃ x, S ⊧[Ψ <* x] p.push :=
by simp[val, subval_push, fin.concat_zero]
@[simp] lemma val_subst {p : bounded_subformula L m 1} {t : bounded_subterm L m 0} :
S ⊧[Ψ] subst t p ↔ S ⊧[Ψ <* subterm.val S Ψ fin.nil t] p.push :=
by simp[val, subval_subst, subval_push]
@[simp] lemma val_mlift {x : S} {p : bounded_subformula L m 0} : S ⊧[Ψ <* x] p.mlift ↔ S ⊧[Ψ] p :=
by simp[val, subval_mlift]
end bounded
end subformula
def models (S : Structure L) (p : formula L μ) : Prop := ∀ e, S ⊧[e] p
instance : semantics (formula L μ) (Structure L) := ⟨models⟩
instance : semantics (formula L μ) (nonempty_Structure L) := ⟨λ S p, (S : Structure L) ⊧ p⟩
namespace Structure
variables {S : Structure L} {σ τ : sentence L}
lemma models_def {p : formula L μ} : S ⊧ p ↔ (∀ e, S ⊧[e] p) := by refl
lemma sentence_models_def :
S ⊧ σ ↔ S ⊧[fin.nil] σ := by simp[models_def, fin.nil]
@[simp] lemma formula_verum : S ⊧ (⊤ : formula L μ) := by simp[models_def]
@[simp] lemma sentence_falsum : ¬S ⊧ (⊥ : sentence L) := by simp[models_def]
@[simp] lemma sentence_relation {k} (r : L.pr k) (v : fin k → bounded_subterm L 0 0) :
S ⊧ (relation r v) ↔ S.pr r (subterm.val S fin.nil fin.nil ∘ v) := by simp[sentence_models_def]
@[simp] lemma sentence_imply : S ⊧ σ ⟶ τ ↔ (S ⊧ σ → S ⊧ τ) := by simp[sentence_models_def]
@[simp] lemma sentence_neg : S ⊧ ∼σ ↔ ¬S ⊧ σ := by simp[sentence_models_def]
@[simp] lemma sentence_and : S ⊧ σ ⊓ τ ↔ S ⊧ σ ∧ S ⊧ τ := by simp[sentence_models_def]
@[simp] lemma sentence_or : S ⊧ σ ⊔ τ ↔ S ⊧ σ ∨ S ⊧ τ := by simp[sentence_models_def]
@[simp] lemma sentence_equiv : S ⊧ σ ⟷ τ ↔ (S ⊧ σ ↔ S ⊧ τ) := by simp[sentence_models_def]
instance : semantics.nontrivial (sentence L) (Structure L) :=
⟨by simp[models_def], by simp[models_def]⟩
abbreviation valid (p : formula L μ) : Prop := semantics.valid (Structure L) p
abbreviation satisfiable (p : formula L μ) : Prop := semantics.satisfiable (Structure L) p
lemma valid_def (p : formula L μ) : valid p ↔ ∀ S : Structure L, S ⊧ p := by refl
lemma satisfiable_def (p : formula L μ) : satisfiable p ↔ ∃ S : Structure L, S ⊧ p := by refl
abbreviation Satisfiable (T : preTheory L μ) : Prop := semantics.Satisfiable (Structure L) T
lemma Satisfiable_def (T : preTheory L μ) : Satisfiable T ↔ ∃ S: Structure L, S ⊧ T := by refl
@[simp] lemma sentence_not_valid_iff_satisfiable (σ : sentence L) : ¬valid σ ↔ satisfiable (∼σ) :=
by simp[valid_def, satisfiable_def]
@[simp] lemma models_mlift [inhabited S] {m} {p : bounded_formula L m} : S ⊧ p.mlift ↔ S ⊧ p :=
by{ simp[models_def], split,
{ intros h e,
have : S ⊧[e <* default] p.mlift, from h _,
simpa using this },
{ intros h e, rw ←fin.right_concat_eq e, simpa using h (e ∘ fin.cast_succ)} }
end Structure
namespace nonempty_Structure
variables {M : nonempty_Structure L} {σ τ : sentence L} {m : ℕ} {T : bounded_preTheory L m}
lemma models_def {p : formula L μ} :
M ⊧ p ↔ (∀ e, ↑M ⊧[e] p) := by refl
lemma sentence_models_def {σ : sentence L} :
M ⊧ σ ↔ ↑M ⊧[fin.nil] σ := by simp[models_def, fin.nil]
@[simp] lemma formula_verum : M ⊧ (⊤ : formula L μ) := by simp[models_def]
@[simp] lemma formula_falsum : ¬M ⊧ (⊥ : formula L μ) := by simp[models_def]
@[simp] lemma sentence_relation {k} {r : L.pr k} {v : fin k → bounded_subterm L 0 0} :
M ⊧ (relation r v) ↔ M.pr r (subterm.val M fin.nil fin.nil ∘ v) := by simp[sentence_models_def]
@[simp] lemma sentence_imply : M ⊧ σ ⟶ τ ↔ (M ⊧ σ → M ⊧ τ) := by simp[sentence_models_def]
@[simp] lemma sentence_neg : M ⊧ ∼σ ↔ ¬M ⊧ σ := by simp[sentence_models_def]
@[simp] lemma sentence_and : M ⊧ σ ⊓ τ ↔ M ⊧ σ ∧ M ⊧ τ := by simp[sentence_models_def]
@[simp] lemma sentence_or : M ⊧ σ ⊔ τ ↔ M ⊧ σ ∨ M ⊧ τ := by simp[sentence_models_def]
@[simp] lemma sentence_equiv : M ⊧ σ ⟷ τ ↔ (M ⊧ σ ↔ M ⊧ τ) := by simp[sentence_models_def]
instance : semantics.nontrivial (formula L μ) (nonempty_Structure L) :=
⟨by simp[models_def], by simp[models_def]⟩
abbreviation valid (p : formula L μ) : Prop := semantics.valid (nonempty_Structure L) p
abbreviation satisfiable (p : formula L μ) : Prop := semantics.satisfiable (nonempty_Structure L) p
lemma valid_def (p : formula L μ) : valid p ↔ ∀ M : nonempty_Structure L, M ⊧ p := by refl
lemma satisfiable_def (p : formula L μ) : satisfiable p ↔ ∃ M : nonempty_Structure L, M ⊧ p := by refl
abbreviation Satisfiable (T : preTheory L μ) : Prop := semantics.Satisfiable (nonempty_Structure L) T
lemma Satisfiable_def (T : preTheory L μ) : Satisfiable T ↔ ∃ M : nonempty_Structure L, M ⊧ T := by refl
@[simp] lemma sentence_not_valid_iff_satisfiable (σ : sentence L) : ¬valid σ ↔ satisfiable (∼σ) :=
by simp[valid_def, satisfiable_def]
lemma coe_models_iff (p : formula L μ) : (M : Structure L) ⊧ p ↔ M ⊧ p := by refl
@[simp] lemma models_mlift {m} {p : bounded_formula L m} : M ⊧ p.mlift ↔ M ⊧ p :=
by simp[←coe_models_iff]
lemma coe_models_Theory_iff (T : preTheory L μ) : (M : Structure L) ⊧ T ↔ M ⊧ T := by refl
end nonempty_Structure
namespace Structure
open bounded_preTheory
variables {S : Structure L} {σ τ : sentence L} {m : ℕ} {T : bounded_preTheory L m}
lemma nonempty_models_iff [inhabited S] (p : formula L μ) : S.nonempty ⊧ p ↔ S ⊧ p :=
by simp[←nonempty_Structure.coe_models_iff]
lemma nonempty_models_Theory_iff [inhabited S] (T : preTheory L μ) : S.nonempty ⊧ T ↔ S ⊧ T :=
by simp[←nonempty_Structure.coe_models_Theory_iff]
@[simp] lemma models_Theory_mlift [inhabited S] : S ⊧ T.mlift ↔ S ⊧ T :=
⟨by { intros h p hp,
have : S ⊧ p.mlift, from @h p.mlift (by simpa using hp),
exact models_mlift.mp this },
by { intros h p hp,
rcases mem_mlift_iff.mp hp with ⟨q, hq, rfl⟩,
exact models_mlift.mpr (h hq) }⟩
def consequence : preTheory L μ → formula L μ → Prop := semantics.consequence (Structure L)
infix ` ⊧₀ ` :55 := consequence
lemma consequence_def {T : preTheory L μ} {p : formula L μ} :
T ⊧₀ p ↔ (∀ S : Structure L, S ⊧ T → S ⊧ p) := by refl
end Structure
namespace nonempty_Structure
open bounded_preTheory
variables {M : nonempty_Structure L} {σ τ : sentence L} {m : ℕ} {T : bounded_preTheory L m}
@[simp] lemma models_Theory_mlift : M ⊧ T.mlift ↔ M ⊧ T :=
by simp[←coe_models_Theory_iff]
instance : has_double_turnstile (preTheory L μ) (formula L μ) := ⟨semantics.consequence (nonempty_Structure L)⟩
lemma consequence_def {T : preTheory L μ} {p : formula L μ} :
T ⊧ p ↔ (∀ M : nonempty_Structure L, M ⊧ T → M ⊧ p) := by refl
end nonempty_Structure
variables {S : Structure L}
open subformula
theorem soundness {m} {T : bounded_preTheory L m} {p} : T ⊢ p → T ⊧₀ p :=
begin
intros h,
apply provable.rec_on h,
{ intros m T p b IH S hT Φ,
simp[subformula.val], intros x,
haveI : inhabited S, from ⟨x⟩,
have : S ⊧ p, from @IH S (by simpa using hT),
exact this (Φ <* x) },
{ intros m T p q b₁ b₂ m₁ m₂ S hT Φ,
have h₁ : S ⊧[Φ] p → S ⊧[Φ] q, by simpa using m₁ hT Φ,
have h₂ : S ⊧[Φ] p, from m₂ hT Φ,
exact h₁ h₂ },
{ intros m T p hp S hS, exact hS hp },
{ intros m T S h Φ, simp },
{ intros m T p q S hS Φ, simp, intros h _, exact h },
{ intros m T p q r S hS Φ, simp, intros h₁ h₂ h₃, exact h₁ h₃ (h₂ h₃) },
{ intros m T p q S hS Φ, simp, intros h₁, contrapose, exact h₁ },
{ intros m T p t S hS Φ, simp, intros h, exact h _ },
{ intros m T p q S hS Φ, simp, intros h₁ h₂ x, exact h₁ x h₂ }
end
instance {m} : logic.sound (bounded_formula L m) (Structure L) :=
⟨λ T p, soundness⟩
theorem nonempty_soundness {m} {T : bounded_preTheory L m} {p} : T ⊢ p → T ⊧ p :=
by intros h M hM; exact soundness h hM
instance {m} : logic.sound (bounded_formula L m) (nonempty_Structure L) :=
⟨λ T p, nonempty_soundness⟩
end fol |
# 概率与统计
```python
import numpy as np
import scipy
import sympy as sym
import matplotlib
sym.init_printing()
print("NumPy version:", np.__version__)
print("SciPy version:", scipy.__version__)
print("SymPy version:", sym.__version__)
print("Matplotlib version:", matplotlib.__version__)
```
NumPy version: 1.13.1
SciPy version: 0.19.1
SymPy version: 1.1.1
Matplotlib version: 2.0.2
## 随机事件
在一定条件下,并不总是出现相同结果的现象称为**随机现象**。
特点:随机现象的结果至少有两个;
至于那一个出现,事先并不知道。
- 抛硬币
- 掷骰子
- 一天内进入某超市的顾客数
- 一顾客在超市排队等候付款的时间
- 一台电视机从开始使用道发生第一次故障的时间
认识一个随机现象首要的罗列出它的一切发生的基本结果。这里的基本结果称为**样本点**,
随机现象一切可能样本点的全体称为这个随机现象的**样本空间**,常记为Ω。
“抛一枚硬币”的样本空间 Ω={正面,反面} ;
“掷一颗骰子”的样本空间 Ω={1, 2, 3, 4, 5, 6};
“一天内进入某超市的顾客数”的样本空间 Ω={n: n ≥0}
“一顾客在超市排队等候付款的时间” 的样本空间 Ω={t: t≥0}
“一台电视机从开始使用道发生第一次故障的时间”的样本空间
Ω={t: t≥0}
**定义**:随机现象的某些样本点组成的集合称为**随机事件**,简称事件,常用大写字母A、 B、 C等
表示。
[例子]掷一个骰子时,“出现奇数点”是一个事件,它由1点、 3点和5点共三个样本点组成,若
记这个事件为A,则有A= { 1, 3, 5}。
**定义**:一个随机事件A发生可能性的大小称为这个事件的概率,用P(A)表示。
概率是一个介于0到1之间的数。概率越大,事件发生的可能性就越大;概率越小,事件发生
的可能性也就越小。特别,不可能事件的概率为0,必然事件的概率为1。 P(φ)= 0, P(Ω)=1。
## 概率的统计定义
- 与事件A有关的随机现象是可以大量重复事件的;
- 若在n次重复试验中,事件A发生kn次,则事件A发生的频率为:
- fn(A)= kn/n=事件A发生的次数/重复试验的次数
- 频率fn(A)能反应事件A发生的可能性大小。
- 频率fn(A)将会随着试验次数不断增加而趋于稳定,这个频率的稳定值就是事件A的概率。
在实际中人们无法把一个试验无限次重复下去,只能用重复试验次数n较大时的频率去
近似概率。
| 试验者 | 抛的次数n| 出现正面次数k| 正面出现频率k/n|
|---:|----:|----:|----:|
| 德·摩根 |2048 |1061 |0.5180|
| 蒲丰 | 4040| 2048| 0.5069|
| 皮尔逊 |12000| 6019| 0.5016|
| 皮儿孙 |24000| 12012| 0.5005|
| 微尼 | 30000| 14994| 0.4998|
## 随机变量
定义:表示随机现象的结果的变量称为**随机变量**。
常用大写字母X, Y, Z等表示随机变量,他们的取值用相应的小写字母x, y, z表示。
假如一个随机变量仅取数轴上有限个点或可列个点,则称此随机变量为**离散型随机变量**。
假如一个随机变量的所有可能取值充满数轴上的一个区间(a, b),则称此变量为**连续型随机变量**。
### 例子
- 设X是一只铸件上的瑕疵数,则X是一个离散随机变量,它可以取0, 1, 2, ….等值。可用随机变量X的取值来表示事件,如“X=0”表示事件“铸件上无瑕疵”。
- 一台电视机的寿命X是在0到正无穷大区间内取值的连续随机变量,“X=0”表示事件“一台电视机在开箱时就发生故障”,“X>40000”表示“电视机寿命超过40000小时”。
## 随机变量的分布
随机变量的取值是随机的,但内在还是有规律的,这个规律可以用分布来描述。分布包括
如下两方面内容:
- X可能取哪些值,或在哪个区间内取值。
- X取这些值的概率各是多少,或X在任一区间上取值的概率是多少?
### 例子
掷两颗骰子, 6点出现的次数
|X |0 |1 |2 |
|P |25/36 |10/36 |1/36|
连续性随机变量X的分布可用概率密度函数p(x)表示,也可记作f(x)。
下面以产品质量特性x(如机械加工轴的直径)为例来说明p(x)的由来。
假定我们一个接一个地测量产品的某个质量特性值X,把测量得到的x值一个接一个地放在
数轴上。当累计到很多x值时,就形成一定的图形,为了使这个图形稳定,把纵轴改为单位长
度上的频率,由于频率的稳定性,随着被测量质量特性值x的数量愈多,这个图形就愈稳定,
其外形显现出一条光滑曲线。这条曲线就是概率密度曲线,相应的函数表达式f(x)称为概率
密度函数,它就是一种表示质量特性X随机取值内在统计规律性的函数
## 均值、方差与标准差
随机变量的分布有几个重要的特征数,用来表示分布的集中位置(中心位置)分散度大小。
### 均值
用来表示分布的中心位置,用$\mu(X)$表示。对于绝大多数的随机变量,在均值附近出现的
机会较多。计算公式为:
$$
E(X)=\sum_i x_i \cdot p_i \\
E(X)=\int_a^b x \cdot p(x) dx
$$
### 方差与标准差
方差用来表示分布的散步大小,用$\sigma^2$表示,方差小意味着分布较集中。方差的计算公式为:
$$
\sigma^2(X)=\sum_i (x_i - E(X))^2 p_i \\
\sigma^2(X)=\int_a^b (x - E(X))^2 \cdot p(x) dx
$$
## 正态分布
$$
p(x)=\frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}}
$$
```python
import sympy.stats as stats
coin = stats.Die('coin',2)
P=stats.P
E=stats.E
```
```python
stats.density(coin).dict
```
```python
import numpy as np
import matplotlib.pyplot as plt
from pyecharts import Bar
def mydice(number):
rd = np.random.random(number)*2+1
return rd.astype(int)
#np.random.seed(19680801)
x=mydice(10000)
tag=[]
sta=[]
for itr in range(len(set(x))):
tag.append("%d"%(itr+1))
sta.append(len(x[x==(itr+1)]))
bar = Bar("统计图", "硬币")
bar.add("点数", tag, sta)
#bar.show_config()
bar.render("echarts/coindicechart.html")
bar
```
<div id="acbd8993f3f04b2a8dbec1404a3dcf97" style="width:800px; height:400px;"></div>
```python
E(coin)
```
```python
dice1, dice2 = stats.Die('dice1',6),stats.Die('dice2',6)
```
```python
import numpy as np
import matplotlib.pyplot as plt
from pyecharts import Bar
def mydice(number):
rd = np.random.random(number)*6+1
return rd.astype(int)
#np.random.seed(19680801)
x=mydice(1000)
tag=[]
sta=[]
for itr in range(len(set(x))):
tag.append("%d"%(itr+1))
sta.append(len(x[x==(itr+1)]))
bar = Bar("统计图", "骰子")
bar.add("点数", tag, sta)
#bar.show_config()
bar.render("echarts/stadicechart.html")
bar
```
<div id="abf1259505504b37bde3dcae18ccde81" style="width:800px; height:400px;"></div>
```python
stats.density(dice1).dict
```
```python
import numpy as np
import matplotlib.pyplot as plt
from pyecharts import Bar
def mydice(number):
rd = np.random.random(number)*6+1
return rd.astype(int)
#np.random.seed(19680801)
x1=mydice(1000)
x2=mydice(1000)
x=x1+x2
tag=[]
sta=[]
lx=len(x)
for itr in range(len(set(x))):
tag.append("%d"%(itr+1))
sta.append(len(x[x==(itr+1)])/lx)
bar = Bar("统计图", "骰子")
bar.add("点数", tag, sta)
#bar.show_config()
bar.render("echarts/stadice2chart.html")
bar
```
<div id="1bd90df8adf6424185e6ef2ece4c524a" style="width:800px; height:400px;"></div>
```python
stats.density(dice1+dice2).dict
```
```python
stats.density(dice1*dice2).dict
```
```python
import numpy as np
import matplotlib.pyplot as plt
from pyecharts import Bar
def mydice(number):
rd = np.random.random(number)*6+1
return rd.astype(int)
#np.random.seed(19680801)
x1=mydice(1000)
x2=mydice(1000)
x=x1*x2
tag=[]
sta=[]
lx=len(x)
for itr in range(len(set(x))):
tag.append("%d"%(itr+1))
sta.append(len(x[x==(itr+1)])/lx)
bar = Bar("统计图", "骰子")
bar.add("点数", tag, sta)
#bar.show_config()
bar.render("echarts/stadice2chart.html")
bar
```
<div id="442f6113514642e8bdde743682ff101a" style="width:800px; height:400px;"></div>
```python
E(dice1+dice2)
```
```python
E(dice1*dice2)
```
```python
stats.density(dice1+dice2>6)
```
```python
x, y = sym.symbols('x y')
normal = stats.Normal('N', 2, 3)
sym.plot(stats.P(normal<x),(x,-10,10))
sym.plot(stats.P(normal<x).diff(x),(x,-10,10))
```
```python
rand1=np.random.normal(loc=1, scale=1, size=[1000])
rand2=np.random.normal(loc=1, scale=1, size=[1000])
```
```python
np.mean(rand1)
```
```python
np.std(rand1)
```
```python
```
```python
```
```python
np.corrcoef(rand1, rand2)
```
array([[ 1. , -0.0180464],
[-0.0180464, 1. ]])
```python
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
mpl.style.use('seaborn-darkgrid')
```
```python
fig = plt.figure()
ax=fig.add_subplot(2,2,1)
ax.scatter(rand1, rand1)
ax=fig.add_subplot(2,2,2)
ax.scatter(rand1, rand2)
ax=fig.add_subplot(2,2,3)
ax.scatter(rand2, rand1)
ax=fig.add_subplot(2,2,4)
ax.scatter(rand2, rand2)
```
# 协方差
$$
E((X-E(X))(Y-E(Y)))
$$
```python
import numpy as np
```
```python
rand1=np.random.normal(loc=1, scale=3, size=[1000])
rand2=np.random.normal(loc=1, scale=3, size=[1000])
```
```python
def Conv(dt1, dt2):
return np.mean((dt1-np.mean(dt1))*(dt2-np.mean(dt2)))
```
```python
Conv(rand1, rand2)
```
-0.14984037611140225
```python
Conv(rand1, rand2)/np.std(rand1)/np.std(rand2)
```
-0.016631410183790416
```python
np.corrcoef(rand1, rand2)
```
array([[ 1. , -0.01663141],
[-0.01663141, 1. ]])
## 信息熵
第一,假设存在一个随机变量,可以问一下自己当我们观测到该随机变量的一个样本时,我们可以接受到多少信息量呢?毫无疑问,当我们被告知一个极不可能发生的事情发生了,那我们就接收到了更多的信息;而当我们观测到一个非常常见的事情发生了,那么我们就接收到了相对较少的信息量。因此信息的量度应该依赖于概率分布$p(x)$,所以说熵$h(x)$的定义应该是概率的单调函数。
第二,假设两个随机变量和是相互独立的,那么分别观测两个变量得到的信息量应该和同时观测两个变量的信息量是相同的,即:$h(x+y)=h(x)+h(y)$。而从概率上来讲,两个独立随机变量就意味着$p(x, y)=p(x)p(y)$,所以此处可以得出结论熵的定义应该是概率的函数。因此一个随机变量的熵可以使用如下定义:
$$
h(x)=-log(p(x))
$$
此处的负号仅仅是用来保证熵(即信息量)是正数或者为零。而函数基的选择是任意的(信息论中基常常选择为2,因此信息的单位为比特bits;而机器学习中基常常选择为自然常数,因此单位常常被称为nats)。
最后,我们用熵来评价整个随机变量平均的信息量,而平均最好的量度就是随机变量的期望,即熵的定义如下:
$$
H(x)=-\sum p(x)log(x)
$$
### 高斯分布是最大熵分布
建立泛函
$$
F(p(x))=\int_{-\infty}^{\infty} [-p(x)log(p(x))+\lambda_0 p(x)+\lambda_1 g(x) p(x)]dx
$$
$$
p(x)=e^{(-1+\lambda_0+\lambda_1 g(x))}
$$
$$
g(x)=(x-\mu)^2
$$
```python
x,n1,n2,mu,sigma = sym.symbols("x \lambda_0 \lambda_1 \mu \sigma")
p=sym.exp(-1+n1+n2*(x-mu)**2)
g=(x-mu)**2
```
```python
a = sym.Integral(p*g, (x, -sym.oo,sym.oo))
sym.Eq(a, sigma**2)
```
```python
b = sym.Integral(p, (x, -sym.oo,sym.oo))
sym.Eq(a, mu)
```
```python
sym.simplify(a.doit())
```
$$\begin{cases} \frac{i \sqrt{\pi}}{2 \lambda_1^{\frac{3}{2}}} e^{\lambda_0 - 1} & \text{for}\: \left(\left|{\operatorname{periodic_{argument}}{\left (e^{i \pi} \operatorname{polar\_lift}{\left (\lambda_1 \right )},\infty \right )}}\right| \leq \frac{\pi}{2} \wedge \left|{\operatorname{periodic_{argument}}{\left (\operatorname{polar\_lift}^{2}{\left (\lambda_1 \right )} \operatorname{polar\_lift}^{2}{\left (\mu \right )},\infty \right )}}\right| < \pi \wedge \left|{\operatorname{periodic_{argument}}{\left (e^{2 i \pi} \operatorname{polar\_lift}^{2}{\left (\lambda_1 \right )} \operatorname{polar\_lift}^{2}{\left (\mu \right )},\infty \right )}}\right| < \pi\right) \vee \left|{\operatorname{periodic_{argument}}{\left (e^{i \pi} \operatorname{polar\_lift}{\left (\lambda_1 \right )},\infty \right )}}\right| < \frac{\pi}{2} \\\int_{-\infty}^{\infty} \left(\mu - x\right)^{2} e^{\lambda_0 + \lambda_1 \left(\mu - x\right)^{2} - 1}\, dx & \text{otherwise} \end{cases}$$
```python
sym.simplify(b.doit())
```
$$\begin{cases} - \frac{i \sqrt{\pi}}{\sqrt{\lambda_1}} e^{\lambda_0 - 1} & \text{for}\: \left(\left|{\operatorname{periodic_{argument}}{\left (e^{i \pi} \operatorname{polar\_lift}{\left (\lambda_1 \right )},\infty \right )}}\right| \leq \frac{\pi}{2} \wedge \left|{\operatorname{periodic_{argument}}{\left (\operatorname{polar\_lift}^{2}{\left (\lambda_1 \right )} \operatorname{polar\_lift}^{2}{\left (\mu \right )},\infty \right )}}\right| < \pi \wedge \left|{\operatorname{periodic_{argument}}{\left (e^{2 i \pi} \operatorname{polar\_lift}^{2}{\left (\lambda_1 \right )} \operatorname{polar\_lift}^{2}{\left (\mu \right )},\infty \right )}}\right| < \pi\right) \vee \left|{\operatorname{periodic_{argument}}{\left (e^{i \pi} \operatorname{polar\_lift}{\left (\lambda_1 \right )},\infty \right )}}\right| < \frac{\pi}{2} \\\int_{-\infty}^{\infty} e^{\lambda_0 + \lambda_1 \left(\mu - x\right)^{2} - 1}\, dx & \text{otherwise} \end{cases}$$
```python
eq1=-(sym.pi/(4*n2**3))*sym.exp(2*n1-2)-sigma**4
eq2=-(sym.pi/(n2))*sym.exp(2*n1-2)-1
sym.solve((eq1, eq2),n1, n2)
```
```python
## 积分收敛
$$
\lambda_1<0
$$
```
|
[STATEMENT]
lemma dom_trms_subset:
shows "(dom_trms C E ) \<subseteq> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. dom_trms C E \<subseteq> E
[PROOF STEP]
unfolding dom_trms_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. {x \<in> E. dom_trm x C} \<subseteq> E
[PROOF STEP]
by auto |
[Home](home.ipynb) > Perception biases in networks with Homophily and Preferential Attachment
### *Notebooks for Social Network Analysis*
# Perception biases in networks with homophily and group sizes
Author: [Fariba Karimi](https://www.gesis.org/person/fariba.karimi)
Version: 0.1 (21.01.2020)
Please cite as: Karimi, Fariba (2020). Perception biases in networks with homophily and group sizes. *Notebooks for Social Network Analysis*. GESIS. url:xxx
<div class="alert alert-info">
<big><b>Significance</b></big>
People’s perceptions about the size of minority groups in social networks can be biased, often showing systematic over- or
underestimation. These social perception biases are often attributed to biased cognitive or motivational processes. Here we
show that both over- and underestimation of the size of a minority group can emerge solely from structural properties of social
networks. Using a generative network model, we show that these biases depend on the level of homophily, its asymmetric
nature and on the size of the minority group. Our model predictions correspond well with empirical data from a cross-cultural
survey and with numerical calculations from six real-world networks. We also identify circumstances under which individuals
can reduce their biases by relying on perceptions of their neighbours.
</div>
### For more information, please visit the following paper
## Introduction
People’s perceptions of their social worlds determine their own
personal aspirations1 and willingness to engage in different
behaviours, from voting and energy conservation to health
behaviour, drinking and smoking. Yet, when forming these perceptions,
people seldom have an opportunity to draw representative
samples from the overall social network, or from the general
population. Instead, their samples are constrained by the local
structure of their personal networks, which can bias their perception
of the relative frequency of different attributes in the general
population. For example, supporters of different candidates in the
2016 US presidential election formed relatively isolated Twitter
communities. Such insular communities can overestimate the relative
frequency of their own attributes in the overall society. This
has been documented in the literature on overestimation effects
including *false consensus*, looking-glass perception and, more generally,
social projection. In an apparent contradiction, it has also
been documented that people holding a particular view sometimes
underestimate the frequency of that view, as described in the literature
on *false uniqueness*, pluralistic ignorance and majority
illusion. These over- and underestimation errors, which we call
social perception biases, affect people’s judgements of minority- and
majority-group sizes.
In this study, we show empirically, analytically and numerically that a
simple network model can explain both over- and underestimation
in social perceptions, without assuming biased motivational or cognitive
processes.
At the individual level, we assume that individuals’ perceptions
are based on the frequency of an attribute in their personal networks
(their direct neighbourhoods). We define individual i’s social
perception bias as follows:
\begin{equation}
B_{indv,i}=1/f_{m}\frac{\sum_{j\in\delta}{ x_j}}{k_i},
\end{equation}
where $f_m$ denotes the fraction of minority in the whole network, $\delta$ is the set of $i$'s neighbors, and $k_i$ is the degree of $i$. The group perdception bias is the average perception over all the members of the group.
Figure below describes the concept of the perception bias. The blue node $i$ in the center tends to underestimate the size of the minority nodes (orange nodes) in the homophilic networks and overestimate the size of the minority nodes in the heterophilic network:
**In this notebook**, I provide an intuitive walk through the construction of the perception biases in homophilic-preferential attachment network Model (BA-Homophily model). For constructing the BA-Homophily model, please check the other notebook.
## Dependencies and Settings
```python
%matplotlib inline
```
```python
import numpy as np
import matplotlib.pyplot as plt
```
```python
```
## Model
``homophilic_ba_graph(N,m,min_fraction,homophily)`` is the main function to generate the network. This function can be called from ``generate_homophilic_graph_symmetric.py``.
After generating the BA-Homophily model, we can measure the perception bias of each node by iterating over each node and calculating the perception bias. Finally, we average the perception bias across each group to calculate the group perception bias. The results are averaged over 20 independet simulations and stored at ``perception_bias/images/Fig2``.
### Draw the perception bias versus homophily and minority size
Here we plot perception bias of the minority and the majority group versus homophily and group sizes.
```python
plt.rcParams["font.family"] = "sans-serif"
fminor_list = [0.1, 0.2, 0.3, 0.4, 0.5]
fig = plt.figure(figsize = (10,6))
ha = [i/10. for i in range(11)]
hb = [1.-temp_h for temp_h in ha]
ax1 = fig.add_subplot(1,2,1)
ax2 = fig.add_subplot(1,2,2)
ax1.axvspan(0.5,1.0,color='lightgrey', edgecolor = 'lightgrey', alpha=0.5)
ax2.axvspan(0.0,0.5, color='lightgrey', edgecolor = 'lightgrey', alpha=0.5)
cmap = ['Goldenrod', 'coral', 'Pink', 'Firebrick', 'Red']
for fi in range(len(fminor_list)) :
fminor = fminor_list[fi]
''' Initial data'''
Cdata = np.loadtxt('perception_bias/images/Fig2/ctest_fa%s.txt' %(fminor))
fa = fminor
fb = 1.-fminor
minor_data = np.loadtxt('perception_bias/images/Fig2/neterr_minor_fa%s.txt' %(fminor))
major_data = np.loadtxt('perception_bias/images/Fig2/neterr_major_fa%s.txt' %(fminor))
c = Cdata[:,1]
''' Fig1(a) for the minority'''
minorh = minor_data[:,0]
minor_neterr = minor_data[:,1]
minor_analytic_y = [2*((fa*ha[temp_c])/(ha[temp_c]*c[temp_c]+hb[temp_c]*(2.-c[temp_c])) )/fa for temp_c in range(len(c))]
norm_minor_neterr = [(merr+fminor)/fminor for merr in minor_neterr]
ax1.axhline(y=1, color = 'grey', ls = 'dashed')
ax1.scatter(minorh, norm_minor_neterr, marker = 'o', edgecolor = 'black', s= 60,label = '$f_M=%s$' %fminor, facecolor = cmap[fi], zorder = 2)
ax1.plot(minorh, minor_analytic_y, label = '',color = cmap[fi])
ax1.set_xlabel(r'$h$', fontsize = 25)
ax1.set_ylabel(r'$P_{group}$', fontsize = 25,labelpad = -5)
ax1.xaxis.set_tick_params(labelsize=20)
ax1.yaxis.set_tick_params(labelsize=20)
ax1.set_xlim([0.0,1.0])
ax1.set_ylim([0.0,10.0])
''' Fig1(b) for the majority'''
majorh = major_data[:,0]
major_neterr = major_data[:,1]
major_analytic_y = [((fa*hb[temp_c])/(ha[temp_c]*c[temp_c]+hb[temp_c]*(2.-c[temp_c])) + ((c[temp_c]/(2.-c[temp_c]))*(fb*hb[temp_c])/(hb[temp_c]*c[temp_c]+ha[temp_c]*(2.-c[temp_c]))))/ (fa) for temp_c in range(len(c))]
norm_major_neterr = [(mjerr+fminor)/fminor for mjerr in major_neterr]
ax2.axhline(y=1, color = 'grey', ls = 'dashed')
ax2.scatter(majorh, norm_major_neterr, marker = 'o', s = 60, edgecolor = 'black', label = '$f_M=%s$' %fminor, color = cmap[fi], zorder = 2)
ax2.plot(majorh, major_analytic_y, label = '',color = cmap[fi])
ax2.set_xlabel(r'$h$', fontsize = 25)
ax2.xaxis.set_tick_params(labelsize=20)
ax2.yaxis.set_tick_params(labelsize=20)
ax2.set_xlim(0.0,1.0)
ax2.set_ylim(0.0,10.0)
''' Set labels '''
ax1.text(0.3,10.3, '(a) Minority',fontsize = 20)
ax2.text(0.3,10.3,'(b) Majority', fontsize = 20)
ax1.text(0.57,0.4, 'Filter Bubble',fontsize = 14,style='italic')
ax2.text(0.04,0.4, 'Majority Illusion',fontsize = 14,style='italic')
ax1.legend(scatterpoints=1, fontsize =17,bbox_to_anchor=(2.2, 1.23), fancybox=True, ncol=5, handletextpad=0.1,columnspacing=0.3)
#fig.savefig('Fig2.pdf', bbox_inches = 'tight')
plt.show()
```
### Reducing the perception bias by asking the neighbors
To what extent and under what structural conditions can individuals reduce their perception
bias? To address this question, we consider perception biases of
individuals and their neighbours. We aggregated each individual’s
own perception of frequency of different attributes (ego) with the
averaged perceptions of the individual’s neighbours. This is similar to *DeGroot’s weighted belief formalization*.
#### Degree growth of the minority and the majority (comparing analytical and numerical analysis)
```python
import numpy as np
import matplotlib.pyplot as plt
import os, sys, inspect
import math
plt.rcParams["font.family"] = "sans-serif"
fminor_list = [0.2]
fig = plt.figure(figsize = (10,6))
ax1 = fig.add_subplot(1,2,1)
ax2 = fig.add_subplot(1,2,2)
cmap = [ 'violet','yellowgreen']
for fi in range(len(fminor_list)) :
fminor = fminor_list[fi]
fa = fminor
fb = 1.-fminor
minor_data = np.loadtxt('perception_bias/images/Fig5/0hop_neterr_minor_fa%s.txt' %(fminor))
major_data = np.loadtxt('perception_bias/images/Fig5/0hop_neterr_major_fa%s.txt' %(fminor))
minorh = minor_data[:,0]
minor_neterr = minor_data[:,1]
minor_neterr_std = minor_data[:,2]
hop_minor_data = np.loadtxt('perception_bias/images/Fig5/1.0_hop_neterr_minor_fa%s_avg_sum.txt' %(fminor))
hop_major_data = np.loadtxt('perception_bias/images/Fig5/1.0_hop_neterr_major_fa%s_avg_sum.txt' %(fminor))
hop_y_min_mean = hop_minor_data[:,1]
hop_y_min_std = hop_minor_data[:,2]
'''Fig.5(a) for the minority '''
ax1.axhline(y= 1, color = 'grey', ls = 'dashed')
ax1.plot(minorh, (minor_neterr)/fminor, marker = 'o', label = 'ego', color = cmap[0] , mec = 'black')
ax1.errorbar(minorh, (minor_neterr)/fminor, yerr = minor_neterr_std, color = cmap[0] )
ax1.plot(minorh, (hop_y_min_mean)/fminor , marker = '^', label = '1-hop weighted avg.' , color = cmap[1] , mec = 'black')
ax1.errorbar(minorh, (hop_y_min_mean)/fminor, yerr= hop_y_min_std , color = cmap[1] )
ax1.xaxis.set_tick_params(labelsize=20)
ax1.yaxis.set_tick_params(labelsize=20)
ax1.set_xlabel(r'$h$', fontsize = 24)
ax1.set_ylabel(r'$P_{indv.}$', fontsize = 24)
ax1.legend(numpoints = 1, loc = 'best' ,fontsize = 20)
'''Fig.5(b) for the majority'''
hop_y_maj_mean = hop_major_data[:,1]
hop_y_maj_std = hop_major_data[:,2]
majorh = major_data[:,0]
major_neterr = major_data[:,1]
major_neterr_std = major_data[:,2]
ax2.axhline(y= 1, color = 'grey', ls = 'dashed')
ax2.plot(majorh, (major_neterr)/fminor , marker = 'o', label = 'ego' , color = cmap[0] , mec = 'black')
ax2.errorbar(minorh, (major_neterr)/fminor, yerr = major_neterr_std, color = cmap[0] )
ax2.plot(majorh, (hop_y_maj_mean)/fminor , marker = '^', label = '1-hop weighted avg.' , color = cmap[1] , mec = 'black')
ax2.errorbar(minorh, (hop_y_maj_mean)/fminor, yerr = hop_y_maj_std, color = cmap[1] )
ax2.set_xlabel(r'$h$', fontsize = 24)
ax2.xaxis.set_tick_params(labelsize=20)
ax2.yaxis.set_tick_params(labelsize=20)
ax1.xaxis.set_ticks(np.arange(0, 1.2, 0.2))
ax2.xaxis.set_ticks(np.arange(0, 1.2, 0.2))
ax1.text(0.28,5.1, '(a) Minority',fontsize = 20)
ax2.text(0.28,5.1, '(b) Majority',fontsize = 20)
ax1.legend(numpoints=1, fontsize =17,bbox_to_anchor=(1.6, 1.2), fancybox=True, ncol=5, handletextpad=0.1,columnspacing=0.3)
plt.show()
#plt.savefig('Fig5.pdf', bbox_inches = 'tight')
```
## Acknowledgments
The code for plotting perception biases are written by Dr. [Eun Lee](https://www.eunlee.net/).
## Literature
Lee, E., Karimi, F., Wagner, C., Jo, H. H., Strohmaier, M., & Galesic, M. (2019). Homophily and minority-group size explain perception biases in social networks. Nature human behaviour, 3(10), 1078-1087.
Karimi, F., Génois, M., Wagner, C., Singer, P., & Strohmaier, M. (2018). Homophily influences ranking of minorities in social networks. Scientific reports, 8(1), 1-12.(https://www.nature.com/articles/s41598-018-29405-7)
DeGroot, M. H. (1974). Reaching a consensus. Journal of the American Statistical Association, 69(345), 118-121.
Centola, D. (2011). An experimental study of homophily in the adoption of health behavior. Science, 334(6060), 1269-1272.
Galesic, M., de Bruin, W. B., Dumas, M., Kapteyn, A., Darling, J. E., & Meijer, E. (2018). Asking about social circles improves election predictions. Nature Human Behaviour, 2(3), 187-193.
|
/-
Copyright (c) 2022 Yuma Mizuno. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yuma Mizuno
! This file was ported from Lean 3 source module category_theory.bicategory.natural_transformation
! leanprover-community/mathlib commit 4ff75f5b8502275a4c2eb2d2f02bdf84d7fb8993
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.CategoryTheory.Bicategory.Functor
/-!
# Oplax natural transformations
Just as there are natural transformations between functors, there are oplax natural transformations
between oplax functors. The equality in the naturality of natural transformations is replaced by a
specified 2-morphism `F.map f ≫ app b ⟶ app a ≫ G.map f` in the case of oplax natural
transformations.
## Main definitions
* `oplax_nat_trans F G` : oplax natural transformations between oplax functors `F` and `G`
* `oplax_nat_trans.vcomp η θ` : the vertical composition of oplax natural transformations `η`
and `θ`
* `oplax_nat_trans.category F G` : the category structure on the oplax natural transformations
between `F` and `G`
-/
namespace CategoryTheory
open Category Bicategory
open Bicategory
universe w₁ w₂ v₁ v₂ u₁ u₂
variable {B : Type u₁} [Bicategory.{w₁, v₁} B] {C : Type u₂} [Bicategory.{w₂, v₂} C]
/-- If `η` is an oplax natural transformation between `F` and `G`, we have a 1-morphism
`η.app a : F.obj a ⟶ G.obj a` for each object `a : B`. We also have a 2-morphism
`η.naturality f : F.map f ≫ app b ⟶ app a ≫ G.map f` for each 1-morphism `f : a ⟶ b`.
These 2-morphisms satisfies the naturality condition, and preserve the identities and
the compositions modulo some adjustments of domains and codomains of 2-morphisms.
-/
structure OplaxNatTrans (F G : OplaxFunctor B C) where
app (a : B) : F.obj a ⟶ G.obj a
naturality {a b : B} (f : a ⟶ b) : F.map f ≫ app b ⟶ app a ≫ G.map f
naturality_naturality' :
∀ {a b : B} {f g : a ⟶ b} (η : f ⟶ g),
F.zipWith η ▷ app b ≫ naturality g = naturality f ≫ app a ◁ G.zipWith η := by
obviously
naturality_id' :
∀ a : B,
naturality (𝟙 a) ≫ app a ◁ G.map_id a =
F.map_id a ▷ app a ≫ (λ_ (app a)).Hom ≫ (ρ_ (app a)).inv := by
obviously
naturality_comp' :
∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
naturality (f ≫ g) ≫ app a ◁ G.map_comp f g =
F.map_comp f g ▷ app c ≫
(α_ _ _ _).Hom ≫
F.map f ◁ naturality g ≫ (α_ _ _ _).inv ≫ naturality f ▷ G.map g ≫ (α_ _ _ _).Hom := by
obviously
#align category_theory.oplax_nat_trans CategoryTheory.OplaxNatTrans
restate_axiom oplax_nat_trans.naturality_naturality'
restate_axiom oplax_nat_trans.naturality_id'
restate_axiom oplax_nat_trans.naturality_comp'
attribute [simp, reassoc.1]
oplax_nat_trans.naturality_naturality oplax_nat_trans.naturality_id oplax_nat_trans.naturality_comp
namespace OplaxNatTrans
section
variable (F : OplaxFunctor B C)
/-- The identity oplax natural transformation. -/
@[simps]
def id : OplaxNatTrans F F where
app a := 𝟙 (F.obj a)
naturality a b f := (ρ_ (F.map f)).Hom ≫ (λ_ (F.map f)).inv
#align category_theory.oplax_nat_trans.id CategoryTheory.OplaxNatTrans.id
instance : Inhabited (OplaxNatTrans F F) :=
⟨id F⟩
variable {F} {G H : OplaxFunctor B C} (η : OplaxNatTrans F G) (θ : OplaxNatTrans G H)
section
variable {a b c : B} {a' : C}
@[simp, reassoc.1]
theorem whiskerLeft_naturality_naturality (f : a' ⟶ G.obj a) {g h : a ⟶ b} (β : g ⟶ h) :
f ◁ G.zipWith β ▷ θ.app b ≫ f ◁ θ.naturality h =
f ◁ θ.naturality g ≫ f ◁ θ.app a ◁ H.zipWith β :=
by simp_rw [← bicategory.whisker_left_comp, naturality_naturality]
#align category_theory.oplax_nat_trans.whisker_left_naturality_naturality CategoryTheory.OplaxNatTrans.whiskerLeft_naturality_naturality
@[simp, reassoc.1]
theorem whiskerRight_naturality_naturality {f g : a ⟶ b} (β : f ⟶ g) (h : G.obj b ⟶ a') :
F.zipWith β ▷ η.app b ▷ h ≫ η.naturality g ▷ h =
η.naturality f ▷ h ≫ (α_ _ _ _).Hom ≫ η.app a ◁ G.zipWith β ▷ h ≫ (α_ _ _ _).inv :=
by rw [← comp_whisker_right, naturality_naturality, comp_whisker_right, whisker_assoc]
#align category_theory.oplax_nat_trans.whisker_right_naturality_naturality CategoryTheory.OplaxNatTrans.whiskerRight_naturality_naturality
@[simp, reassoc.1]
theorem whiskerLeft_naturality_comp (f : a' ⟶ G.obj a) (g : a ⟶ b) (h : b ⟶ c) :
f ◁ θ.naturality (g ≫ h) ≫ f ◁ θ.app a ◁ H.map_comp g h =
f ◁ G.map_comp g h ▷ θ.app c ≫
f ◁ (α_ _ _ _).Hom ≫
f ◁ G.map g ◁ θ.naturality h ≫
f ◁ (α_ _ _ _).inv ≫ f ◁ θ.naturality g ▷ H.map h ≫ f ◁ (α_ _ _ _).Hom :=
by simp_rw [← bicategory.whisker_left_comp, naturality_comp]
#align category_theory.oplax_nat_trans.whisker_left_naturality_comp CategoryTheory.OplaxNatTrans.whiskerLeft_naturality_comp
@[simp, reassoc.1]
theorem whiskerRight_naturality_comp (f : a ⟶ b) (g : b ⟶ c) (h : G.obj c ⟶ a') :
η.naturality (f ≫ g) ▷ h ≫ (α_ _ _ _).Hom ≫ η.app a ◁ G.map_comp f g ▷ h =
F.map_comp f g ▷ η.app c ▷ h ≫
(α_ _ _ _).Hom ▷ h ≫
(α_ _ _ _).Hom ≫
F.map f ◁ η.naturality g ▷ h ≫
(α_ _ _ _).inv ≫
(α_ _ _ _).inv ▷ h ≫
η.naturality f ▷ G.map g ▷ h ≫ (α_ _ _ _).Hom ▷ h ≫ (α_ _ _ _).Hom :=
by
rw [← associator_naturality_middle, ← comp_whisker_right_assoc, naturality_comp]
simp
#align category_theory.oplax_nat_trans.whisker_right_naturality_comp CategoryTheory.OplaxNatTrans.whiskerRight_naturality_comp
@[simp, reassoc.1]
theorem whiskerLeft_naturality_id (f : a' ⟶ G.obj a) :
f ◁ θ.naturality (𝟙 a) ≫ f ◁ θ.app a ◁ H.map_id a =
f ◁ G.map_id a ▷ θ.app a ≫ f ◁ (λ_ (θ.app a)).Hom ≫ f ◁ (ρ_ (θ.app a)).inv :=
by simp_rw [← bicategory.whisker_left_comp, naturality_id]
#align category_theory.oplax_nat_trans.whisker_left_naturality_id CategoryTheory.OplaxNatTrans.whiskerLeft_naturality_id
@[simp, reassoc.1]
theorem whiskerRight_naturality_id (f : G.obj a ⟶ a') :
η.naturality (𝟙 a) ▷ f ≫ (α_ _ _ _).Hom ≫ η.app a ◁ G.map_id a ▷ f =
F.map_id a ▷ η.app a ▷ f ≫ (λ_ (η.app a)).Hom ▷ f ≫ (ρ_ (η.app a)).inv ▷ f ≫ (α_ _ _ _).Hom :=
by
rw [← associator_naturality_middle, ← comp_whisker_right_assoc, naturality_id]
simp
#align category_theory.oplax_nat_trans.whisker_right_naturality_id CategoryTheory.OplaxNatTrans.whiskerRight_naturality_id
end
/-- Vertical composition of oplax natural transformations. -/
@[simps]
def vcomp (η : OplaxNatTrans F G) (θ : OplaxNatTrans G H) : OplaxNatTrans F H
where
app a := η.app a ≫ θ.app a
naturality a b f :=
(α_ _ _ _).inv ≫
η.naturality f ▷ θ.app b ≫ (α_ _ _ _).Hom ≫ η.app a ◁ θ.naturality f ≫ (α_ _ _ _).inv
naturality_comp' a b c f g :=
by
calc
_ =
_ ≫
F.map_comp f g ▷ η.app c ▷ θ.app c ≫
_ ≫
F.map f ◁ η.naturality g ▷ θ.app c ≫
_ ≫
(F.map f ≫ η.app b) ◁ θ.naturality g ≫
η.naturality f ▷ (θ.app b ≫ H.map g) ≫
_ ≫ η.app a ◁ θ.naturality f ▷ H.map g ≫ _ :=
_
_ = _ := _
exact (α_ _ _ _).inv
exact (α_ _ _ _).Hom ▷ _ ≫ (α_ _ _ _).Hom
exact _ ◁ (α_ _ _ _).Hom ≫ (α_ _ _ _).inv
exact (α_ _ _ _).Hom ≫ _ ◁ (α_ _ _ _).inv
exact _ ◁ (α_ _ _ _).Hom ≫ (α_ _ _ _).inv
· rw [whisker_exchange_assoc]
simp
· simp
#align category_theory.oplax_nat_trans.vcomp CategoryTheory.OplaxNatTrans.vcomp
variable (B C)
@[simps]
instance : CategoryStruct (OplaxFunctor B C)
where
Hom := OplaxNatTrans
id := OplaxNatTrans.id
comp F G H := OplaxNatTrans.vcomp
end
section
variable {F G : OplaxFunctor B C}
/-- A modification `Γ` between oplax natural transformations `η` and `θ` consists of a family of
2-morphisms `Γ.app a : η.app a ⟶ θ.app a`, which satisfies the equation
`(F.map f ◁ app b) ≫ θ.naturality f = η.naturality f ≫ (app a ▷ G.map f)`
for each 1-morphism `f : a ⟶ b`.
-/
@[ext]
structure Modification (η θ : F ⟶ G) where
app (a : B) : η.app a ⟶ θ.app a
naturality' :
∀ {a b : B} (f : a ⟶ b),
F.map f ◁ app b ≫ θ.naturality f = η.naturality f ≫ app a ▷ G.map f := by
obviously
#align category_theory.oplax_nat_trans.modification CategoryTheory.OplaxNatTrans.Modification
restate_axiom modification.naturality'
attribute [simp, reassoc.1] modification.naturality
variable {η θ ι : F ⟶ G}
namespace Modification
variable (η)
/-- The identity modification. -/
@[simps]
def id : Modification η η where app a := 𝟙 (η.app a)
#align category_theory.oplax_nat_trans.modification.id CategoryTheory.OplaxNatTrans.Modification.id
instance : Inhabited (Modification η η) :=
⟨Modification.id η⟩
variable {η}
section
variable (Γ : Modification η θ) {a b c : B} {a' : C}
@[simp, reassoc.1]
theorem whiskerLeft_naturality (f : a' ⟶ F.obj b) (g : b ⟶ c) :
f ◁ F.map g ◁ Γ.app c ≫ f ◁ θ.naturality g = f ◁ η.naturality g ≫ f ◁ Γ.app b ▷ G.map g := by
simp_rw [← bicategory.whisker_left_comp, naturality]
#align category_theory.oplax_nat_trans.modification.whisker_left_naturality CategoryTheory.OplaxNatTrans.Modification.whiskerLeft_naturality
@[simp, reassoc.1]
theorem whiskerRight_naturality (f : a ⟶ b) (g : G.obj b ⟶ a') :
F.map f ◁ Γ.app b ▷ g ≫ (α_ _ _ _).inv ≫ θ.naturality f ▷ g =
(α_ _ _ _).inv ≫ η.naturality f ▷ g ≫ Γ.app a ▷ G.map f ▷ g :=
by simp_rw [associator_inv_naturality_middle_assoc, ← comp_whisker_right, naturality]
#align category_theory.oplax_nat_trans.modification.whisker_right_naturality CategoryTheory.OplaxNatTrans.Modification.whiskerRight_naturality
end
/-- Vertical composition of modifications. -/
@[simps]
def vcomp (Γ : Modification η θ) (Δ : Modification θ ι) : Modification η ι
where app a := Γ.app a ≫ Δ.app a
#align category_theory.oplax_nat_trans.modification.vcomp CategoryTheory.OplaxNatTrans.Modification.vcomp
end Modification
/-- Category structure on the oplax natural transformations between oplax_functors. -/
@[simps]
instance category (F G : OplaxFunctor B C) : Category (F ⟶ G)
where
Hom := Modification
id := Modification.id
comp η θ ι := Modification.vcomp
#align category_theory.oplax_nat_trans.category CategoryTheory.OplaxNatTrans.category
/-- Construct a modification isomorphism between oplax natural transformations
by giving object level isomorphisms, and checking naturality only in the forward direction.
-/
@[simps]
def ModificationIso.ofComponents (app : ∀ a, η.app a ≅ θ.app a)
(naturality :
∀ {a b} (f : a ⟶ b),
F.map f ◁ (app b).Hom ≫ θ.naturality f = η.naturality f ≫ (app a).Hom ▷ G.map f) :
η ≅ θ where
Hom := { app := fun a => (app a).Hom }
inv :=
{ app := fun a => (app a).inv
naturality' := fun a b f => by
simpa using congr_arg (fun f => _ ◁ (app b).inv ≫ f ≫ (app a).inv ▷ _) (naturality f).symm }
#align category_theory.oplax_nat_trans.modification_iso.of_components CategoryTheory.OplaxNatTrans.ModificationIso.ofComponents
end
end OplaxNatTrans
end CategoryTheory
|
/-
Copyright (c) 2020 Bhavik Mehta. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bhavik Mehta
! This file was ported from Lean 3 source module category_theory.limits.preserves.shapes.equalizers
! leanprover-community/mathlib commit f47581155c818e6361af4e4fda60d27d020c226b
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.CategoryTheory.Limits.Shapes.SplitCoequalizer
import Mathbin.CategoryTheory.Limits.Preserves.Basic
/-!
# Preserving (co)equalizers
> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.
Constructions to relate the notions of preserving (co)equalizers and reflecting (co)equalizers
to concrete (co)forks.
In particular, we show that `equalizer_comparison f g G` is an isomorphism iff `G` preserves
the limit of the parallel pair `f,g`, as well as the dual result.
-/
noncomputable section
universe w v₁ v₂ u₁ u₂
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
variable {C : Type u₁} [Category.{v₁} C]
variable {D : Type u₂} [Category.{v₂} D]
variable (G : C ⥤ D)
namespace CategoryTheory.Limits
section Equalizers
variable {X Y Z : C} {f g : X ⟶ Y} {h : Z ⟶ X} (w : h ≫ f = h ≫ g)
/- warning: category_theory.limits.is_limit_map_cone_fork_equiv -> CategoryTheory.Limits.isLimitMapConeForkEquiv is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z X} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)), Equiv.{max 1 (succ u4) (succ u2), max 1 (succ u4) (succ u2)} (CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Functor.comp.{0, u1, u2, 0, u3, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 D _inst_2 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G) (CategoryTheory.Functor.mapCone.{0, u1, u2, 0, u3, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 D _inst_2 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G (CategoryTheory.Limits.Fork.ofι.{u1, u3} C _inst_1 X Y f g Z h w))) (CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.Fork.ofι.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z X h) (CategoryTheory.Limits.isLimitMapConeForkEquiv._proof_1.{u3, u4, u1, u2} C _inst_1 D _inst_2 G X Y Z f g h w)))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z X} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)), Equiv.{max (succ u4) (succ u2), max (succ u4) (succ u2)} (CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Functor.comp.{0, u1, u2, 0, u3, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 D _inst_2 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G) (CategoryTheory.Functor.mapCone.{0, u1, u2, 0, u3, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 D _inst_2 G (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Fork.ofι.{u1, u3} C _inst_1 X Y f g Z h w))) (CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.Fork.ofι.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (of_eq_true (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g))) (Eq.trans.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g))) True (congr.{succ u2, 1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (congrArg.{succ u2, succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) ((Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) -> Prop) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y))) (Eq.trans.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) Z X Y h f) (congrArg.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y) w))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) Z X Y h g)) (eq_self.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)))))))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.is_limit_map_cone_fork_equiv CategoryTheory.Limits.isLimitMapConeForkEquivₓ'. -/
/-- The map of a fork is a limit iff the fork consisting of the mapped morphisms is a limit. This
essentially lets us commute `fork.of_ι` with `functor.map_cone`.
-/
def isLimitMapConeForkEquiv :
IsLimit (G.mapCone (Fork.ofι h w)) ≃
IsLimit (Fork.ofι (G.map h) (by simp only [← G.map_comp, w]) : Fork (G.map f) (G.map g)) :=
(IsLimit.postcomposeHomEquiv (diagramIsoParallelPair _) _).symm.trans
(IsLimit.equivIsoLimit (Fork.ext (Iso.refl _) (by simp [fork.ι])))
#align category_theory.limits.is_limit_map_cone_fork_equiv CategoryTheory.Limits.isLimitMapConeForkEquiv
/- warning: category_theory.limits.is_limit_fork_map_of_is_limit -> CategoryTheory.Limits.isLimitForkMapOfIsLimit is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z X} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) [_inst_3 : CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], (CategoryTheory.Limits.IsLimit.{0, u1, 0, u3} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Fork.ofι.{u1, u3} C _inst_1 X Y f g Z h w)) -> (CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.Fork.ofι.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z X h) (CategoryTheory.Limits.isLimitMapConeForkEquiv._proof_1.{u3, u4, u1, u2} C _inst_1 D _inst_2 G X Y Z f g h w)))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z X} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) [_inst_3 : CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], (CategoryTheory.Limits.IsLimit.{0, u1, 0, u3} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Fork.ofι.{u1, u3} C _inst_1 X Y f g Z h w)) -> (CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.Fork.ofι.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (of_eq_true (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g))) (Eq.trans.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g))) True (congr.{succ u2, 1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (congrArg.{succ u2, succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) ((Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) -> Prop) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y))) (Eq.trans.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) Z X Y h f) (congrArg.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y) w))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) Z X Y h g)) (eq_self.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)))))))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.is_limit_fork_map_of_is_limit CategoryTheory.Limits.isLimitForkMapOfIsLimitₓ'. -/
/-- The property of preserving equalizers expressed in terms of forks. -/
def isLimitForkMapOfIsLimit [PreservesLimit (parallelPair f g) G] (l : IsLimit (Fork.ofι h w)) :
IsLimit (Fork.ofι (G.map h) (by simp only [← G.map_comp, w]) : Fork (G.map f) (G.map g)) :=
isLimitMapConeForkEquiv G w (PreservesLimit.preserves l)
#align category_theory.limits.is_limit_fork_map_of_is_limit CategoryTheory.Limits.isLimitForkMapOfIsLimit
/- warning: category_theory.limits.is_limit_of_is_limit_fork_map -> CategoryTheory.Limits.isLimitOfIsLimitForkMap is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z X} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) [_inst_3 : CategoryTheory.Limits.ReflectsLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], (CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.Fork.ofι.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z X h) (CategoryTheory.Limits.isLimitOfIsLimitForkMap._proof_1.{u3, u4, u1, u2} C _inst_1 D _inst_2 G X Y Z f g h w))) -> (CategoryTheory.Limits.IsLimit.{0, u1, 0, u3} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Fork.ofι.{u1, u3} C _inst_1 X Y f g Z h w))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z X} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) [_inst_3 : CategoryTheory.Limits.ReflectsLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], (CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.Fork.ofι.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (of_eq_true (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g))) (Eq.trans.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g))) True (congr.{succ u2, 1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (congrArg.{succ u2, succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) ((Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) -> Prop) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y))) (Eq.trans.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z X h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) Z X Y h f) (congrArg.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Z Y) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h f) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y) w))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) Z X Y h g)) (eq_self.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) Z X Y h g))))))) -> (CategoryTheory.Limits.IsLimit.{0, u1, 0, u3} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Fork.ofι.{u1, u3} C _inst_1 X Y f g Z h w))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.is_limit_of_is_limit_fork_map CategoryTheory.Limits.isLimitOfIsLimitForkMapₓ'. -/
/-- The property of reflecting equalizers expressed in terms of forks. -/
def isLimitOfIsLimitForkMap [ReflectsLimit (parallelPair f g) G]
(l : IsLimit (Fork.ofι (G.map h) (by simp only [← G.map_comp, w]) : Fork (G.map f) (G.map g))) :
IsLimit (Fork.ofι h w) :=
ReflectsLimit.reflects ((isLimitMapConeForkEquiv G w).symm l)
#align category_theory.limits.is_limit_of_is_limit_fork_map CategoryTheory.Limits.isLimitOfIsLimitForkMap
variable (f g) [HasEqualizer f g]
/- warning: category_theory.limits.is_limit_of_has_equalizer_of_preserves_limit -> CategoryTheory.Limits.isLimitOfHasEqualizerOfPreservesLimit is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasEqualizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.Fork.ofι.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.isLimitOfHasEqualizerOfPreservesLimit._proof_1.{u3, u4, u1, u2} C _inst_1 D _inst_2 G X Y f g _inst_3))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasEqualizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Limits.IsLimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.Fork.ofι.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (Eq.mpr.{0} (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g))) (id.{0} (Eq.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g)))) (congr.{succ u2, 1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g)) (congrArg.{succ u2, succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) ((Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) -> Prop) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f)) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g))) (Eq.mpr.{0} (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g))) (id.{0} (Eq.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g)))) (Eq.ndrec.{0, succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f) (fun (_a : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y) => Eq.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y _a) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g)))) (Eq.refl.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) f)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g)))) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g) (CategoryTheory.Limits.equalizer.condition.{u1, u3} C _inst_1 X Y f g _inst_3))) (Eq.refl.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) Y (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3) X Y (CategoryTheory.Limits.equalizer.ι.{u1, u3} C _inst_1 X Y f g _inst_3) g))))))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.is_limit_of_has_equalizer_of_preserves_limit CategoryTheory.Limits.isLimitOfHasEqualizerOfPreservesLimitₓ'. -/
/--
If `G` preserves equalizers and `C` has them, then the fork constructed of the mapped morphisms of
a fork is a limit.
-/
def isLimitOfHasEqualizerOfPreservesLimit [PreservesLimit (parallelPair f g) G] :
IsLimit
(Fork.ofι (G.map (equalizer.ι f g)) (by simp only [← G.map_comp, equalizer.condition])) :=
isLimitForkMapOfIsLimit G _ (equalizerIsEqualizer f g)
#align category_theory.limits.is_limit_of_has_equalizer_of_preserves_limit CategoryTheory.Limits.isLimitOfHasEqualizerOfPreservesLimit
variable [HasEqualizer (G.map f) (G.map g)]
/- warning: category_theory.limits.preserves_equalizer.of_iso_comparison -> CategoryTheory.Limits.PreservesEqualizer.ofIsoComparison is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasEqualizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasEqualizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [i : CategoryTheory.IsIso.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.equalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Limits.equalizerComparison.{u1, u2, u3, u4} C _inst_1 X Y f g D _inst_2 G _inst_3 _inst_4)], CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasEqualizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasEqualizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [i : CategoryTheory.IsIso.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.equalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (CategoryTheory.Limits.equalizerComparison.{u1, u2, u3, u4} C _inst_1 X Y f g D _inst_2 G _inst_3 _inst_4)], CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G
Case conversion may be inaccurate. Consider using '#align category_theory.limits.preserves_equalizer.of_iso_comparison CategoryTheory.Limits.PreservesEqualizer.ofIsoComparisonₓ'. -/
/-- If the equalizer comparison map for `G` at `(f,g)` is an isomorphism, then `G` preserves the
equalizer of `(f,g)`.
-/
def PreservesEqualizer.ofIsoComparison [i : IsIso (equalizerComparison f g G)] :
PreservesLimit (parallelPair f g) G :=
by
apply preserves_limit_of_preserves_limit_cone (equalizer_is_equalizer f g)
apply (is_limit_map_cone_fork_equiv _ _).symm _
apply is_limit.of_point_iso (limit.is_limit (parallel_pair (G.map f) (G.map g)))
apply i
#align category_theory.limits.preserves_equalizer.of_iso_comparison CategoryTheory.Limits.PreservesEqualizer.ofIsoComparison
variable [PreservesLimit (parallelPair f g) G]
/- warning: category_theory.limits.preserves_equalizer.iso -> CategoryTheory.Limits.PreservesEqualizer.iso is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasEqualizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasEqualizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Iso.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.equalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4)
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasEqualizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasEqualizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Iso.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.equalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4)
Case conversion may be inaccurate. Consider using '#align category_theory.limits.preserves_equalizer.iso CategoryTheory.Limits.PreservesEqualizer.isoₓ'. -/
/--
If `G` preserves the equalizer of `(f,g)`, then the equalizer comparison map for `G` at `(f,g)` is
an isomorphism.
-/
def PreservesEqualizer.iso : G.obj (equalizer f g) ≅ equalizer (G.map f) (G.map g) :=
IsLimit.conePointUniqueUpToIso (isLimitOfHasEqualizerOfPreservesLimit G f g) (limit.isLimit _)
#align category_theory.limits.preserves_equalizer.iso CategoryTheory.Limits.PreservesEqualizer.iso
/- warning: category_theory.limits.preserves_equalizer.iso_hom -> CategoryTheory.Limits.PreservesEqualizer.iso_hom is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasEqualizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasEqualizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.equalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4)) (CategoryTheory.Iso.hom.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.equalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Limits.PreservesEqualizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.Limits.equalizerComparison.{u1, u2, u3, u4} C _inst_1 X Y f g D _inst_2 G _inst_3 _inst_4)
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasEqualizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasEqualizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesLimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.equalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4)) (CategoryTheory.Iso.hom.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.equalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.equalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (CategoryTheory.Limits.PreservesEqualizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.Limits.equalizerComparison.{u1, u2, u3, u4} C _inst_1 X Y f g D _inst_2 G _inst_3 _inst_4)
Case conversion may be inaccurate. Consider using '#align category_theory.limits.preserves_equalizer.iso_hom CategoryTheory.Limits.PreservesEqualizer.iso_homₓ'. -/
@[simp]
theorem PreservesEqualizer.iso_hom :
(PreservesEqualizer.iso G f g).Hom = equalizerComparison f g G :=
rfl
#align category_theory.limits.preserves_equalizer.iso_hom CategoryTheory.Limits.PreservesEqualizer.iso_hom
instance : IsIso (equalizerComparison f g G) :=
by
rw [← preserves_equalizer.iso_hom]
infer_instance
end Equalizers
section Coequalizers
variable {X Y Z : C} {f g : X ⟶ Y} {h : Y ⟶ Z} (w : f ≫ h = g ≫ h)
/- warning: category_theory.limits.is_colimit_map_cocone_cofork_equiv -> CategoryTheory.Limits.isColimitMapCoconeCoforkEquiv is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Y Z} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)), Equiv.{max 1 (succ u4) (succ u2), max 1 (succ u4) (succ u2)} (CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Functor.comp.{0, u1, u2, 0, u3, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 D _inst_2 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G) (CategoryTheory.Functor.mapCocone.{0, u1, u2, 0, u3, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 D _inst_2 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G (CategoryTheory.Limits.Cofork.ofπ.{u1, u3} C _inst_1 X Y f g Z h w))) (CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.Cofork.ofπ.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y Z h) (CategoryTheory.Limits.isColimitMapCoconeCoforkEquiv._proof_1.{u3, u4, u1, u2} C _inst_1 D _inst_2 G X Y Z f g h w)))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Y Z} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)), Equiv.{max (succ u4) (succ u2), max (succ u4) (succ u2)} (CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Functor.comp.{0, u1, u2, 0, u3, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 D _inst_2 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G) (CategoryTheory.Functor.mapCocone.{0, u1, u2, 0, u3, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 D _inst_2 G (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Cofork.ofπ.{u1, u3} C _inst_1 X Y f g Z h w))) (CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.Cofork.ofπ.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h) (of_eq_true (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.trans.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h))) True (congr.{succ u2, 1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (congrArg.{succ u2, succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) ((Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) -> Prop) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z))) (Eq.trans.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) X Y Z f h) (congrArg.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z) w))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) X Y Z g h)) (eq_self.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)))))))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.is_colimit_map_cocone_cofork_equiv CategoryTheory.Limits.isColimitMapCoconeCoforkEquivₓ'. -/
/-- The map of a cofork is a colimit iff the cofork consisting of the mapped morphisms is a colimit.
This essentially lets us commute `cofork.of_π` with `functor.map_cocone`.
-/
def isColimitMapCoconeCoforkEquiv :
IsColimit (G.mapCocone (Cofork.ofπ h w)) ≃
IsColimit
(Cofork.ofπ (G.map h) (by simp only [← G.map_comp, w]) : Cofork (G.map f) (G.map g)) :=
(IsColimit.precomposeInvEquiv (diagramIsoParallelPair _) _).symm.trans <|
IsColimit.equivIsoColimit <|
Cofork.ext (Iso.refl _) <|
by
dsimp only [cofork.π, cofork.of_π_ι_app]
dsimp; rw [category.comp_id, category.id_comp]
#align category_theory.limits.is_colimit_map_cocone_cofork_equiv CategoryTheory.Limits.isColimitMapCoconeCoforkEquiv
/- warning: category_theory.limits.is_colimit_cofork_map_of_is_colimit -> CategoryTheory.Limits.isColimitCoforkMapOfIsColimit is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Y Z} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) [_inst_3 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], (CategoryTheory.Limits.IsColimit.{0, u1, 0, u3} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Cofork.ofπ.{u1, u3} C _inst_1 X Y f g Z h w)) -> (CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.Cofork.ofπ.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y Z h) (CategoryTheory.Limits.isColimitMapCoconeCoforkEquiv._proof_1.{u3, u4, u1, u2} C _inst_1 D _inst_2 G X Y Z f g h w)))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Y Z} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) [_inst_3 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], (CategoryTheory.Limits.IsColimit.{0, u1, 0, u3} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Cofork.ofπ.{u1, u3} C _inst_1 X Y f g Z h w)) -> (CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.Cofork.ofπ.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h) (of_eq_true (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.trans.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h))) True (congr.{succ u2, 1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (congrArg.{succ u2, succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) ((Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) -> Prop) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z))) (Eq.trans.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) X Y Z f h) (congrArg.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z) w))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) X Y Z g h)) (eq_self.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)))))))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.is_colimit_cofork_map_of_is_colimit CategoryTheory.Limits.isColimitCoforkMapOfIsColimitₓ'. -/
/-- The property of preserving coequalizers expressed in terms of coforks. -/
def isColimitCoforkMapOfIsColimit [PreservesColimit (parallelPair f g) G]
(l : IsColimit (Cofork.ofπ h w)) :
IsColimit
(Cofork.ofπ (G.map h) (by simp only [← G.map_comp, w]) : Cofork (G.map f) (G.map g)) :=
isColimitMapCoconeCoforkEquiv G w (PreservesColimit.preserves l)
#align category_theory.limits.is_colimit_cofork_map_of_is_colimit CategoryTheory.Limits.isColimitCoforkMapOfIsColimit
/- warning: category_theory.limits.is_colimit_of_is_colimit_cofork_map -> CategoryTheory.Limits.isColimitOfIsColimitCoforkMap is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Y Z} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) [_inst_3 : CategoryTheory.Limits.ReflectsColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], (CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.Cofork.ofπ.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Z) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y Z h) (CategoryTheory.Limits.isColimitOfIsColimitCoforkMap._proof_1.{u3, u4, u1, u2} C _inst_1 D _inst_2 G X Y Z f g h w))) -> (CategoryTheory.Limits.IsColimit.{0, u1, 0, u3} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Cofork.ofπ.{u1, u3} C _inst_1 X Y f g Z h w))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} {Z : C} {f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y} {h : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) Y Z} (w : Eq.{succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) [_inst_3 : CategoryTheory.Limits.ReflectsColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], (CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.Cofork.ofπ.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h) (of_eq_true (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.trans.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h))) True (congr.{succ u2, 1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (congrArg.{succ u2, succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) ((Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) -> Prop) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z))) (Eq.trans.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y Z h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) X Y Z f h) (congrArg.{succ u1, succ u2} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Z) (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z f h) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z) w))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) X Y Z g h)) (eq_self.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Z)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Z (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y Z g h))))))) -> (CategoryTheory.Limits.IsColimit.{0, u1, 0, u3} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory C _inst_1 (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) (CategoryTheory.Limits.Cofork.ofπ.{u1, u3} C _inst_1 X Y f g Z h w))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.is_colimit_of_is_colimit_cofork_map CategoryTheory.Limits.isColimitOfIsColimitCoforkMapₓ'. -/
/-- The property of reflecting coequalizers expressed in terms of coforks. -/
def isColimitOfIsColimitCoforkMap [ReflectsColimit (parallelPair f g) G]
(l :
IsColimit
(Cofork.ofπ (G.map h) (by simp only [← G.map_comp, w]) : Cofork (G.map f) (G.map g))) :
IsColimit (Cofork.ofπ h w) :=
ReflectsColimit.reflects ((isColimitMapCoconeCoforkEquiv G w).symm l)
#align category_theory.limits.is_colimit_of_is_colimit_cofork_map CategoryTheory.Limits.isColimitOfIsColimitCoforkMap
variable (f g) [HasCoequalizer f g]
/- warning: category_theory.limits.is_colimit_of_has_coequalizer_of_preserves_colimit -> CategoryTheory.Limits.isColimitOfHasCoequalizerOfPreservesColimit is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.Cofork.ofπ.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.isColimitOfHasCoequalizerOfPreservesColimit._proof_1.{u3, u4, u1, u2} C _inst_1 D _inst_2 G X Y f g _inst_3))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Limits.IsColimit.{0, u2, 0, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.Cofork.ofπ.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (Eq.mpr.{0} (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (id.{0} (Eq.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))))) (congr.{succ u2, 1} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (congrArg.{succ u2, succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) ((Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) -> Prop) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) ((fun (x_0 : C) (x_1 : C) (x_2 : C) (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_0 x_1) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) x_1 x_2) => Eq.symm.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_2 (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) x_0 x_1 x_2 f g)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_2) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_0 x_1 f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) x_1 x_2 g)) ((fun (x_0 : C) (x_1 : C) (x_2 : C) => CategoryTheory.Functor.map_comp.{u1, u2, u3, u4} C _inst_1 D _inst_2 G x_0 x_1 x_2) x_0 x_1 x_2 f g)) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (Eq.mpr.{0} (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (id.{0} (Eq.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))))) (Eq.ndrec.{0, succ u1} (Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (fun (_a : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) => Eq.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))) (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) _a) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))))) (Eq.refl.{1} Prop (Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) f (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))))) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.condition.{u1, u3} C _inst_1 X Y f g _inst_3))) (Eq.refl.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.CategoryStruct.comp.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1) X Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) g (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)))))))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.is_colimit_of_has_coequalizer_of_preserves_colimit CategoryTheory.Limits.isColimitOfHasCoequalizerOfPreservesColimitₓ'. -/
/--
If `G` preserves coequalizers and `C` has them, then the cofork constructed of the mapped morphisms
of a cofork is a colimit.
-/
def isColimitOfHasCoequalizerOfPreservesColimit [PreservesColimit (parallelPair f g) G] :
IsColimit (Cofork.ofπ (G.map (coequalizer.π f g)) _) :=
isColimitCoforkMapOfIsColimit G _ (coequalizerIsCoequalizer f g)
#align category_theory.limits.is_colimit_of_has_coequalizer_of_preserves_colimit CategoryTheory.Limits.isColimitOfHasCoequalizerOfPreservesColimit
variable [HasCoequalizer (G.map f) (G.map g)]
/- warning: category_theory.limits.of_iso_comparison -> CategoryTheory.Limits.ofIsoComparison is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [i : CategoryTheory.IsIso.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizerComparison.{u1, u2, u3, u4} C _inst_1 X Y f g D _inst_2 G _inst_3 _inst_4)], CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [i : CategoryTheory.IsIso.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizerComparison.{u1, u2, u3, u4} C _inst_1 X Y f g D _inst_2 G _inst_3 _inst_4)], CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G
Case conversion may be inaccurate. Consider using '#align category_theory.limits.of_iso_comparison CategoryTheory.Limits.ofIsoComparisonₓ'. -/
/-- If the coequalizer comparison map for `G` at `(f,g)` is an isomorphism, then `G` preserves the
coequalizer of `(f,g)`.
-/
def ofIsoComparison [i : IsIso (coequalizerComparison f g G)] :
PreservesColimit (parallelPair f g) G :=
by
apply preserves_colimit_of_preserves_colimit_cocone (coequalizer_is_coequalizer f g)
apply (is_colimit_map_cocone_cofork_equiv _ _).symm _
apply is_colimit.of_point_iso (colimit.is_colimit (parallel_pair (G.map f) (G.map g)))
apply i
#align category_theory.limits.of_iso_comparison CategoryTheory.Limits.ofIsoComparison
variable [PreservesColimit (parallelPair f g) G]
/- warning: category_theory.limits.preserves_coequalizer.iso -> CategoryTheory.Limits.PreservesCoequalizer.iso is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Iso.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Iso.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.preserves_coequalizer.iso CategoryTheory.Limits.PreservesCoequalizer.isoₓ'. -/
/--
If `G` preserves the coequalizer of `(f,g)`, then the coequalizer comparison map for `G` at `(f,g)`
is an isomorphism.
-/
def PreservesCoequalizer.iso : coequalizer (G.map f) (G.map g) ≅ G.obj (coequalizer f g) :=
IsColimit.coconePointUniqueUpToIso (colimit.isColimit _)
(isColimitOfHasCoequalizerOfPreservesColimit G f g)
#align category_theory.limits.preserves_coequalizer.iso CategoryTheory.Limits.PreservesCoequalizer.iso
/- warning: category_theory.limits.preserves_coequalizer.iso_hom -> CategoryTheory.Limits.PreservesCoequalizer.iso_hom is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (CategoryTheory.Iso.hom.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.Limits.coequalizerComparison.{u1, u2, u3, u4} C _inst_1 X Y f g D _inst_2 G _inst_3 _inst_4)
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3))) (CategoryTheory.Iso.hom.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.Limits.coequalizerComparison.{u1, u2, u3, u4} C _inst_1 X Y f g D _inst_2 G _inst_3 _inst_4)
Case conversion may be inaccurate. Consider using '#align category_theory.limits.preserves_coequalizer.iso_hom CategoryTheory.Limits.PreservesCoequalizer.iso_homₓ'. -/
@[simp]
theorem PreservesCoequalizer.iso_hom :
(PreservesCoequalizer.iso G f g).Hom = coequalizerComparison f g G :=
rfl
#align category_theory.limits.preserves_coequalizer.iso_hom CategoryTheory.Limits.PreservesCoequalizer.iso_hom
instance : IsIso (coequalizerComparison f g G) :=
by
rw [← preserves_coequalizer.iso_hom]
infer_instance
/- warning: category_theory.limits.map_π_epi -> CategoryTheory.Limits.map_π_epi is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Epi.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], CategoryTheory.Epi.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.map_π_epi CategoryTheory.Limits.map_π_epiₓ'. -/
instance map_π_epi : Epi (G.map (coequalizer.π f g)) :=
⟨fun W h k => by
rw [← ι_comp_coequalizer_comparison]
apply (cancel_epi _).1
apply epi_comp⟩
#align category_theory.limits.map_π_epi CategoryTheory.Limits.map_π_epi
/- warning: category_theory.limits.map_π_preserves_coequalizer_inv -> CategoryTheory.Limits.map_π_preserves_coequalizer_inv is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Iso.inv.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5))) (CategoryTheory.Limits.coequalizer.π.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4)
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G], Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Iso.inv.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5))) (CategoryTheory.Limits.coequalizer.π.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4)
Case conversion may be inaccurate. Consider using '#align category_theory.limits.map_π_preserves_coequalizer_inv CategoryTheory.Limits.map_π_preserves_coequalizer_invₓ'. -/
@[reassoc.1]
theorem map_π_preserves_coequalizer_inv :
G.map (coequalizer.π f g) ≫ (PreservesCoequalizer.iso G f g).inv =
coequalizer.π (G.map f) (G.map g) :=
by
rw [← ι_comp_coequalizer_comparison_assoc, ← preserves_coequalizer.iso_hom, iso.hom_inv_id,
comp_id]
#align category_theory.limits.map_π_preserves_coequalizer_inv CategoryTheory.Limits.map_π_preserves_coequalizer_inv
/- warning: category_theory.limits.map_π_preserves_coequalizer_inv_desc -> CategoryTheory.Limits.map_π_preserves_coequalizer_inv_desc is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G] {W : D} (k : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) W) (wk : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) W) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) W (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) k) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) W (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) k)), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) W) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) W (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) W (CategoryTheory.Iso.inv.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.Limits.coequalizer.desc.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4 W k wk))) k
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G] {W : D} (k : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) W) (wk : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) W) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) W (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) k) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) W (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) k)), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) W) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) W (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) W (CategoryTheory.Iso.inv.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.Limits.coequalizer.desc.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4 W k wk))) k
Case conversion may be inaccurate. Consider using '#align category_theory.limits.map_π_preserves_coequalizer_inv_desc CategoryTheory.Limits.map_π_preserves_coequalizer_inv_descₓ'. -/
@[reassoc.1]
theorem map_π_preserves_coequalizer_inv_desc {W : D} (k : G.obj Y ⟶ W)
(wk : G.map f ≫ k = G.map g ≫ k) :
G.map (coequalizer.π f g) ≫ (PreservesCoequalizer.iso G f g).inv ≫ coequalizer.desc k wk = k :=
by rw [← category.assoc, map_π_preserves_coequalizer_inv, coequalizer.π_desc]
#align category_theory.limits.map_π_preserves_coequalizer_inv_desc CategoryTheory.Limits.map_π_preserves_coequalizer_inv_desc
/- warning: category_theory.limits.map_π_preserves_coequalizer_inv_colim_map -> CategoryTheory.Limits.map_π_preserves_coequalizer_inv_colimMap is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G] {X' : D} {Y' : D} (f' : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Y') (g' : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Y') [_inst_6 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 X' Y' f' g'] (p : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) X') (q : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Y') (wf : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) Y') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Y' (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) q) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) X' Y' p f')) (wg : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) Y') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Y' (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) q) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) X' Y' p g')), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6) (CategoryTheory.Iso.inv.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.Limits.colimMap.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_4 _inst_6 (CategoryTheory.Limits.parallelPairHom.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) X' Y' (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) f' g' p q wf wg)))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Y' (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6) q (CategoryTheory.Limits.coequalizer.π.{u2, u4} D _inst_2 X' Y' f' g' _inst_6))
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G] {X' : D} {Y' : D} (f' : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Y') (g' : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Y') [_inst_6 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 X' Y' f' g'] (p : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) X') (q : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Y') (wf : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) Y') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Y' (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) q) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) X' Y' p f')) (wg : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) Y') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Y' (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) q) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) X' Y' p g')), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6) (CategoryTheory.Iso.inv.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.Limits.colimMap.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_4 _inst_6 (CategoryTheory.Limits.parallelPairHom.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) X' Y' (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) f' g' p q wf wg)))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Y' (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 X' Y' f' g' _inst_6) q (CategoryTheory.Limits.coequalizer.π.{u2, u4} D _inst_2 X' Y' f' g' _inst_6))
Case conversion may be inaccurate. Consider using '#align category_theory.limits.map_π_preserves_coequalizer_inv_colim_map CategoryTheory.Limits.map_π_preserves_coequalizer_inv_colimMapₓ'. -/
@[reassoc.1]
theorem map_π_preserves_coequalizer_inv_colimMap {X' Y' : D} (f' g' : X' ⟶ Y')
[HasCoequalizer f' g'] (p : G.obj X ⟶ X') (q : G.obj Y ⟶ Y') (wf : G.map f ≫ q = p ≫ f')
(wg : G.map g ≫ q = p ≫ g') :
G.map (coequalizer.π f g) ≫
(PreservesCoequalizer.iso G f g).inv ≫
colimMap (parallelPairHom (G.map f) (G.map g) f' g' p q wf wg) =
q ≫ coequalizer.π f' g' :=
by rw [← category.assoc, map_π_preserves_coequalizer_inv, ι_colim_map, parallel_pair_hom_app_one]
#align category_theory.limits.map_π_preserves_coequalizer_inv_colim_map CategoryTheory.Limits.map_π_preserves_coequalizer_inv_colimMap
/- warning: category_theory.limits.map_π_preserves_coequalizer_inv_colim_map_desc -> CategoryTheory.Limits.map_π_preserves_coequalizer_inv_colimMap_desc is a dubious translation:
lean 3 declaration is
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G] {X' : D} {Y' : D} (f' : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Y') (g' : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Y') [_inst_6 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 X' Y' f' g'] (p : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) X') (q : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Y') (wf : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) Y') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Y' (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) q) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) X' Y' p f')) (wg : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) Y') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Y' (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) q) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) X' Y' p g')) {Z' : D} (h : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) Y' Z') (wh : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Z') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) X' Y' Z' f' h) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) X' Y' Z' g' h)), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Z') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) Z' (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) Z' (CategoryTheory.Iso.inv.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) _inst_4) (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6) Z' (CategoryTheory.Limits.colimMap.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g)) (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_4 _inst_6 (CategoryTheory.Limits.parallelPairHom.{u2, u4} D _inst_2 (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) X' Y' (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f) (CategoryTheory.Functor.map.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y g) f' g' p q wf wg)) (CategoryTheory.Limits.coequalizer.desc.{u2, u4} D _inst_2 X' Y' f' g' _inst_6 Z' h wh)))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Functor.obj.{u1, u2, u3, u4} C _inst_1 D _inst_2 G Y) Y' Z' q h)
but is expected to have type
forall {C : Type.{u3}} [_inst_1 : CategoryTheory.Category.{u1, u3} C] {D : Type.{u4}} [_inst_2 : CategoryTheory.Category.{u2, u4} D] (G : CategoryTheory.Functor.{u1, u2, u3, u4} C _inst_1 D _inst_2) {X : C} {Y : C} (f : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) (g : Quiver.Hom.{succ u1, u3} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) X Y) [_inst_3 : CategoryTheory.Limits.HasCoequalizer.{u1, u3} C _inst_1 X Y f g] [_inst_4 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)] [_inst_5 : CategoryTheory.Limits.PreservesColimit.{0, 0, u1, u2, u3, u4} C _inst_1 D _inst_2 CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory (CategoryTheory.Limits.parallelPair.{u1, u3} C _inst_1 X Y f g) G] {X' : D} {Y' : D} (f' : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Y') (g' : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Y') [_inst_6 : CategoryTheory.Limits.HasCoequalizer.{u2, u4} D _inst_2 X' Y' f' g'] (p : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) X') (q : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Y') (wf : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) Y') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Y' (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) q) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) X' Y' p f')) (wg : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) Y') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Y' (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) q) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) X' Y' p g')) {Z' : D} (h : Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) Y' Z') (wh : Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) X' Z') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) X' Y' Z' f' h) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) X' Y' Z' g' h)), Eq.{succ u2} (Quiver.Hom.{succ u2, u4} D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Z') (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) Z' (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3) (CategoryTheory.Limits.coequalizer.π.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) Z' (CategoryTheory.Iso.inv.{u2, u4} D _inst_2 (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) (CategoryTheory.Limits.coequalizer.{u1, u3} C _inst_1 X Y f g _inst_3)) (CategoryTheory.Limits.PreservesCoequalizer.iso.{u1, u2, u3, u4} C _inst_1 D _inst_2 G X Y f g _inst_3 _inst_4 _inst_5)) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (CategoryTheory.Limits.coequalizer.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) _inst_4) (CategoryTheory.Limits.colimit.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_6) Z' (CategoryTheory.Limits.colimMap.{0, 0, u2, u4} CategoryTheory.Limits.WalkingParallelPair CategoryTheory.Limits.walkingParallelPairHomCategory D _inst_2 (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g)) (CategoryTheory.Limits.parallelPair.{u2, u4} D _inst_2 X' Y' f' g') _inst_4 _inst_6 (CategoryTheory.Limits.parallelPairHom.{u2, u4} D _inst_2 (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) X' Y' (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y f) (Prefunctor.map.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) X Y g) f' g' p q wf wg)) (CategoryTheory.Limits.coequalizer.desc.{u2, u4} D _inst_2 X' Y' f' g' _inst_6 Z' h wh)))) (CategoryTheory.CategoryStruct.comp.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2) (Prefunctor.obj.{succ u1, succ u2, u3, u4} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u3} C (CategoryTheory.Category.toCategoryStruct.{u1, u3} C _inst_1)) D (CategoryTheory.CategoryStruct.toQuiver.{u2, u4} D (CategoryTheory.Category.toCategoryStruct.{u2, u4} D _inst_2)) (CategoryTheory.Functor.toPrefunctor.{u1, u2, u3, u4} C _inst_1 D _inst_2 G) Y) Y' Z' q h)
Case conversion may be inaccurate. Consider using '#align category_theory.limits.map_π_preserves_coequalizer_inv_colim_map_desc CategoryTheory.Limits.map_π_preserves_coequalizer_inv_colimMap_descₓ'. -/
@[reassoc.1]
theorem map_π_preserves_coequalizer_inv_colimMap_desc {X' Y' : D} (f' g' : X' ⟶ Y')
[HasCoequalizer f' g'] (p : G.obj X ⟶ X') (q : G.obj Y ⟶ Y') (wf : G.map f ≫ q = p ≫ f')
(wg : G.map g ≫ q = p ≫ g') {Z' : D} (h : Y' ⟶ Z') (wh : f' ≫ h = g' ≫ h) :
G.map (coequalizer.π f g) ≫
(PreservesCoequalizer.iso G f g).inv ≫
colimMap (parallelPairHom (G.map f) (G.map g) f' g' p q wf wg) ≫ coequalizer.desc h wh =
q ≫ h :=
by
slice_lhs 1 3 => rw [map_π_preserves_coequalizer_inv_colim_map]
slice_lhs 2 3 => rw [coequalizer.π_desc]
#align category_theory.limits.map_π_preserves_coequalizer_inv_colim_map_desc CategoryTheory.Limits.map_π_preserves_coequalizer_inv_colimMap_desc
#print CategoryTheory.Limits.preservesSplitCoequalizers /-
/-- Any functor preserves coequalizers of split pairs. -/
instance (priority := 1) preservesSplitCoequalizers (f g : X ⟶ Y) [HasSplitCoequalizer f g] :
PreservesColimit (parallelPair f g) G :=
by
apply
preserves_colimit_of_preserves_colimit_cocone
(has_split_coequalizer.is_split_coequalizer f g).isCoequalizer
apply
(is_colimit_map_cocone_cofork_equiv G _).symm
((has_split_coequalizer.is_split_coequalizer f g).map G).isCoequalizer
#align category_theory.limits.preserves_split_coequalizers CategoryTheory.Limits.preservesSplitCoequalizers
-/
end Coequalizers
end CategoryTheory.Limits
|
module IdrisJvm.Files
import Java.Nio
import IdrisJvm.IO
%access public export
JDirectory : Type
JDirectory = JVM_Native (Class "io/github/mmhelloworld/idrisjvm/io/Directory")
namespace Files
FilesClass : JVM_NativeTy
FilesClass = Class "io/github/mmhelloworld/idrisjvm/io/Files"
Files : Type
Files = JVM_Native FilesClass
readFile : String -> JVM_IO (Either Throwable String)
readFile = invokeStatic FilesClass "readFile" (String -> JVM_IO (Either Throwable String))
writeFile : String -> String -> JVM_IO (Either Throwable ())
writeFile = invokeStatic FilesClass "writeFile" (String -> String -> JVM_IO (Either Throwable ()))
createDirectory : String -> JVM_IO (Either Throwable ())
createDirectory = invokeStatic FilesClass "createDirectory" (String -> JVM_IO (Either Throwable ()))
createDirectories : Path -> JVM_IO (Either Throwable ())
createDirectories = invokeStatic FilesClass "createDirectories" (Path -> JVM_IO (Either Throwable ()))
changeDir : String -> JVM_IO Bool
changeDir = invokeStatic FilesClass "changeDir" (String -> JVM_IO Bool)
getTemporaryFileName : JVM_IO String
getTemporaryFileName = invokeStatic FilesClass "getTemporaryFileName" (JVM_IO String)
chmod : String -> Int -> JVM_IO ()
chmod = invokeStatic FilesClass "chmod" (String -> Int -> JVM_IO ())
getWorkingDir : JVM_IO String
getWorkingDir = invokeStatic FilesClass "getWorkingDir" (JVM_IO String)
createPath : String -> JVM_IO Path
createPath = invokeStatic FilesClass "createPath" (String -> JVM_IO Path)
deleteIfExists : Path -> JVM_IO Bool
deleteIfExists = invokeStatic FilesClass "deleteIfExists" (Path -> JVM_IO Bool)
openDirectory : String -> JVM_IO (Either Throwable JDirectory)
openDirectory = invokeStatic FilesClass "openDirectory" (String -> JVM_IO (Either Throwable JDirectory))
closeDirectory : JDirectory -> JVM_IO ()
closeDirectory = invokeStatic FilesClass "closeDirectory" (JDirectory -> JVM_IO ())
nextDirectoryEntry : JDirectory -> JVM_IO (Either Throwable String)
nextDirectoryEntry = invokeStatic FilesClass "getNextDirectoryEntry" (JDirectory -> JVM_IO (Either Throwable String))
|
module Control.Monad.Free
import Control.EffectAlgebra
||| Higher-order free monad.
||| Acts as a syntax generator of effectful programs.
public export
data Free : (sig : (Type -> Type) -> (Type -> Type))
-> Type
-> Type where
Return : a -> Free sig a
Op : sig (Free sig) a -> Free sig a
public export
Syntax sig => Functor (Free sig) where
map f (Return x) = Return (f x)
map f (Op op) = Op (emap (map f) op)
public export
Syntax sig => Applicative (Free sig) where
pure v = Return v
Return v <*> prog = map v prog
Op op <*> prog = Op (emap (<*> prog) op)
public export
Syntax sig => Monad (Free sig) where
Return v >>= prog = prog v
Op op >>= prog = Op (emap (>>= prog) op)
public export
return : a -> Free sig a
return = Return
public export
inject : Inj sub sup => sub (Free sup) a -> Free sup a
inject = Op . inj
public export
project : Prj sup sub => Free sup a -> Maybe (sub (Free sup) a)
project (Op s) = Just (prj s)
project _ = Nothing
|
\section{Summary and Outlook}
\label{sec:summary-and-outlook}
\todo{Axel and Regis write this...}
Summary what we have in v0.9 and presented in this paper.
Roadmap to v1.0, about half a page.
Short conclusion: Gammapy has potential to be the Python package for gamma-ray
astronomy.
Prospects for HAWC / SWGO? Or speak in general about water Cherenkov
observatories... |
Let’s say you have an established practice. A “suit” could literally just walk in and offer to purchase your practice. Maybe your office was recommend to Heartland by colleague. If that sale goes through, your colleague will be themselves a tidy bonus…let’s call it a finders fee – $2500 to $5000 or there about.
Heartland professes your office just becoming an “affiliate” – a term used quite loosely in the the world of corporate dentistry. But it has to be true, right? It’s everywhere! It’s all they say, they never mention owning dental clinics, just Heartland Affiliated Dental Centers.
They offer you a large sum of money to “affiliate”. A sum which is likely much more than the practice is actually worth if it were for sale.
But you’re not selling, right? You are simply becoming “affiliated” with Heartland so they can help you with your day to day operations – marketing, advertising, software, billing, etc.
For whatever reason, you decided to take their offer. and become a Heartland Dental “affiliated” dental center. What happens then?
In the employment agreement, they will agree to a not so bad salary, $120K –$150K a year, plus a percentage of profits. By profits, I mean “net” profits.
Contrary to what Heartland said, you just sold your practice and you just became their employee.
Yes, that is what is said, but it’s a lie. You are simply their employee forever more, or until you can get fired.
So you are now “affiliated” with Heartland Dental. What happens next?
You and your entire staff are whisked off to Effingham, IL for training. I say entire staff, but that might not be the staff you planned on keeping around. That staffing choice is no longer yours to decide – it’s Heartland Dental’s. There just went all that control of your practice promised!
Heartland Dental didn’t need that new $7.7 million training facility – HDC Institute. for nothing. They are going to be training you!
In fact, it’s likely any future training you get will be right there in Effingham at Heartland Dental.
While your office is closed, not producing income, and you and your staff are away at training camp, things maybe happening back at the office. A team may be invade what was once your office. This team is there to strip out your equipment and replace it with Heartlands. What was once your equipment, will be replace Heartland’s own – which could, and likely will, be of lesser quality. But hey, it’s got their software already loaded and ready to go.
Chop! Chop! Get to work!
What happens at the 1 to 2 week training sessions, other than your balance sheet taking a dive – remember, if you are in Effingham, you ain’t workin’. You and staff are learning the Heartland Way, that’s what.
Mr. Dentist, you are now to do nothing but procedures. You will do them as we are teaching you, it’s the only way you can meet the goals we are setting for your “affiliated” clinic. We might throw in some orthodontics training on a three day trip, if other revenue sources are needed, who knows.
Oh and the “partnership” plan mention in the propaganda piece, it’s really an Employee Stock Ownership Plan (ESOP). While most ESOP’s are stock given to the employee at no cost, you might be asked to “contribute” a $100K to Heartland’s ESOP. Doesn’t that just sound yummy. You get $100k worth of Heartland Stock. Rick get’s money for lunch.
It’s called a PA, not Public Address System nor, Physician's Assistant, but Practice Administrator. These little jewels go through extensive training at HDC Institute and are taught how to “handle” unruly dentists, so don’t be unruly.
Continuing Education? That will be done right at HDC Institute. You will get what they are serving. No matter if you could get it locally, for 1/3 the fee, less time away from the office.
Ms. Office Manager, you are now in charge of all treatment plans, presenting said plans to patients and pricing. [Nothing like a medically untrained office staff talking tell a patient about complicated medical procedures to make said patient safe!] If you can’t handle it, Ms. Office Manager, we have someone trained to step in at any time, but under no circumstance will Mr. Dentist being doing treatment plans. He’s to produce, nothing more.
Nothing is for free, ya know.
That training Heartland demands, costs money and your clinic’s revenues is going to pay for every dime of it. Could be as much as $3k-$5k per day. A Friday, Saturday, Sunday, pep rally, well, that may be $10k.
The Heartland brand continuing education, well that will come off your “affiliated” clinic’s bottom line. too. Not only that, but you pay, what Heartland wants to charge. So what if you could get it cheaper and closer to your home. So what your office could be seeing patients those days.
If Rick Workman has to fly someone in to get you lined back out, for under production. It is going to cost ya. Every business mile driven, every night in a hotel, every meal they eat, your clinic picks up that tab. The college educated psychology grad - who is really just a company dental hygienist - sent to assess your nonproductive ways, will also be expensed out to your clinic.
Prizes and gifts for company wide employees, those are expensed out among the “affiliated” clinics too. Remember that bonus your colleague got for recommending your practice to Heartland, yeah, it will be charged to your “affiliated” clinic.
Monthly seminars to Effingham,IL, are going to cost you as well. Every night in the hotel, every chicken leg you eat, it’s coming out of your “affiliated” clinic’s account. Think you will be given a breakdown of what Heartland Headquarters has expensed to your “affiliated” clinic, think again! Those are not for your eyes.
You know the new HCD Institute will be expensed out to each Heartland Dental “affiliated” dental center as well. It has to be, everything else is.
Last but not least, your “affiliated” clinic has to pay Heartland for all the administrative services as well. |
great(c1,v1).
great(jj1,aa1).
great(jj1,n1).
great(cc1,n1).
great(u1,ll1).
great(bb1,t1).
great(f1,l1).
great(jj1,o1).
great(d1,y1).
great(j1,ee1).
great(bb1,p1).
great(c1,d1).
great(hh1,jj1).
great(i1,t1).
great(hh1,h1).
great(e1,t1).
great(k1,s1).
great(g1,bb1).
great(f1,hh1).
great(j1,t1).
great(c1,dd1).
great(f1,ll1).
great(v1,x1).
great(d1,o1).
great(d1,aa1).
great(e1,n1).
great(f1,q1).
great(i1,ll1).
great(d1,kk1).
great(u1,ee1).
great(f1,r1).
great(r1,o1).
great(a1,t1).
great(k1,v1).
great(l1,u1).
great(c1,ll1).
great(c1,x1).
great(y1,i1).
great(y1,ee1).
|
/*
* BRAINS
* (B)LR (R)everberation-mapping (A)nalysis (I)n AGNs with (N)ested (S)ampling
* Yan-Rong Li, [email protected]
* Thu, Aug 4, 2016
*/
/*!
* \file blr_models.c
* \brief BLR models
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <string.h>
#include <mpi.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_interp.h>
#include "brains.h"
/* cluster around outer disk face, Lopn_cos1 < Lopn_cos2 */
inline double theta_sample_outer(double gam, double Lopn_cos1, double Lopn_cos2)
{
return acos(Lopn_cos1 + (Lopn_cos2-Lopn_cos1) * pow(gsl_rng_uniform(gsl_r), gam));
}
/* cluster around equatorial plane, Lopn_cos1 < Lopn_cos2 */
inline double theta_sample_inner(double gam, double Lopn_cos1, double Lopn_cos2)
{
/* note that cosine is a decreaing function */
double opn1 = acos(Lopn_cos1), opn2 = acos(Lopn_cos2);
return opn2 + (opn1-opn2) * (1.0 - pow(gsl_rng_uniform(gsl_r), 1.0/gam));
}
/*================================================================
* model 1
* Brewer et al. (2011)'s model
*
* geometry: radial Gamma distribution
* dynamics: elliptical orbits
*================================================================
*/
void gen_cloud_sample_model1(const void *pm, int flag_type, int flag_save)
{
int i, j, nc;
double r, phi, dis, Lopn_cos, u;
double x, y, z, xb, yb, zb, zb0, vx, vy, vz, vxb, vyb, vzb;
double inc, F, beta, mu, k, a, s, rin, sig, Rs;
double Lphi, Lthe, L, E;
double V, weight, rnd;
BLRmodel1 *model = (BLRmodel1 *)pm;
double Emin, Lmax, Vr, Vr2, Vph, mbh, chi, lambda, q;
Lopn_cos = cos(model->opn*PI/180.0);
inc = acos(model->inc);
beta = model->beta;
F = model->F;
mu = exp(model->mu);
k = model->k;
if(flag_type == 1) // 1D RM, no dynamical parameters
{
mbh = 0.0;
}
else
{
mbh = exp(model->mbh);
lambda = model->lambda;
q = model->q;
}
Rs = 3.0e11*mbh/CM_PER_LD; // Schwarzchild radius in a unit of light-days
a = 1.0/beta/beta;
s = mu/a;
rin = mu*F + Rs;
sig = (1.0-F)*s;
for(i=0; i<parset.n_cloud_per_task; i++)
{
// generate a direction of the angular momentum
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * gsl_rng_uniform(gsl_r));
Lthe = theta_sample(1.0, Lopn_cos, 1.0);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
rnd = gsl_ran_gamma(gsl_r, a, 1.0);
// r = mu * F + (1.0-F) * gsl_ran_gamma(gsl_r, 1.0/beta/beta, beta*beta*mu);
r = rin + sig * rnd;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
x = r * cos(phi);
y = r * sin(phi);
z = 0.0;
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z;*/
xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y;
zb = sin(Lthe) * x;
zb0 = zb;
if(zb0 < 0.0)
zb = -zb;
/* counter-rotate around y */
x = xb * cos(PI/2.0-inc) + zb * sin(PI/2.0-inc);
y = yb;
z =-xb * sin(PI/2.0-inc) + zb * cos(PI/2.0-inc);
weight = 0.5 + k*(x/r);
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
/* velocity
* note that a cloud moves in its orbit plane, whose direction
* is determined by the direction of its angular momentum.
*/
Emin = - mbh/r;
//Ecirc = 0.5 * Emin;
//Lcirc = sqrt(2.0 * r*r * (Ecirc + mbh/r));
for(j=0; j<parset.n_vel_per_cloud; j++)
{
chi = lambda * gsl_ran_ugaussian(gsl_r);
E = Emin / (1.0 + exp(-chi));
Lmax = sqrt(2.0 * r*r * (E + mbh/r));
if(lambda>1.0e-2) /* make sure that exp is caculatable. */
L = Lmax * lambda * log( (exp(1.0/lambda) - 1.0) * gsl_rng_uniform(gsl_r) + 1.0 );
else
L = Lmax * (1.0 + lambda * log(gsl_rng_uniform(gsl_r)) );
Vr2 = 2.0 * (E + mbh/r) - L*L/r/r;
if(Vr2>=0.0)
{
u = gsl_rng_uniform(gsl_r);
Vr = sqrt(Vr2) * (u<q?-1.0:1.0);
}
else
{
Vr = 0.0;
}
Vph = L/r; /* RM cannot distinguish the orientation of the rotation. */
vx = Vr * cos(phi) - Vph * sin(phi);
vy = Vr * sin(phi) + Vph * cos(phi);
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy;
vzb = sin(Lthe) * vx;
if(zb0 < 0.0)
vzb = -vzb;
vx = vxb * cos(PI/2.0-inc) + vzb * sin(PI/2.0-inc);
vy = vyb;
vz =-vxb * sin(PI/2.0-inc) + vzb * cos(PI/2.0-inc);
V = -vx; //note the definition of the line-of-sight velocity. positive means a receding
// velocity relative to the observer.
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
return;
}
/*================================================================
* model 2
*
* geometry: radial Gamma distribution
* dynamics: elliptical orbits (Gaussian around circular orbits)
*================================================================
*/
void gen_cloud_sample_model2(const void *pm, int flag_type, int flag_save)
{
int i, j, nc;
double r, phi, dis, Lopn_cos;
double x, y, z, xb, yb, zb, zb0, vx, vy, vz, vxb, vyb, vzb;
double inc, F, beta, mu, k, a, s, rin, sig, Rs;
double Lphi, Lthe;
double V, weight, rnd;
BLRmodel2 *model = (BLRmodel2 *)pm;
double Emin, Ecirc, Lcirc, Vcirc, Vr, Vph, mbh, sigr, sigtheta, rhor, rhotheta;
Lopn_cos = cos(model->opn*PI/180.0);
inc = acos(model->inc);
beta = model->beta;
F = model->F;
mu = exp(model->mu);
k = model->k;
a = 1.0/beta/beta;
s = mu/a;
rin=mu*F;
sig=(1.0-F)*s;
if(flag_type == 1) //1D RM no dynamical parameters
{
mbh = 0.0;
}
else
{
mbh = exp(model->mbh);
sigr = model->sigr;
sigtheta = model->sigtheta * PI;
}
Rs = 3.0e11*mbh/CM_PER_LD; // Schwarzchild radius in a unit of light-days
a = 1.0/beta/beta;
s = mu/a;
rin = mu*F + Rs;
sig = (1.0-F)*s;
for(i=0; i<parset.n_cloud_per_task; i++)
{
/* generate a direction of the angular momentum */
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * gsl_rng_uniform(gsl_r));
Lthe = theta_sample(1.0, Lopn_cos, 1.0);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
rnd = gsl_ran_gamma(gsl_r, a, 1.0);
// r = mu * F + (1.0-F) * gsl_ran_gamma(gsl_r, 1.0/beta/beta, beta*beta*mu);
r = rin + sig * rnd;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
x = r * cos(phi);
y = r * sin(phi);
z = 0.0;
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z;*/
xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y;
zb = sin(Lthe) * x;
zb0 = zb;
if(zb0 < 0.0)
zb = -zb;
/* counter-rotate around y */
x = xb * cos(PI/2.0-inc) + zb * sin(PI/2.0-inc);
y = yb;
z =-xb * sin(PI/2.0-inc) + zb * cos(PI/2.0-inc);
weight = 0.5 + k*(x/r);
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
/* velocity
* note that a cloud moves in its orbit plane, whose direction
* is determined by the direction of its angular momentum.
*/
Emin = - mbh/r;
Ecirc = 0.5 * Emin;
Lcirc = sqrt(2.0 * r*r * (Ecirc + mbh/r));
Vcirc = Lcirc/r;
for(j=0; j<parset.n_vel_per_cloud; j++)
{
rhor = gsl_ran_ugaussian(gsl_r) * sigr + 1.0;
rhotheta = gsl_ran_ugaussian(gsl_r) * sigtheta + 0.5*PI;
Vr = rhor * cos(rhotheta) * Vcirc;
Vph = rhor * fabs(sin(rhotheta)) * Vcirc; /* RM cannot distinguish the orientation of the rotation. make all clouds co-rotate */
vx = Vr * cos(phi) - Vph * sin(phi);
vy = Vr * sin(phi) + Vph * cos(phi);
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy;
vzb = sin(Lthe) * vx;
if(zb0 < 0.0)
vzb = -vzb;
vx = vxb * cos(PI/2.0-inc) + vzb * sin(PI/2.0-inc);
vy = vyb;
vz =-vxb * sin(PI/2.0-inc) + vzb * cos(PI/2.0-inc);
V = -vx; //note the definition of the line-of-sight velocity. postive means a receding
// velocity relative to the observer.
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
return;
}
/*====================================================================
* model 3
*
* geometry: radial power law
* dynamics:
*====================================================================
*/
void gen_cloud_sample_model3(const void *pm, int flag_type, int flag_save)
{
int i, j, nc;
double r, phi, dis, Lopn_cos;
double x, y, z, xb, yb, zb, zb0, vx, vy, vz, vxb, vyb, vzb;
double inc, F, alpha, Rin, k, Rs;
double Lphi, Lthe, L, E;
double V, weight, rnd;
BLRmodel3 *model = (BLRmodel3 *)pm;
double Emin, Lmax, Vr, Vph, mbh, xi, q;
Lopn_cos = cos(model->opn*PI/180.0);
inc = acos(model->inc);
alpha = model->alpha;
F = model->F;
Rin = exp(model->Rin);
k = model->k;
if(flag_type == 1)
{
mbh = 0.0;
}
else
{
mbh = exp(model->mbh);
xi = model->xi;
q = model->q;
}
Rs = 3.0e11*mbh/CM_PER_LD; // Schwarzchild radius in a unit of light-days
if(F*Rin > rcloud_max_set)
F = rcloud_max_set/Rin;
for(i=0; i<parset.n_cloud_per_task; i++)
{
// generate a direction of the angular momentum
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * gsl_rng_uniform(gsl_r));
Lthe = theta_sample(1.0, Lopn_cos, 1.0);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
if(fabs(1.0-alpha) > 1.0e-4)
rnd = pow( gsl_rng_uniform(gsl_r) * ( pow(F, 1.0-alpha) - 1.0) + 1.0, 1.0/(1.0-alpha) );
else
rnd = exp( gsl_rng_uniform(gsl_r) * log(F) );
r = Rin * rnd + Rs;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
x = r * cos(phi);
y = r * sin(phi);
z = 0.0;
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z;*/
xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y;
zb = sin(Lthe) * x;
zb0 = zb;
if(zb0 < 0.0)
zb = -zb;
// counter-rotate around y
x = xb * cos(PI/2.0-inc) + zb * sin(PI/2.0-inc);
y = yb;
z =-xb * sin(PI/2.0-inc) + zb * cos(PI/2.0-inc);
weight = 0.5 + k*(x/r);
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
// velocity
// note that a cloud moves in its orbit plane, whose direction
// is determined by the direction of its angular momentum.
Emin = - mbh/r;
//Ecirc = 0.5 * Emin;
//Lcirc = sqrt(2.0 * r*r * (Ecirc + mbh/r));
for(j=0; j<parset.n_vel_per_cloud; j++)
{
E = Emin / 2.0;
Lmax = sqrt(2.0 * r*r * (E + mbh/r));
L = Lmax;
Vr = xi * sqrt(2.0*mbh/r);
if(q <= 0.5)
Vr = -Vr;
Vph = L/r; //RM cannot distinguish the orientation of the rotation.
vx = Vr * cos(phi) - Vph * sin(phi);
vy = Vr * sin(phi) + Vph * cos(phi);
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy;
vzb = sin(Lthe) * vx;
if(zb0 < 0.0)
vzb = -vzb;
vx = vxb * cos(PI/2.0-inc) + vzb * sin(PI/2.0-inc);
vy = vyb;
vz =-vxb * sin(PI/2.0-inc) + vzb * cos(PI/2.0-inc);
V = -vx; //note the definition of the line-of-sight velocity. postive means a receding
// velocity relative to the observer.
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
return;
}
/*!
* model 4.
* generate cloud sample.
*/
void gen_cloud_sample_model4(const void *pm, int flag_type, int flag_save)
{
int i, j, nc;
double r, phi, dis, Lopn_cos;
double x, y, z, xb, yb, zb, zb0, vx, vy, vz, vxb, vyb, vzb;
double inc, F, alpha, Rin, k, Rs;
double Lphi, Lthe, L, E;
double V, weight, rnd;
BLRmodel4 *model = (BLRmodel4 *)pm;
double Emin, Lmax, Vr, Vph, mbh, xi, q;
Lopn_cos = cos(model->opn*PI/180.0);
inc = acos(model->inc);
alpha = model->alpha;
F = model->F;
Rin = exp(model->Rin);
k = model->k;
if(flag_type == 1) // 1D RM, no dynamical parameters
{
mbh = 0.0;
}
else
{
mbh = exp(model->mbh);
xi = model->xi;
q = model->q;
}
Rs = 3.0e11*mbh/CM_PER_LD; // Schwarzchild radius in a unit of light-days
if(Rin*F > rcloud_max_set)
F = rcloud_max_set/Rin;
for(i=0; i<parset.n_cloud_per_task; i++)
{
/* generate a direction of the angular momentum */
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * gsl_rng_uniform(gsl_r));
Lthe = theta_sample(1.0, Lopn_cos, 1.0);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
if(fabs(1.0-alpha) > 1.0e-4)
rnd = pow( gsl_rng_uniform(gsl_r) * ( pow(F, 1.0-alpha) - 1.0) + 1.0, 1.0/(1.0-alpha) );
else
rnd = exp( gsl_rng_uniform(gsl_r) * log(F) );
r = Rin * rnd + Rs;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
x = r * cos(phi);
y = r * sin(phi);
z = 0.0;
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z; */
xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y;
zb = sin(Lthe) * x;
zb0 = zb;
if(zb0 < 0.0)
zb = -zb;
/* counter-rotate around y */
x = xb * cos(PI/2.0-inc) + zb * sin(PI/2.0-inc);
y = yb;
z =-xb * sin(PI/2.0-inc) + zb * cos(PI/2.0-inc);
weight = 0.5 + k*(x/r);
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
// velocity
// note that a cloud moves in its orbit plane, whose direction
// is determined by the direction of its angular momentum.
Emin = - mbh/r;
//Ecirc = 0.5 * Emin;
//Lcirc = sqrt(2.0 * r*r * (Ecirc + mbh/r));
for(j=0; j<parset.n_vel_per_cloud; j++)
{
E = Emin / 2.0;
Lmax = sqrt(2.0 * r*r * (E + mbh/r));
L = Lmax;
Vr = xi * sqrt(2.0*mbh/r);
if(q<=0.5)
Vr = -Vr;
Vph = sqrt(1.0-2.0*xi*xi) * L/r; //RM cannot distinguish the orientation of the rotation.
vx = Vr * cos(phi) - Vph * sin(phi);
vy = Vr * sin(phi) + Vph * cos(phi);
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy;
vzb = sin(Lthe) * vx;
if(zb0 < 0.0)
vzb = -vzb;
vx = vxb * cos(PI/2.0-inc) + vzb * sin(PI/2.0-inc);
vy = vyb;
vz =-vxb * sin(PI/2.0-inc) + vzb * cos(PI/2.0-inc);
V = -vx; //note the definition of the line-of-sight velocity. postive means a receding
// velocity relative to the observer.
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
return;
}
/*====================================================================
* model 5
*
* geometry: double power-law
* dynamics: elliptical orbits and inflow/outflow as in Pancoast's model
*====================================================================
*/
void gen_cloud_sample_model5(const void *pm, int flag_type, int flag_save)
{
int i, j, nc;
double r, phi, cos_phi, sin_phi, dis, Lopn_cos;
double x, y, z, xb, yb, zb, zb0;
double inc, Fin, Fout, alpha, k, gam, mu, xi;
double mbh, fellip, fflow, sigr_circ, sigthe_circ, sigr_rad, sigthe_rad, theta_rot, sig_turb;
double Lphi, Lthe, V, Vr, Vph, Vkep, rhoV, theV;
double cos_Lphi, sin_Lphi, cos_Lthe, sin_Lthe, cos_inc_cmp, sin_inc_cmp;
double weight, rndr, rnd, rnd_frac, rnd_xi, frac1, frac2, ratio, Rs, g;
double vx, vy, vz, vxb, vyb, vzb;
BLRmodel5 *model = (BLRmodel5 *)pm;
Lopn_cos = cos(model->opn*PI/180.0); /* cosine of openning angle */
inc = acos(model->inc); /* inclination angle in rad */
alpha = model->alpha;
Fin = model->Fin;
Fout = exp(model->Fout);
mu = exp(model->mu); /* mean radius */
k = model->k;
gam = model->gam;
xi = model->xi;
if(flag_type == 1) // 1D RM, no dynamical parameters
{
mbh = 0.0;
}
else
{
mbh = exp(model->mbh);
fellip = model->fellip;
fflow = model->fflow;
sigr_circ = exp(model->sigr_circ);
sigthe_circ = exp(model->sigthe_circ);
sigr_rad = exp(model->sigr_rad);
sigthe_rad = exp(model->sigthe_rad);
theta_rot = model->theta_rot*PI/180.0;
sig_turb = exp(model->sig_turb);
}
Rs = 3.0e11*mbh/CM_PER_LD; // Schwarzchild radius in a unit of light-days
if(mu*Fout > rcloud_max_set)
Fout = rcloud_max_set/mu;
frac1 = 1.0/(alpha+1.0) * (1.0 - pow(Fin, alpha+1.0));
frac2 = 1.0/(alpha-1.0) * (1.0 - pow(Fout, -alpha+1.0));
ratio = frac1/(frac1 + frac2);
sin_inc_cmp = cos(inc);//sin(PI/2.0 - inc);
cos_inc_cmp = sin(inc);//cos(PI/2.0 - inc);
for(i=0; i<parset.n_cloud_per_task; i++)
{
/* generate a direction of the angular momentum of the orbit */
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * pow(gsl_rng_uniform(gsl_r), gam));
Lthe = theta_sample(gam, Lopn_cos, 1.0);
cos_Lphi = cos(Lphi);
sin_Lphi = sin(Lphi);
cos_Lthe = cos(Lthe);
sin_Lthe = sin(Lthe);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
rnd_frac = gsl_rng_uniform(gsl_r);
rnd = gsl_rng_uniform(gsl_r);
if(rnd_frac < ratio)
{
rndr = pow( 1.0 - rnd * (1.0 - pow(Fin, alpha+1.0)), 1.0/(1.0+alpha));
}
else
{
rndr = pow( 1.0 - rnd * (1.0 - pow(Fout, -alpha+1.0)), 1.0/(1.0-alpha));
}
r = rndr*mu + Rs;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
cos_phi = cos(phi);
sin_phi = sin(phi);
/* Polar coordinates to Cartesian coordinate */
x = r * cos_phi;
y = r * sin_phi;
z = 0.0;
/* right-handed framework
* first rotate around y axis by an angle of Lthe, then rotate around z axis
* by an angle of Lphi
*/
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb =-cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z;*/
xb = cos_Lthe*cos_Lphi * x + sin_Lphi * y;
yb =-cos_Lthe*sin_Lphi * x + cos_Lphi * y;
zb = sin_Lthe * x;
zb0 = zb;
rnd_xi = gsl_rng_uniform(gsl_r);
if( (rnd_xi < 1.0 - xi) && zb0 < 0.0)
zb = -zb;
// counter-rotate around y, LOS is x-axis
x = xb * cos_inc_cmp + zb * sin_inc_cmp;
y = yb;
z =-xb * sin_inc_cmp + zb * cos_inc_cmp;
weight = 0.5 + k*(x/r);
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
Vkep = sqrt(mbh/r);
for(j=0; j<parset.n_vel_per_cloud; j++)
{
rnd = gsl_rng_uniform(gsl_r);
if(rnd < fellip)
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_circ + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_circ + 0.5) * PI;
}
else
{
if(fflow <= 0.5)
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_rad + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_rad + 1.0) * PI + theta_rot;
}
else
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_rad + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_rad ) * PI + theta_rot;
}
}
Vr = sqrt(2.0) * rhoV * cos(theV);
Vph = rhoV * fabs(sin(theV)); /* make all clouds co-rotate */
vx = Vr * cos_phi - Vph * sin_phi;
vy = Vr * sin_phi + Vph * cos_phi;
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos_Lthe*cos_Lphi * vx + sin_Lphi * vy;
vyb =-cos_Lthe*sin_Lphi * vx + cos_Lphi * vy;
vzb = sin_Lthe * vx;
if((rnd_xi < 1.0-xi) && zb0 < 0.0)
vzb = -vzb;
vx = vxb * cos_inc_cmp + vzb * sin_inc_cmp;
vy = vyb;
vz =-vxb * sin_inc_cmp + vzb * cos_inc_cmp;
V = -vx; //note the definition of the line-of-sight velocity. postive means a receding
// velocity relative to the observer.
V += gsl_ran_ugaussian(gsl_r) * sig_turb * Vkep; // add turbulence velocity
if(fabs(V) >= C_Unit) // make sure that the velocity is smaller than speed of light
V = 0.9999*C_Unit * (V>0.0?1.0:-1.0);
g = sqrt( (1.0 + V/C_Unit) / (1.0 - V/C_Unit) ) / sqrt(1.0 - Rs/r); //relativistic effects
V = (g-1.0)*C_Unit;
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
return;
}
/*================================================================
* model 6
* Pancoast et al. (2014)'s model
*
* geometry: radial Gamma distribution
* dynamics: ellipitcal orbits and inflow/outflow
*================================================================
*/
void gen_cloud_sample_model6(const void *pm, int flag_type, int flag_save)
{
int i, j, nc;
double r, phi, cos_phi, sin_phi, dis, Lopn_cos;
double x, y, z, xb, yb, zb, zb0, vx, vy, vz, vxb, vyb, vzb;
double V, rhoV, theV, Vr, Vph, Vkep, Rs, g;
double inc, F, beta, mu, k, gam, xi, a, s, sig, rin;
double mbh, fellip, fflow, sigr_circ, sigthe_circ, sigr_rad, sigthe_rad, theta_rot, sig_turb;
double Lphi, Lthe, sin_Lphi, cos_Lphi, sin_Lthe, cos_Lthe, sin_inc_cmp, cos_inc_cmp;
double weight, rnd, rnd_xi;
BLRmodel6 *model = (BLRmodel6 *)pm;
Lopn_cos = cos(model->opn*PI/180.0); /* cosine of openning angle */
inc = acos(model->inc); /* inclination angle in rad */
beta = model->beta;
F = model->F;
mu = exp(model->mu); /* mean radius */
k = model->k;
gam = model-> gam;
xi = model->xi;
if(flag_type == 1) // 1D RM, no mbh parameters
{
mbh = 0.0;
}
else
{
mbh = exp(model->mbh);
fellip = model->fellip;
fflow = model->fflow;
sigr_circ = exp(model->sigr_circ);
sigthe_circ = exp(model->sigthe_circ);
sigr_rad = exp(model->sigr_rad);
sigthe_rad = exp(model->sigthe_rad);
theta_rot = model->theta_rot*PI/180.0;
sig_turb = exp(model->sig_turb);
}
Rs = 3.0e11*mbh/CM_PER_LD; // Schwarzchild radius in a unit of light-days
a = 1.0/beta/beta;
s = mu/a;
rin=mu*F + Rs; // include Scharzschild radius
sig=(1.0-F)*s;
sin_inc_cmp = cos(inc); //sin(PI/2.0 - inc);
cos_inc_cmp = sin(inc); //cos(PI/2.0 - inc);
for(i=0; i<parset.n_cloud_per_task; i++)
{
// generate a direction of the angular momentum of the orbit
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * pow(gsl_rng_uniform(gsl_r), gam));
Lthe = theta_sample(gam, Lopn_cos, 1.0);
sin_Lphi = sin(Lphi);
cos_Lphi = cos(Lphi);
sin_Lthe = sin(Lthe);
cos_Lthe = cos(Lthe);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
rnd = gsl_ran_gamma(gsl_r, a, 1.0);
// r = mu * F + (1.0-F) * gsl_ran_gamma(gsl_r, 1.0/beta/beta, beta*beta*mu);
r = rin + sig * rnd;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
cos_phi = cos(phi);
sin_phi = sin(phi);
/* Polar coordinates to Cartesian coordinate */
x = r * cos_phi;
y = r * sin_phi;
z = 0.0;
/* right-handed framework
* first rotate around y axis by an angle of Lthe, then rotate around z axis
* by an angle of Lphi
*/
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb =-cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z; */
xb = cos_Lthe*cos_Lphi * x + sin_Lphi * y;
yb =-cos_Lthe*sin_Lphi * x + cos_Lphi * y;
zb = sin_Lthe * x;
zb0 = zb;
rnd_xi = gsl_rng_uniform(gsl_r);
if( (rnd_xi < 1.0 - xi) && zb0 < 0.0)
zb = -zb;
// counter-rotate around y, LOS is x-axis
/* x = xb * cos(PI/2.0-inc) + zb * sin(PI/2.0-inc);
y = yb;
z =-xb * sin(PI/2.0-inc) + zb * cos(PI/2.0-inc); */
x = xb * cos_inc_cmp + zb * sin_inc_cmp;
y = yb;
z =-xb * sin_inc_cmp + zb * cos_inc_cmp;
weight = 0.5 + k*(x/r);
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1) // 1D RM
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
Vkep = sqrt(mbh/r);
for(j=0; j<parset.n_vel_per_cloud; j++)
{
rnd = gsl_rng_uniform(gsl_r);
if(rnd < fellip)
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_circ + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_circ + 0.5)*PI;
}
else
{
if(fflow <= 0.5) /* inflow */
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_rad + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_rad + 1.0) * PI + theta_rot;
}
else /* outflow */
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_rad + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_rad) * PI + theta_rot;
}
}
Vr = sqrt(2.0) * rhoV * cos(theV);
Vph = rhoV * fabs(sin(theV)); /* make all clouds co-rotate */
vx = Vr * cos_phi - Vph * sin_phi;
vy = Vr * sin_phi + Vph * cos_phi;
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos_Lthe*cos_Lphi * vx + sin_Lphi * vy;
vyb =-cos_Lthe*sin_Lphi * vx + cos_Lphi * vy;
vzb = sin_Lthe * vx;
if((rnd_xi < 1.0-xi) && zb0 < 0.0)
vzb = -vzb;
/*vx = vxb * cos(PI/2.0-inc) + vzb * sin(PI/2.0-inc);
vy = vyb;
vz =-vxb * sin(PI/2.0-inc) + vzb * cos(PI/2.0-inc);*/
vx = vxb * cos_inc_cmp + vzb * sin_inc_cmp;
vy = vyb;
vz =-vxb * sin_inc_cmp + vzb * cos_inc_cmp;
V = -vx; //note the definition of the line-of-sight velocity. postive means a receding
// velocity relative to the observer.
V += gsl_ran_ugaussian(gsl_r) * sig_turb * Vkep; // add turbulence velocity
if(fabs(V) >= C_Unit) // make sure that the velocity is smaller than speed of light
V = 0.9999*C_Unit * (V>0.0?1.0:-1.0);
g = sqrt( (1.0 + V/C_Unit) / (1.0 - V/C_Unit) ) / sqrt(1.0 - Rs/r); //relativistic effects
V = (g-1.0)*C_Unit;
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
return;
}
/*================================================================
* model 7
* shadowed model
*
* geometry: radial Gamma distribution
* dynamics: elliptical orbits and inflow/outflow as in Pancoast'model
*================================================================
*/
void gen_cloud_sample_model7(const void *pm, int flag_type, int flag_save)
{
int i, j, nc, num_sh;
double r, phi, dis, Lopn_cos, cos_phi, sin_phi;
double x, y, z, xb, yb, zb, zb0, vx, vy, vz, vxb, vyb, vzb, Rs, g, sig_turb;
double V, rhoV, theV, Vr, Vph, Vkep;
double inc, F, beta, mu, k, gam, xi, a, s, sig, rin;
double mbh, fellip, fflow, sigr_circ, sigthe_circ, sigr_rad, sigthe_rad, theta_rot;
double Lphi, Lthe, sin_Lphi, cos_Lphi, sin_Lthe, cos_Lthe, sin_inc_cmp, cos_inc_cmp;
double weight, rnd, rnd_xi;
BLRmodel7 *model = (BLRmodel7 *)pm;
Lopn_cos = cos(model->opn*PI/180.0); /* cosine of openning angle */
inc = acos(model->inc); /* inclination angle in rad */
beta = model->beta;
F = model->F;
mu = exp(model->mu); /* mean radius */
k = model->k;
gam = model-> gam;
xi = model->xi;
if(flag_type == 1) // 1D RM, no dyamical parameters
{
mbh = 0.0;
}
else
{
mbh = exp(model->mbh);
fellip = model->fellip;
fflow = model->fflow;
sigr_circ = exp(model->sigr_circ);
sigthe_circ = exp(model->sigthe_circ);
sigr_rad = exp(model->sigr_rad);
sigthe_rad = exp(model->sigthe_rad);
theta_rot = model->theta_rot*PI/180.0;
sig_turb = exp(model->sig_turb);
}
Rs = 3.0e11*mbh/CM_PER_LD; // Schwarzchild radius in a unit of light-days
a = 1.0/beta/beta;
s = mu/a;
rin=Rs + mu*F;
sig=(1.0-F)*s;
sin_inc_cmp = cos(inc); //sin(PI/2.0 - inc);
cos_inc_cmp = sin(inc); //cos(PI/2.0 - inc);
num_sh = (int)(parset.n_cloud_per_task * model->fsh);
for(i=0; i<num_sh; i++)
{
// generate a direction of the angular momentum of the orbit
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * pow(gsl_rng_uniform(gsl_r), gam));
Lthe = theta_sample(gam, Lopn_cos, 1.0);
sin_Lphi = sin(Lphi);
cos_Lphi = cos(Lphi);
sin_Lthe = sin(Lthe);
cos_Lthe = cos(Lthe);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
rnd = gsl_ran_gamma(gsl_r, a, 1.0);
// r = mu * F + (1.0-F) * gsl_ran_gamma(gsl_r, 1.0/beta/beta, beta*beta*mu);
r = rin + sig * rnd;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
cos_phi = cos(phi);
sin_phi = sin(phi);
/* Polar coordinates to Cartesian coordinate */
x = r * cos_phi;
y = r * sin_phi;
z = 0.0;
/* right-handed framework
* first rotate around y axis by an angle of Lthe, then rotate around z axis
* by an angle of Lphi
*/
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb =-cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z; */
xb = cos_Lthe*cos_Lphi * x + sin_Lphi * y;
yb =-cos_Lthe*sin_Lphi * x + cos_Lphi * y;
zb = sin_Lthe * x;
zb0 = zb;
rnd_xi = gsl_rng_uniform(gsl_r);
if( (rnd_xi < 1.0 - xi) && zb0 < 0.0)
zb = -zb;
// counter-rotate around y, LOS is x-axis
x = xb * cos_inc_cmp + zb * sin_inc_cmp;
y = yb;
z =-xb * sin_inc_cmp + zb * cos_inc_cmp;
weight = 0.5 + k*(x/r);
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
Vkep = sqrt(mbh/r);
for(j=0; j<parset.n_vel_per_cloud; j++)
{
rnd = gsl_rng_uniform(gsl_r);
if(rnd < fellip)
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_circ + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_circ + 0.5) * PI;
}
else
{
if(fflow <= 0.5)
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_rad + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_rad + 1.0) *PI + theta_rot;
}
else
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_rad + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_rad) * PI + theta_rot;
}
}
Vr = sqrt(2.0) * rhoV * cos(theV);
Vph = rhoV * fabs(sin(theV)); /* make all clouds co-rotate */
vx = Vr * cos_phi - Vph * sin_phi;
vy = Vr * sin_phi + Vph * cos_phi;
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos_Lthe*cos_Lphi * vx + sin_Lphi * vy;
vyb =-cos_Lthe*sin_Lphi * vx + cos_Lphi * vy;
vzb = sin_Lthe * vx;
if((rnd_xi < 1.0-xi) && zb0 < 0.0)
vzb = -vzb;
vx = vxb * cos_inc_cmp + vzb * sin_inc_cmp;
vy = vyb;
vz =-vxb * sin_inc_cmp + vzb * cos_inc_cmp;
V = -vx; //note the definition of the line-of-sight velocity. postive means a receding
// velocity relative to the observer.
V += gsl_ran_ugaussian(gsl_r) * sig_turb * Vkep;
if(fabs(V) >= C_Unit) // make sure that the velocity is smaller than speed of light
V = 0.9999*C_Unit * (V>0.0?1.0:-1.0);
g = sqrt( (1.0 + V/C_Unit) / (1.0 - V/C_Unit) ) / sqrt(1.0 - Rs/r); //relativistic effects
V = (g-1.0)*C_Unit;
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
//second BLR region
rin = exp(model->mu_un) * model->F_un + Rs;
a = 1.0/(model->beta_un * model->beta_un);
sig = exp(model->mu_un) * (1.0-model->F_un)/a;
double Lopn_cos_un1, Lopn_cos_un2;
Lopn_cos_un1 = Lopn_cos;
if(model->opn + model->opn_un < 90.0)
Lopn_cos_un2 = cos((model->opn + model->opn_un)/180.0*PI);
else
Lopn_cos_un2 = 0.0;
if(flag_type != 1) // 1D RM, no dynamical parameters
{
fellip = model->fellip_un;
fflow = model->fflow_un;
}
for(i=num_sh; i<parset.n_cloud_per_task; i++)
{
// generate a direction of the angular momentum of the orbit
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos_un2 + (Lopn_cos_un1-Lopn_cos_un2) * pow(gsl_rng_uniform(gsl_r), gam));
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * pow(gsl_rng_uniform(gsl_r), gam));
Lthe = theta_sample(gam, Lopn_cos_un2, Lopn_cos_un1);
sin_Lphi = sin(Lphi);
cos_Lphi = cos(Lphi);
sin_Lthe = sin(Lthe);
cos_Lthe = cos(Lthe);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
rnd = gsl_ran_gamma(gsl_r, a, 1.0);
// r = mu * F + (1.0-F) * gsl_ran_gamma(gsl_r, 1.0/beta/beta, beta*beta*mu);
r = rin + sig * rnd;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
cos_phi = cos(phi);
sin_phi = sin(phi);
/* Polar coordinates to Cartesian coordinate */
x = r * cos_phi;
y = r * sin_phi;
z = 0.0;
/* right-handed framework
* first rotate around y axis by an angle of Lthe, then rotate around z axis
* by an angle of Lphi
*/
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb =-cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z; */
xb = cos_Lthe*cos_Lphi * x + sin_Lphi * y;
yb =-cos_Lthe*sin_Lphi * x + cos_Lphi * y;
zb = sin_Lthe * x;
zb0 = zb;
rnd_xi = gsl_rng_uniform(gsl_r);
if( (rnd_xi < 1.0 - xi) && zb0 < 0.0)
zb = -zb;
// counter-rotate around y, LOS is x-axis
x = xb * cos_inc_cmp + zb * sin_inc_cmp;
y = yb;
z =-xb * sin_inc_cmp + zb * cos_inc_cmp;
weight = 0.5 + k*(x/r);
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
Vkep = sqrt(mbh/r);
for(j=0; j<parset.n_vel_per_cloud; j++)
{
rnd = gsl_rng_uniform(gsl_r);
if(rnd < fellip)
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_circ + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_circ + 0.5) * PI;
}
else
{
if(fflow <= 0.5)
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_rad + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_rad + 1.0) *PI + theta_rot;
}
else
{
rhoV = (gsl_ran_ugaussian(gsl_r) * sigr_rad + 1.0) * Vkep;
theV = (gsl_ran_ugaussian(gsl_r) * sigthe_rad) * PI + theta_rot;
}
}
Vr = sqrt(2.0) * rhoV * cos(theV);
Vph = rhoV * fabs(sin(theV)); /* make all clouds co-rotate */
vx = Vr * cos_phi - Vph * sin_phi;
vy = Vr * sin_phi + Vph * cos_phi;
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos_Lthe*cos_Lphi * vx + sin_Lphi * vy;
vyb =-cos_Lthe*sin_Lphi * vx + cos_Lphi * vy;
vzb = sin_Lthe * vx;
if((rnd_xi < 1.0-xi) && zb0 < 0.0)
vzb = -vzb;
vx = vxb * cos_inc_cmp + vzb * sin_inc_cmp;
vy = vyb;
vz =-vxb * sin_inc_cmp + vzb * cos_inc_cmp;
V = -vx; //note the definition of the line-of-sight velocity. postive means a receding
// velocity relative to the observer.
V += gsl_ran_ugaussian(gsl_r) * sig_turb * Vkep;
if(fabs(V) >= C_Unit) // make sure that the velocity is smaller than speed of light
V = 0.9999*C_Unit * (V>0.0?1.0:-1.0);
g = sqrt( (1.0 + V/C_Unit) / (1.0 - V/C_Unit) ) / sqrt(1.0 - Rs/r); //relativistic effects
V = (g-1.0)*C_Unit;
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
return;
}
/*
* model 8, generate cloud sample.
* a disk wind model.
*/
void gen_cloud_sample_model8(const void *pm, int flag_type, int flag_save)
{
int i;
double theta_min, theta_max, r_min, r_max, Rblr, Rv, mbh, alpha, gamma, xi, lambda, k;
double rnd, r, r0, theta, phi, xb, yb, zb, x, y, z, l, weight, sin_inc_cmp, cos_inc_cmp, inc;
double dis, density, vl, vesc, Vr, Vph, vx, vy, vz, vxb, vyb, vzb, V, rnd_xi, zb0, lmax, R;
double v0=6.0/VelUnit;
BLRmodel8 *model=(BLRmodel8 *)pm;
theta_min = model->theta_min/180.0 * PI;
theta_max = model->dtheta_max/180.0*PI + theta_min;
theta_max = fmin(theta_max, 0.5*PI);
model->dtheta_max = (theta_max-theta_min)/PI*180;
r_min = exp(model->r_min);
r_max = model->fr_max * r_min;
if(r_max > 0.5*rcloud_max_set) r_max = 0.5*rcloud_max_set;
model->fr_max = r_max/r_min;
gamma = model->gamma;
alpha = model->alpha;
lambda = model->lamda;
k = model->k;
xi = model->xi;
Rv = exp(model->Rv);
Rblr = exp(model->Rblr);
if(Rblr < r_max) Rblr = r_max;
model->Rblr = log(Rblr);
inc = acos(model->inc);
mbh = exp(model->mbh);
sin_inc_cmp = cos(inc); //sin(PI/2.0 - inc);
cos_inc_cmp = sin(inc); //cos(PI/2.0 - inc);
for(i=0; i<parset.n_cloud_per_task; i++)
{
rnd = gsl_rng_uniform(gsl_r);
r0 = r_min + rnd * (r_max - r_min);
theta = theta_min + (theta_max - theta_min) * pow(rnd, gamma);
/* the maximum allowed value of l */
lmax = -r0*sin(theta) + sqrt(r0*r0*sin(theta)*sin(theta) + (Rblr*Rblr - r0*r0));
l = gsl_rng_uniform(gsl_r) * lmax;
r = l * sin(theta) + r0;
if(gsl_rng_uniform(gsl_r) < 0.5)
zb = l * cos(theta);
else
zb =-l * cos(theta);
phi = gsl_rng_uniform(gsl_r) * 2.0*PI;
xb = r * cos(phi);
yb = r * sin(phi);
zb0 = zb;
rnd_xi = gsl_rng_uniform(gsl_r);
if( (rnd_xi < 1.0 - xi) && zb0 < 0.0)
zb = -zb;
vesc = sqrt(2.0*mbh/r0);
vl = v0 + (vesc - v0) * pow(l/Rv, alpha)/(1.0 + pow(l/Rv, alpha));
density = pow(r0, lambda)/vl;
// counter-rotate around y, LOS is x-axis
x = xb * cos_inc_cmp + zb * sin_inc_cmp;
y = yb;
z =-xb * sin_inc_cmp + zb * cos_inc_cmp;
R = sqrt(r*r + zb*zb);
weight = 0.5 + k*(x/R);
clouds_weight[i] = weight * density;
#ifndef SpecAstro
dis = R - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = R - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = R - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = R - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = R - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
Vr = vl * sin(theta);
vzb = vl * cos(theta);
Vph = sqrt(mbh*r0) / r;
vxb = Vr * cos(phi) - Vph * sin(phi);
vyb = Vr * sin(phi) + Vph * cos(phi);
if(zb < 0.0)
vzb = -vzb;
vx = vxb * cos_inc_cmp + vzb * sin_inc_cmp;
vy = vyb;
vz =-vxb * sin_inc_cmp + vzb * cos_inc_cmp;
V = -vx; //note the definition of the line-of-sight velocity. postive means a receding
// velocity relative to the observer.
clouds_vel[i] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
return;
}
/*
* model 9, generate cloud sample.
* same with the Graivty Collaboration's model about 3C 273 published in Nature (2018, 563, 657),
* except that the prior of inclination is uniform in cosine.
*
*/
void gen_cloud_sample_model9(const void *pm, int flag_type, int flag_save)
{
int i, j, nc;
double r, phi, dis, Lopn_cos;
double x, y, z, xb, yb, zb, vx, vy, vz, vxb, vyb, vzb;
double inc, F, beta, mu, a, s, rin, sig;
double Lphi, Lthe, Vkep, Rs, g;
double V, weight, rnd, sin_inc_cmp, cos_inc_cmp;
BLRmodel9 *model = (BLRmodel9 *)pm;
double Vr, Vph, mbh;
Lopn_cos = cos(model->opn*PI/180.0);
//Lopn = model->opn*PI/180.0;
inc = acos(model->inc);
beta = model->beta;
F = model->F;
mu = exp(model->mu);
if(flag_type == 1) // 1D RM, no dynmaical parameters
{
mbh = 0.0;
}
else
{
mbh = exp(model->mbh);
}
Rs = 3.0e11*mbh/CM_PER_LD; // Schwarzchild radius in a unit of light-days
a = 1.0/beta/beta;
s = mu/a;
rin = mu*F + Rs;
sig = (1.0-F)*s;
sin_inc_cmp = cos(inc); //sin(PI/2.0 - inc);
cos_inc_cmp = sin(inc); //cos(PI/2.0 - inc);
for(i=0; i<parset.n_cloud_per_task; i++)
{
// generate a direction of the angular momentum
Lphi = 2.0*PI * gsl_rng_uniform(gsl_r);
//Lthe = acos(Lopn_cos + (1.0-Lopn_cos) * gsl_rng_uniform(gsl_r));
//Lthe = gsl_rng_uniform(gsl_r) * Lopn;
Lthe = theta_sample(1.0, Lopn_cos, 1.0);
nc = 0;
r = rcloud_max_set+1.0;
while(r>rcloud_max_set || r<rcloud_min_set)
{
if(nc > 1000)
{
printf("# Error, too many tries in generating ridial location of clouds.\n");
exit(0);
}
rnd = gsl_ran_gamma(gsl_r, a, 1.0);
// r = mu * F + (1.0-F) * gsl_ran_gamma(gsl_r, 1.0/beta/beta, beta*beta*mu);
r = rin + sig * rnd;
nc++;
}
phi = 2.0*PI * gsl_rng_uniform(gsl_r);
x = r * cos(phi);
y = r * sin(phi);
z = 0.0;
/*xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y - sin(Lthe)*cos(Lphi) * z;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y + sin(Lthe)*sin(Lphi) * z;
zb = sin(Lthe) * x + cos(Lthe) * z;*/
xb = cos(Lthe)*cos(Lphi) * x + sin(Lphi) * y;
yb = -cos(Lthe)*sin(Lphi) * x + cos(Lphi) * y;
zb = sin(Lthe) * x;
/* counter-rotate around y */
//x = xb * cos(PI/2.0-inc) + zb * sin(PI/2.0-inc);
//y = yb;
//z =-xb * sin(PI/2.0-inc) + zb * cos(PI/2.0-inc);
x = xb * cos_inc_cmp + zb * sin_inc_cmp;
y = yb;
z =-xb * sin_inc_cmp + zb * cos_inc_cmp;
weight = 1.0;
clouds_weight[i] = weight;
#ifndef SpecAstro
dis = r - x;
clouds_tau[i] = dis;
if(flag_type == 1)
{
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
}
#else
switch(flag_type)
{
case 1: /* 1D RM */
dis = r - x;
clouds_tau[i] = dis;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\n", x, y, z);
}
continue;
break;
case 2: /* 2D RM */
dis = r - x;
clouds_tau[i] = dis;
break;
case 3: /* SA */
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 4: /* 1D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
case 5: /* 2D RM + SA */
dis = r - x;
clouds_tau[i] = dis;
clouds_alpha[i] = y;
clouds_beta[i] = z;
break;
}
#endif
/* velocity
* note that a cloud moves in its orbit plane, whose direction
* is determined by the direction of its angular momentum.
*/
Vkep = sqrt(mbh/r);
for(j=0; j<parset.n_vel_per_cloud; j++)
{
Vr = 0.0;
Vph = Vkep; /* RM cannot distinguish the orientation of the rotation. */
vx = Vr * cos(phi) - Vph * sin(phi);
vy = Vr * sin(phi) + Vph * cos(phi);
vz = 0.0;
/*vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy - sin(Lthe)*cos(Lphi) * vz;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy + sin(Lthe)*sin(Lphi) * vz;
vzb = sin(Lthe) * vx + cos(Lthe) * vz;*/
vxb = cos(Lthe)*cos(Lphi) * vx + sin(Lphi) * vy;
vyb =-cos(Lthe)*sin(Lphi) * vx + cos(Lphi) * vy;
vzb = sin(Lthe) * vx;
//vx = vxb * cos(PI/2.0-inc) + vzb * sin(PI/2.0-inc);
//vy = vyb;
//vz =-vxb * sin(PI/2.0-inc) + vzb * cos(PI/2.0-inc);
vx = vxb * cos_inc_cmp + vzb * sin_inc_cmp;
vy = vyb;
vz =-vxb * sin_inc_cmp + vzb * cos_inc_cmp;
V = -vx; //note the definition of the line-of-sight velocity. positive means a receding
// velocity relative to the observer.
if(fabs(V) >= C_Unit) // make sure that the velocity is smaller than speed of light
V = 0.9999*C_Unit * (V>0.0?1.0:-1.0);
g = (1.0 + V/C_Unit) / sqrt( (1.0 - V*V/C_Unit/C_Unit) ) / sqrt(1.0 - Rs/r); //relativistic effects
V = (g-1.0)*C_Unit;
clouds_vel[i*parset.n_vel_per_cloud + j] = V;
if(flag_save && thistask==roottask)
{
if(i%(icr_cloud_save) == 0)
fprintf(fcloud_out, "%f\t%f\t%f\t%f\t%f\t%f\t%f\n", x, y, z, vx*VelUnit, vy*VelUnit, vz*VelUnit, weight);
}
}
}
return;
}
void restart_action_1d(int iflag)
{
/* at present, nothing needs to do */
/*
FILE *fp;
char str[200];
sprintf(str, "%s/data/clouds_%04d.txt", parset.file_dir, thistask);
if(iflag == 0) // write
fp = fopen(str, "wb");
else // read
fp = fopen(str, "rb");
if(fp == NULL)
{
printf("# Cannot open file %s.\n", str);
}
if(iflag == 0)
{
printf("# Writing restart at task %d.\n", thistask);
}
else
{
printf("# Reading restart at task %d.\n", thistask);
}
fclose(fp);*/
return;
}
void restart_action_2d(int iflag)
{
restart_action_1d(iflag);
}
#ifdef SpecAstro
void restart_action_sa(int iflag)
{
restart_action_1d(iflag);
}
#endif |
# Z-Score
A z-score measures how many standard deviations above or below the mean a data point is.
>
\begin{align}
z = \frac{data\ point - mean}{standard\ deviation} \\
\end{align}
## Important facts
- A positive z-score says the data point is above average.
- A negative z-score says the data point is below average.
- A z-score close to 0 says the data point is close to average.
__Source:__ [Khan Academy](https://www.khanacademy.org/math/statistics-probability/modeling-distributions-of-data/z-scores/a/z-scores-review)
## Code
### Packages
```python
import numpy as np
```
### Function
```python
def z_score(sample, data_point):
# data point needs to come from the sample
assert data_point in sample
avg = np.mean(sample)
sd = np.std(sample)
z_score = (data_point - avg)/sd
return z_score
```
### Input
```python
sample = np.random.randn(30)
sample
```
array([-0.59877513, -0.51223475, -1.40174708, -1.86207935, -0.10035927,
0.12655593, 0.32697515, -0.35919666, -1.865143 , -0.27180892,
0.42933215, -0.44281586, -0.30340738, 1.17923063, -0.09077022,
-0.60174546, 0.34032583, -0.58059233, -1.90742451, -1.00759512,
0.73630683, -0.13672296, 1.54279119, -0.4798372 , 1.41396989,
0.87904765, -0.9446896 , 1.02256431, 0.77302047, -0.15333515])
```python
# grab the first data point
first_data_point = sample[0]
first_data_point
```
-0.59877512996891891
### Output
```python
z_score(sample, first_data_point)
```
-0.4795330537549915
|
State Before: α : Type u_1
β : Type u_2
γ : Type ?u.443960
δ : Type ?u.443963
inst✝³ : MeasurableSpace α
μ ν : Measure α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
f g : α →ₘ[μ] β
H : toGerm f = toGerm g
⊢ ↑↑f = ↑↑g State After: no goals Tactic: rwa [← toGerm_eq, ← toGerm_eq] |
import tactic data.set.countable
open set lattice
universe u
-- Basic definitions of formal systems and logics.
namespace logic
class formal_system :=
(formula : Type u)
(entails : set formula → formula → Prop)
infixr `⊢`:50 := formal_system.entails
section basic_definitions
parameter {L : formal_system}
@[reducible]
def formula := L.formula
-- local notation `formula` := L.formula
-- consequence set.
def C (Δ : set formula) : set formula := {φ : formula | Δ ⊢ φ}
def istheory (Δ : set formula) : Prop := C Δ = Δ
def Theory := subtype istheory
def Theorem (φ : formula) : Prop := ∅ ⊢ φ
def weak_consistent (Δ : set formula) : Prop := C Δ ≠ univ
def weak_maximally_consistent (Γ : Theory) : Prop :=
weak_consistent Γ.1
∧ ∀ Δ : Theory, Γ.1 ⊆ Δ.1 → weak_consistent Δ.1 → Γ = Δ
def recursive (Δ : set formula) := countable Δ ∧ nonempty (decidable_pred Δ)
lemma finite_recursive [decidable_eq formula] : ∀ {Δ : set formula}, finite Δ → recursive Δ :=
assume Δ : set formula,
assume h : finite Δ,
have c₀ : countable Δ, from countable_finite h,
let (nonempty.intro x) := h in
have dp : decidable_pred Δ, from @set.decidable_mem_of_fintype _ _ Δ x,
⟨c₀, nonempty.intro dp⟩
def axiomatizes (Δ: set formula) (Γ : Theory) : Prop := C Δ = Γ.1
def finitely_axiomatizable (Γ : Theory) : Prop := ∃ Δ, axiomatizes Δ Γ ∧ finite Δ
def recursively_axiomatizable (Γ : Theory) : Prop := ∃ Δ, axiomatizes Δ Γ ∧ recursive Δ
instance theoretic_entailment : has_le (set formula) := ⟨λ Γ Δ, ∀ ψ ∈ Δ, Γ ⊢ ψ⟩
--instance formula_entailment : has_le (formula) := ⟨λ φ ψ, {φ} ⊢ ψ⟩
end basic_definitions
section Tarski
class Tarski_system extends formal_system :=
(reflexivity : ∀ (Γ : set formula) (φ : formula), φ ∈ Γ → Γ ⊢ φ)
(transitivity : ∀ (Γ Δ : set formula) (φ : formula), Γ ≤ Δ → Δ ⊢ φ → Γ ⊢ φ)
parameter {L : Tarski_system}
-- Proofs become more readable if we specify which axioms we are using from the definition of a structure
-- in the beggining of the proof. This way we know what to expect to be used, and it becomes easier to analyze
-- the dependencies of results on axioms.
-- The proofs of this section are supposed to be used to define a
-- closure algebra.
lemma subset_proof : ∀ {Γ Δ : set L.formula}, Γ ⊆ Δ → Δ ≤ Γ :=
let rf := L.reflexivity in
assume Γ Δ : set L.formula,
assume h₀ : Γ ⊆ Δ,
assume φ : L.formula,
assume h₁ : φ ∈ Γ,
have c₀ : φ ∈ Δ, from h₀ h₁,
show Δ ⊢ φ, from rf Δ φ c₀
-- as we can see, for a non-monotonic logic we would have to drop
-- either the reflexivity or the transitivity axiom.
-- Fun fact: the Aristotelian name for "non-monotonic logic" would be Rhetoric.
lemma C_monotone : ∀ {Γ Δ : set L.formula}, Γ ⊆ Δ → C Γ ⊆ C Δ :=
let tr := L.transitivity in
assume Γ Δ : set L.formula,
assume h₀ : Γ ⊆ Δ,
assume φ : L.formula,
assume h₁ : φ ∈ C Γ,
have c₀ : Γ ⊢ φ, from h₁,
have c₁ : Δ ≤ Γ, from subset_proof h₀,
show φ ∈ C Δ, from tr Δ Γ φ c₁ c₀
lemma C_increasing : ∀ {Γ : set L.formula}, Γ ⊆ C Γ := L.reflexivity
lemma C_idempotent : ∀ (Γ : set L.formula), C (C Γ) = C Γ :=
let tr := L.transitivity in
begin
intro,
ext φ,
constructor; intro h₁,
apply tr Γ (C (C Γ)) φ,
intros ψ h₂,
apply tr Γ (C Γ) ψ,
intros x h, assumption,
exact h₂,
exact C_increasing h₁,
exact C_increasing h₁
end
lemma C_top_fixed : C Theorem = @Theorem L.to_formal_system :=
-- C (C ∅) = C ∅
C_idempotent ∅
instance entailment_preorder : preorder (set L.formula) :=
let tr := L.transitivity in
{ le := λ Γ Δ, ∀ ψ ∈ Δ, Γ ⊢ ψ,
lt := λ Γ Δ, (∀ ψ ∈ Δ, Γ ⊢ ψ) ∧ ¬ (∀ ψ ∈ Γ, Δ ⊢ ψ),
le_refl := by intros S φ h; apply @subset_proof _ {φ} S; simp; assumption,
le_trans :=
begin
intros Γ Δ Ω h₁ h₂ φ h₃,
dsimp at *,
apply tr Γ Δ φ,
exact h₁,
apply h₂,
exact h₃
end,
lt_iff_le_not_le :=
begin
intros Γ Δ,
fsplit; intro h;
cases h with h₁ h₂;
constructor; assumption,
end
}
instance entailment_order : partial_order (@Theory L.to_formal_system) :=
begin
fsplit; intros Γ,
intro Δ, exact Γ.1 ≤ Δ.1,
intro Δ, exact Γ.1 < Δ.1,
exact le_refl Γ.1,
intros Δ Ω h₁ h₂, dsimp at *, exact le_trans h₁ h₂,
all_goals {intros Δ; try{constructor}; intro h₁; try{exact h₁}},
intro h₂, cases Γ, cases Δ, simp,
ext φ, constructor; intro h,
have c : Δ_val ⊢ φ, from h₂ φ h,
unfold istheory at Δ_property,
rewrite ←Δ_property, exact c,
have c : Γ_val ⊢ φ, from h₁ φ h,
unfold istheory at Γ_property,
rewrite ←Γ_property, exact c,
end
end Tarski
section deduction
class deductive_system extends Tarski_system :=
(finitary : ∀ (Γ) (φ : formula), Γ ⊢ φ → ∃ Δ ⊆ Γ, finite Δ ∧ Δ ⊢ φ)
(encoding : encodable formula)
(recursive : decidable_pred (range encoding.encode))
class logic extends deductive_system :=
(connectives : distrib_lattice formula)
(deduction_order : ∀ {φ ψ}, φ ≤ ψ ↔ {φ} ⊢ ψ)
(and_intro : ∀ φ ψ, {φ, ψ} ⊢ φ ⊓ ψ)
(or_elim : ∀ {Γ} (φ ψ γ: formula), Γ ⊢ φ ⊔ ψ → Γ ∪ {φ} ⊢ γ → Γ ∪ {φ} ⊢ γ → Γ ⊢ γ)
(True : formula)
(True_intro : Theorem True)
(False : formula)
instance Lindenbaum_Tarski {L : logic} : distrib_lattice L.formula := L.connectives
@[simp]
def deduction_order {L : logic} := L.deduction_order
reserve infixr ` ⇒ `:55
class has_exp (α : Type u) := (exp : α → α → α)
infixr ⇒ := has_exp.exp
class minimal_logic extends logic :=
(implication : has_exp formula)
(implication_definition : ∀ φ ψ : formula, (φ ⇒ ψ) ⊓ φ ≤ ψ)
(implication_universal_property : ∀ {φ ψ γ : formula}, γ ⊓ φ ≤ ψ → γ ≤ (φ ⇒ ψ))
(deduction_theorem : ∀ {Γ} (φ ψ), Γ ∪ {φ} ⊢ ψ → Γ ⊢ φ ⇒ ψ)
parameter {L : minimal_logic}
instance implication_formula : has_exp L.formula := L.implication
instance minimal_negation : has_neg L.formula := ⟨λ φ, φ ⇒ L.False⟩
def intuitionistic : Prop := ∀ {φ : L.formula}, L.False ≤ φ
def classical : Prop := intuitionistic ∧ ∀ {φ : L.formula}, Theorem (φ ⊔ -φ)
end deduction
end logic |
(* Title: HOL/Auth/n_flash_lemma_on_inv__149.thy
Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
*)
header{*The n_flash Protocol Case Study*}
theory n_flash_lemma_on_inv__149 imports n_flash_base
begin
section{*All lemmas on causal relation between inv__149 and some rule r*}
lemma n_PI_Remote_GetVsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_PI_Remote_Get src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_PI_Remote_Get src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_PI_Remote_GetXVsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_PI_Remote_GetX src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_PI_Remote_GetX src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_NakVsinv__149:
assumes a1: "(\<exists> dst. dst\<le>N\<and>r=n_NI_Nak dst)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain dst where a1:"dst\<le>N\<and>r=n_NI_Nak dst" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(dst=p__Inv4)\<or>(dst~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(dst=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(dst~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_Get_Nak__part__0Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_Get_Nak__part__0 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_Get_Nak__part__0 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_Get_Nak__part__1Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_Get_Nak__part__1 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_Get_Nak__part__1 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_Get_Nak__part__2Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_Get_Nak__part__2 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_Get_Nak__part__2 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_Get_Get__part__0Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_Get_Get__part__0 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_Get_Get__part__0 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_Get_Get__part__1Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_Get_Get__part__1 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_Get_Get__part__1 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_Get_Put_HeadVsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_Get_Put_Head N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_Get_Put_Head N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Field (Ident ''Sta'') ''UniMsg'') p__Inv4) ''Cmd'')) (Const UNI_PutX)) (eqn (IVar (Field (Field (Ident ''Sta'') ''Dir'') ''Dirty'')) (Const false))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_Get_PutVsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_Get_Put src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_Get_Put src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_Get_Put_DirtyVsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_Get_Put_Dirty src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_Get_Put_Dirty src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Remote_Get_NakVsinv__149:
assumes a1: "(\<exists> src dst. src\<le>N\<and>dst\<le>N\<and>src~=dst\<and>r=n_NI_Remote_Get_Nak src dst)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src dst where a1:"src\<le>N\<and>dst\<le>N\<and>src~=dst\<and>r=n_NI_Remote_Get_Nak src dst" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4\<and>dst~=p__Inv4)\<or>(src~=p__Inv4\<and>dst=p__Inv4)\<or>(src~=p__Inv4\<and>dst~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4\<and>dst~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>dst=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>dst~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Remote_Get_PutVsinv__149:
assumes a1: "(\<exists> src dst. src\<le>N\<and>dst\<le>N\<and>src~=dst\<and>r=n_NI_Remote_Get_Put src dst)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src dst where a1:"src\<le>N\<and>dst\<le>N\<and>src~=dst\<and>r=n_NI_Remote_Get_Put src dst" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4\<and>dst~=p__Inv4)\<or>(src~=p__Inv4\<and>dst=p__Inv4)\<or>(src~=p__Inv4\<and>dst~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4\<and>dst~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>dst=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>dst~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_Nak__part__0Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_Nak__part__0 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_Nak__part__0 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_Nak__part__1Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_Nak__part__1 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_Nak__part__1 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_Nak__part__2Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_Nak__part__2 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_Nak__part__2 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_GetX__part__0Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_GetX__part__0 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_GetX__part__0 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_GetX__part__1Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_GetX__part__1 src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_GetX__part__1 src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_1Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_1 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_1 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_2Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_2 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_2 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_3Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_3 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_3 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_4Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_4 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_4 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_5Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_5 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_5 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_6Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_6 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_6 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_7__part__0Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_7__part__0 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_7__part__0 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_7__part__1Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_7__part__1 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_7__part__1 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_7_NODE_Get__part__0Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_7_NODE_Get__part__0 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_7_NODE_Get__part__0 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_7_NODE_Get__part__1Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_7_NODE_Get__part__1 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_7_NODE_Get__part__1 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_8_HomeVsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_8_Home N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_8_Home N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_8_Home_NODE_GetVsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_8_Home_NODE_Get N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_8_Home_NODE_Get N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_8Vsinv__149:
assumes a1: "(\<exists> src pp. src\<le>N\<and>pp\<le>N\<and>src~=pp\<and>r=n_NI_Local_GetX_PutX_8 N src pp)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src pp where a1:"src\<le>N\<and>pp\<le>N\<and>src~=pp\<and>r=n_NI_Local_GetX_PutX_8 N src pp" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4\<and>pp~=p__Inv4)\<or>(src~=p__Inv4\<and>pp=p__Inv4)\<or>(src~=p__Inv4\<and>pp~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4\<and>pp~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>pp=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>pp~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_8_NODE_GetVsinv__149:
assumes a1: "(\<exists> src pp. src\<le>N\<and>pp\<le>N\<and>src~=pp\<and>r=n_NI_Local_GetX_PutX_8_NODE_Get N src pp)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src pp where a1:"src\<le>N\<and>pp\<le>N\<and>src~=pp\<and>r=n_NI_Local_GetX_PutX_8_NODE_Get N src pp" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4\<and>pp~=p__Inv4)\<or>(src~=p__Inv4\<and>pp=p__Inv4)\<or>(src~=p__Inv4\<and>pp~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4\<and>pp~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>pp=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>pp~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_9__part__0Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_9__part__0 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_9__part__0 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_9__part__1Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_9__part__1 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_9__part__1 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_10_HomeVsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_10_Home N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_10_Home N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_10Vsinv__149:
assumes a1: "(\<exists> src pp. src\<le>N\<and>pp\<le>N\<and>src~=pp\<and>r=n_NI_Local_GetX_PutX_10 N src pp)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src pp where a1:"src\<le>N\<and>pp\<le>N\<and>src~=pp\<and>r=n_NI_Local_GetX_PutX_10 N src pp" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4\<and>pp~=p__Inv4)\<or>(src~=p__Inv4\<and>pp=p__Inv4)\<or>(src~=p__Inv4\<and>pp~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4\<and>pp~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>pp=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>pp~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Local_GetX_PutX_11Vsinv__149:
assumes a1: "(\<exists> src. src\<le>N\<and>r=n_NI_Local_GetX_PutX_11 N src)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src where a1:"src\<le>N\<and>r=n_NI_Local_GetX_PutX_11 N src" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4)\<or>(src~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Remote_GetX_NakVsinv__149:
assumes a1: "(\<exists> src dst. src\<le>N\<and>dst\<le>N\<and>src~=dst\<and>r=n_NI_Remote_GetX_Nak src dst)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src dst where a1:"src\<le>N\<and>dst\<le>N\<and>src~=dst\<and>r=n_NI_Remote_GetX_Nak src dst" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4\<and>dst~=p__Inv4)\<or>(src~=p__Inv4\<and>dst=p__Inv4)\<or>(src~=p__Inv4\<and>dst~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4\<and>dst~=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>dst=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>dst~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Remote_GetX_PutXVsinv__149:
assumes a1: "(\<exists> src dst. src\<le>N\<and>dst\<le>N\<and>src~=dst\<and>r=n_NI_Remote_GetX_PutX src dst)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain src dst where a1:"src\<le>N\<and>dst\<le>N\<and>src~=dst\<and>r=n_NI_Remote_GetX_PutX src dst" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(src=p__Inv4\<and>dst~=p__Inv4)\<or>(src~=p__Inv4\<and>dst=p__Inv4)\<or>(src~=p__Inv4\<and>dst~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(src=p__Inv4\<and>dst~=p__Inv4)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Field (Ident ''Sta'') ''Proc'') dst) ''CacheState'')) (Const CACHE_E)) (eqn (IVar (Field (Field (Ident ''Sta'') ''Dir'') ''ShrVld'')) (Const true))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>dst=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(src~=p__Inv4\<and>dst~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Remote_PutVsinv__149:
assumes a1: "(\<exists> dst. dst\<le>N\<and>r=n_NI_Remote_Put dst)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain dst where a1:"dst\<le>N\<and>r=n_NI_Remote_Put dst" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(dst=p__Inv4)\<or>(dst~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(dst=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(dst~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_NI_Remote_PutXVsinv__149:
assumes a1: "(\<exists> dst. dst\<le>N\<and>r=n_NI_Remote_PutX dst)" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain dst where a1:"dst\<le>N\<and>r=n_NI_Remote_PutX dst" apply fastforce done
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "(dst=p__Inv4)\<or>(dst~=p__Inv4)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(dst=p__Inv4)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(dst~=p__Inv4)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_PI_Local_GetX_PutX_HeadVld__part__0Vsinv__149:
assumes a1: "(r=n_PI_Local_GetX_PutX_HeadVld__part__0 N )" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "?P1 s"
proof(cut_tac a1 a2 , auto) qed
then show "invHoldForRule s f r (invariants N)" by auto
qed
lemma n_PI_Local_GetX_PutX_HeadVld__part__1Vsinv__149:
assumes a1: "(r=n_PI_Local_GetX_PutX_HeadVld__part__1 N )" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "?P1 s"
proof(cut_tac a1 a2 , auto) qed
then show "invHoldForRule s f r (invariants N)" by auto
qed
lemma n_NI_ShWbVsinv__149:
assumes a1: "(r=n_NI_ShWb N )" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a2 obtain p__Inv4 where a2:"p__Inv4\<le>N\<and>f=inv__149 p__Inv4" apply fastforce done
have "?P3 s"
apply (cut_tac a1 a2 , simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Field (Ident ''Sta'') ''UniMsg'') p__Inv4) ''Cmd'')) (Const UNI_PutX)) (eqn (IVar (Field (Field (Ident ''Sta'') ''ShWbMsg'') ''Cmd'')) (Const SHWB_ShWb))))" in exI, auto) done
then show "invHoldForRule s f r (invariants N)" by auto
qed
lemma n_NI_Remote_GetX_PutX_HomeVsinv__149:
assumes a1: "\<exists> dst. dst\<le>N\<and>r=n_NI_Remote_GetX_PutX_Home dst" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Local_GetX_PutX__part__0Vsinv__149:
assumes a1: "r=n_PI_Local_GetX_PutX__part__0 " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_WbVsinv__149:
assumes a1: "r=n_NI_Wb " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_StoreVsinv__149:
assumes a1: "\<exists> src data. src\<le>N\<and>data\<le>N\<and>r=n_Store src data" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_InvAck_3Vsinv__149:
assumes a1: "\<exists> src. src\<le>N\<and>r=n_NI_InvAck_3 N src" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_InvAck_1Vsinv__149:
assumes a1: "\<exists> src. src\<le>N\<and>r=n_NI_InvAck_1 N src" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Local_GetX_GetX__part__1Vsinv__149:
assumes a1: "r=n_PI_Local_GetX_GetX__part__1 " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Local_GetX_GetX__part__0Vsinv__149:
assumes a1: "r=n_PI_Local_GetX_GetX__part__0 " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Remote_ReplaceVsinv__149:
assumes a1: "\<exists> src. src\<le>N\<and>r=n_PI_Remote_Replace src" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_Store_HomeVsinv__149:
assumes a1: "\<exists> data. data\<le>N\<and>r=n_Store_Home data" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Local_ReplaceVsinv__149:
assumes a1: "r=n_PI_Local_Replace " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_InvAck_existsVsinv__149:
assumes a1: "\<exists> src pp. src\<le>N\<and>pp\<le>N\<and>src~=pp\<and>r=n_NI_InvAck_exists src pp" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Remote_PutXVsinv__149:
assumes a1: "\<exists> dst. dst\<le>N\<and>r=n_PI_Remote_PutX dst" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_Remote_Get_Put_HomeVsinv__149:
assumes a1: "\<exists> dst. dst\<le>N\<and>r=n_NI_Remote_Get_Put_Home dst" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_InvVsinv__149:
assumes a1: "\<exists> dst. dst\<le>N\<and>r=n_NI_Inv dst" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Local_PutXVsinv__149:
assumes a1: "r=n_PI_Local_PutX " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Local_Get_PutVsinv__149:
assumes a1: "r=n_PI_Local_Get_Put " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_ReplaceVsinv__149:
assumes a1: "\<exists> src. src\<le>N\<and>r=n_NI_Replace src" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_Remote_GetX_Nak_HomeVsinv__149:
assumes a1: "\<exists> dst. dst\<le>N\<and>r=n_NI_Remote_GetX_Nak_Home dst" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_Local_PutXAcksDoneVsinv__149:
assumes a1: "r=n_NI_Local_PutXAcksDone " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Local_GetX_PutX__part__1Vsinv__149:
assumes a1: "r=n_PI_Local_GetX_PutX__part__1 " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_Remote_Get_Nak_HomeVsinv__149:
assumes a1: "\<exists> dst. dst\<le>N\<and>r=n_NI_Remote_Get_Nak_Home dst" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_InvAck_exists_HomeVsinv__149:
assumes a1: "\<exists> src. src\<le>N\<and>r=n_NI_InvAck_exists_Home src" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_Replace_HomeVsinv__149:
assumes a1: "r=n_NI_Replace_Home " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_Local_PutVsinv__149:
assumes a1: "r=n_NI_Local_Put " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_Nak_ClearVsinv__149:
assumes a1: "r=n_NI_Nak_Clear " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_PI_Local_Get_GetVsinv__149:
assumes a1: "r=n_PI_Local_Get_Get " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_Nak_HomeVsinv__149:
assumes a1: "r=n_NI_Nak_Home " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_InvAck_2Vsinv__149:
assumes a1: "\<exists> src. src\<le>N\<and>r=n_NI_InvAck_2 N src" and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_NI_FAckVsinv__149:
assumes a1: "r=n_NI_FAck " and
a2: "(\<exists> p__Inv4. p__Inv4\<le>N\<and>f=inv__149 p__Inv4)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
end
|
(*
Copyright (C) 2017 M.A.L. Marques
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*)
(* type: work_gga_x *)
mu := 0.0617:
kappa := 1.245:
alpha := 0.0483:
f0 := s -> 1 + mu*s^2*exp(-alpha*s^2) + kappa*(1 - exp(-1/2*alpha*s^2)):
f := x -> f0(X2S*x):
|
State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
h : (fun y => ↑p fun x => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1)
y : E
⊢ (↑p fun x => y) = 0 State After: case intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
h : (fun y => ↑p fun x => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1)
y : E
c : ℝ
c_pos : 0 < c
hc : IsBigOWith c (𝓝 0) (fun y => ↑p fun x => y) fun y => ‖y‖ ^ (n + 1)
⊢ (↑p fun x => y) = 0 Tactic: obtain ⟨c, c_pos, hc⟩ := h.exists_pos State Before: case intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
h : (fun y => ↑p fun x => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1)
y : E
c : ℝ
c_pos : 0 < c
hc : IsBigOWith c (𝓝 0) (fun y => ↑p fun x => y) fun y => ‖y‖ ^ (n + 1)
⊢ (↑p fun x => y) = 0 State After: case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
h : (fun y => ↑p fun x => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1)
y : E
c : ℝ
c_pos : 0 < c
hc : IsBigOWith c (𝓝 0) (fun y => ↑p fun x => y) fun y => ‖y‖ ^ (n + 1)
t : Set E
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (n + 1)‖
t_open : IsOpen t
z_mem : 0 ∈ t
⊢ (↑p fun x => y) = 0 Tactic: obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) State Before: case intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
h : (fun y => ↑p fun x => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1)
y : E
c : ℝ
c_pos : 0 < c
hc : IsBigOWith c (𝓝 0) (fun y => ↑p fun x => y) fun y => ‖y‖ ^ (n + 1)
t : Set E
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (n + 1)‖
t_open : IsOpen t
z_mem : 0 ∈ t
⊢ (↑p fun x => y) = 0 State After: case intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
h : (fun y => ↑p fun x => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1)
y : E
c : ℝ
c_pos : 0 < c
hc : IsBigOWith c (𝓝 0) (fun y => ↑p fun x => y) fun y => ‖y‖ ^ (n + 1)
t : Set E
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (n + 1)‖
t_open : IsOpen t
z_mem : 0 ∈ t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
⊢ (↑p fun x => y) = 0 Tactic: obtain ⟨δ, δ_pos, δε⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem State Before: case intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
h : (fun y => ↑p fun x => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1)
y : E
c : ℝ
c_pos : 0 < c
hc : IsBigOWith c (𝓝 0) (fun y => ↑p fun x => y) fun y => ‖y‖ ^ (n + 1)
t : Set E
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (n + 1)‖
t_open : IsOpen t
z_mem : 0 ∈ t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
⊢ (↑p fun x => y) = 0 State After: case intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
y : E
c : ℝ
c_pos : 0 < c
t : Set E
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (n + 1)‖
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
⊢ (↑p fun x => y) = 0 Tactic: clear h hc z_mem State Before: case intro.intro.intro.intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
y : E
c : ℝ
c_pos : 0 < c
t : Set E
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (n + 1)‖
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
⊢ (↑p fun x => y) = 0 State After: case intro.intro.intro.intro.intro.intro.intro.zero
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.zero + 1)‖
⊢ (↑p fun x => y) = 0
case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
⊢ (↑p fun x => y) = 0 Tactic: cases' n with n State Before: case intro.intro.intro.intro.intro.intro.intro.zero
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.zero + 1)‖
⊢ (↑p fun x => y) = 0 State After: no goals Tactic: exact norm_eq_zero.mp (by
simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one,
mul_zero, norm_le_zero_iff] using ht 0 (δε (Metric.mem_ball_self δ_pos))) State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.zero + 1)‖
⊢ ‖↑p fun x => y‖ = 0 State After: no goals Tactic: simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one,
mul_zero, norm_le_zero_iff] using ht 0 (δε (Metric.mem_ball_self δ_pos)) State Before: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
⊢ (↑p fun x => y) = 0 State After: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : ¬y = 0
⊢ (↑p fun x => y) = 0 Tactic: refine' Or.elim (Classical.em (y = 0))
(fun hy => by simpa only [hy] using p.map_zero) fun hy => _ State Before: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : ¬y = 0
⊢ (↑p fun x => y) = 0 State After: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
⊢ (↑p fun x => y) = 0 Tactic: replace hy := norm_pos_iff.mpr hy State Before: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
⊢ (↑p fun x => y) = 0 State After: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
⊢ ‖↑p fun x => y‖ ≤ 0 + ε Tactic: refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun ε ε_pos => _) (norm_nonneg _)) State Before: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
⊢ ‖↑p fun x => y‖ ≤ 0 + ε State After: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
⊢ ‖↑p fun x => y‖ ≤ 0 + ε Tactic: have h₀ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) State Before: case intro.intro.intro.intro.intro.intro.intro.succ
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
⊢ ‖↑p fun x => y‖ ≤ 0 + ε State After: case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
⊢ ‖↑p fun x => y‖ ≤ 0 + ε Tactic: obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt 𝕜
(lt_min (mul_pos δ_pos (inv_pos.mpr hy)) (mul_pos ε_pos (inv_pos.mpr h₀))) State Before: case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
⊢ ‖↑p fun x => y‖ ≤ 0 + ε State After: case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
⊢ ‖↑p fun x => y‖ ≤ 0 + ε Tactic: have h₁ : ‖k • y‖ < δ := by
rw [norm_smul]
exact inv_mul_cancel_right₀ hy.ne.symm δ ▸
mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy State Before: case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
⊢ ‖↑p fun x => y‖ ≤ 0 + ε State After: case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
⊢ ‖↑p fun x => y‖ ≤ 0 + ε Tactic: have h₂ :=
calc
‖p fun _ => k • y‖ ≤ c * ‖k • y‖ ^ (n.succ + 1) := by
simpa only [norm_pow, _root_.norm_norm] using ht (k • y) (δε (mem_ball_zero_iff.mpr h₁))
_ = ‖k‖ ^ n.succ * (‖k‖ * (c * ‖y‖ ^ (n.succ + 1))) := by
simp only [norm_smul, mul_pow, Nat.succ_eq_add_one]
ring State Before: case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
⊢ ‖↑p fun x => y‖ ≤ 0 + ε State After: case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖↑p fun x => y‖ ≤ 0 + ε Tactic: have h₃ : ‖k‖ * (c * ‖y‖ ^ (n.succ + 1)) < ε :=
inv_mul_cancel_right₀ h₀.ne.symm ε ▸
mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) h₀ State Before: case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖↑p fun x => y‖ ≤ 0 + ε State After: no goals Tactic: calc
‖p fun _ => y‖ = ‖k⁻¹ ^ n.succ‖ * ‖p fun _ => k • y‖ := by
simpa only [inv_smul_smul₀ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const,
Finset.card_fin] using
congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k • y)
_ ≤ ‖k⁻¹ ^ n.succ‖ * (‖k‖ ^ n.succ * (‖k‖ * (c * ‖y‖ ^ (n.succ + 1)))) := by gcongr
_ = ‖(k⁻¹ * k) ^ n.succ‖ * (‖k‖ * (c * ‖y‖ ^ (n.succ + 1))) := by
rw [← mul_assoc]
simp [norm_mul, mul_pow]
_ ≤ 0 + ε := by
rw [inv_mul_cancel (norm_pos_iff.mp k_pos)]
simpa using h₃.le State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : y = 0
⊢ (↑p fun x => y) = 0 State After: no goals Tactic: simpa only [hy] using p.map_zero State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
⊢ ‖k • y‖ < δ State After: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
⊢ ‖k‖ * ‖y‖ < δ Tactic: rw [norm_smul] State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
⊢ ‖k‖ * ‖y‖ < δ State After: no goals Tactic: exact inv_mul_cancel_right₀ hy.ne.symm δ ▸
mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
⊢ ‖↑p fun x => k • y‖ ≤ c * ‖k • y‖ ^ (Nat.succ n + 1) State After: no goals Tactic: simpa only [norm_pow, _root_.norm_norm] using ht (k • y) (δε (mem_ball_zero_iff.mpr h₁)) State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
⊢ c * ‖k • y‖ ^ (Nat.succ n + 1) = ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) State After: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
⊢ c * (‖k‖ ^ (n + 1 + 1) * ‖y‖ ^ (n + 1 + 1)) = ‖k‖ ^ (n + 1) * (‖k‖ * (c * ‖y‖ ^ (n + 1 + 1))) Tactic: simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
⊢ c * (‖k‖ ^ (n + 1 + 1) * ‖y‖ ^ (n + 1 + 1)) = ‖k‖ ^ (n + 1) * (‖k‖ * (c * ‖y‖ ^ (n + 1 + 1))) State After: no goals Tactic: ring State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖↑p fun x => y‖ = ‖k⁻¹ ^ Nat.succ n‖ * ‖↑p fun x => k • y‖ State After: no goals Tactic: simpa only [inv_smul_smul₀ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const,
Finset.card_fin] using
congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k • y) State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖k⁻¹ ^ Nat.succ n‖ * ‖↑p fun x => k • y‖ ≤
‖k⁻¹ ^ Nat.succ n‖ * (‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))) State After: no goals Tactic: gcongr State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖k⁻¹ ^ Nat.succ n‖ * (‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))) =
‖(k⁻¹ * k) ^ Nat.succ n‖ * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) State After: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖k⁻¹ ^ Nat.succ n‖ * ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) =
‖(k⁻¹ * k) ^ Nat.succ n‖ * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) Tactic: rw [← mul_assoc] State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖k⁻¹ ^ Nat.succ n‖ * ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) =
‖(k⁻¹ * k) ^ Nat.succ n‖ * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) State After: no goals Tactic: simp [norm_mul, mul_pow] State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖(k⁻¹ * k) ^ Nat.succ n‖ * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) ≤ 0 + ε State After: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖1 ^ Nat.succ n‖ * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) ≤ 0 + ε Tactic: rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] State Before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
G : Type ?u.1082661
inst✝⁶ : NontriviallyNormedField 𝕜
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
y : E
c : ℝ
c_pos : 0 < c
t : Set E
t_open : IsOpen t
δ : ℝ
δ_pos : δ > 0
δε : Metric.ball 0 δ ⊆ t
n : ℕ
p : ContinuousMultilinearMap 𝕜 (fun i => E) F
ht : ∀ (x : E), x ∈ t → ‖↑p fun x_1 => x‖ ≤ c * ‖‖x‖ ^ (Nat.succ n + 1)‖
hy : 0 < ‖y‖
ε : ℝ
ε_pos : 0 < ε
h₀ : 0 < c * ‖y‖ ^ (Nat.succ n + 1)
k : 𝕜
k_pos : 0 < ‖k‖
k_norm : ‖k‖ < min (δ * ‖y‖⁻¹) (ε * (c * ‖y‖ ^ (Nat.succ n + 1))⁻¹)
h₁ : ‖k • y‖ < δ
h₂ : ‖↑p fun x => k • y‖ ≤ ‖k‖ ^ Nat.succ n * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)))
h₃ : ‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1)) < ε
⊢ ‖1 ^ Nat.succ n‖ * (‖k‖ * (c * ‖y‖ ^ (Nat.succ n + 1))) ≤ 0 + ε State After: no goals Tactic: simpa using h₃.le |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""post process for 310 inference"""
import argparse
import os
import numpy as np
import mindspore.nn as nn
from mindspore import Tensor
parser = argparse.ArgumentParser(description='postprocess for tcn')
parser.add_argument("--dataset_name", type=str, default="permuted_mnist", help="result file path")
parser.add_argument("--result_path", type=str, required=True, help="result file path")
parser.add_argument("--label_path", type=str, required=True, help="label file")
args = parser.parse_args()
def cal_acc_premuted_mnist(result_path, label_path):
"""post process of premuted mnist for 310 inference"""
img_total = 0
totalcorrect = 0
files = os.listdir(result_path)
for file in files:
batch_size = int(file.split('tcn_premuted_mnist')[1].split('_')[0])
full_file_path = os.path.join(result_path, file)
if os.path.isfile(full_file_path):
result = np.fromfile(full_file_path, dtype=np.float32).reshape((batch_size, 10))
label_file = os.path.join(label_path, file)
gt_classes = np.fromfile(label_file, dtype=np.int32)
top1_output = np.argmax(result, (-1))
correct = np.equal(top1_output, gt_classes).sum()
totalcorrect += correct
img_total += batch_size
acc1 = 100.0 * totalcorrect / img_total
print('acc={:.4f}%'.format(acc1))
def cal_acc_adding_problem(result_path, label_path):
"""post process of adding problem for 310 inference"""
files = os.listdir(result_path)
label_name = os.listdir(label_path)[0]
label_file = os.path.join(label_path, label_name)
error = nn.MSE()
mse_loss = []
for file in files:
full_file_path = os.path.join(result_path, file)
result = Tensor(np.fromfile(full_file_path, dtype=np.float32).reshape((1000, 1)))
label = Tensor(np.fromfile(label_file, dtype=np.float32))
error.clear()
error.update(result, label)
result = error.eval()
mse_loss.append(result)
acc = sum(mse_loss) / len(mse_loss)
print('myloss={}'.format(acc))
if __name__ == "__main__":
if args.dataset_name == "permuted_mnist":
cal_acc_premuted_mnist(args.result_path, args.label_path)
elif args.dataset_name == "adding_problem":
cal_acc_adding_problem(args.result_path, args.label_path)
|
Function wdsax(x)
Common /wood/r, d, fnorm, w
Save
wdsax = fnorm*(1.+w*(x/r)**2)/(1+exp((x-r)/d))
If (w<0.) Then
If (x>=r/sqrt(abs(w))) wdsax = 0.
End If
Return
End Function wdsax
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Matrix where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Univalence
open import Cubical.Functions.FunExtEquiv
import Cubical.Data.Empty as ⊥
open import Cubical.Data.Nat hiding (_+_ ; +-comm)
open import Cubical.Data.Vec
open import Cubical.Data.FinData
open import Cubical.Relation.Nullary
open import Cubical.Structures.CommRing
private
variable
ℓ : Level
A : Type ℓ
-- Equivalence between Vec matrix and Fin function matrix
FinMatrix : (A : Type ℓ) (m n : ℕ) → Type ℓ
FinMatrix A m n = FinVec (FinVec A n) m
VecMatrix : (A : Type ℓ) (m n : ℕ) → Type ℓ
VecMatrix A m n = Vec (Vec A n) m
FinMatrix→VecMatrix : {m n : ℕ} → FinMatrix A m n → VecMatrix A m n
FinMatrix→VecMatrix M = FinVec→Vec (λ fm → FinVec→Vec (λ fn → M fm fn))
VecMatrix→FinMatrix : {m n : ℕ} → VecMatrix A m n → FinMatrix A m n
VecMatrix→FinMatrix M fn fm = lookup fm (lookup fn M)
FinMatrix→VecMatrix→FinMatrix : {m n : ℕ} (M : FinMatrix A m n)
→ VecMatrix→FinMatrix (FinMatrix→VecMatrix M) ≡ M
FinMatrix→VecMatrix→FinMatrix {m = zero} M = funExt λ f → ⊥.rec (¬Fin0 f)
FinMatrix→VecMatrix→FinMatrix {n = zero} M = funExt₂ λ _ f → ⊥.rec (¬Fin0 f)
FinMatrix→VecMatrix→FinMatrix {m = suc m} {n = suc n} M = funExt₂ goal
where
goal : (fm : Fin (suc m)) (fn : Fin (suc n)) →
VecMatrix→FinMatrix (_ ∷ FinMatrix→VecMatrix (λ z → M (suc z))) fm fn ≡ M fm fn
goal zero zero = refl
goal zero (suc fn) i = FinVec→Vec→FinVec (λ z → M zero (suc z)) i fn
goal (suc fm) fn i = FinMatrix→VecMatrix→FinMatrix (λ z → M (suc z)) i fm fn
VecMatrix→FinMatrix→VecMatrix : {m n : ℕ} (M : VecMatrix A m n)
→ FinMatrix→VecMatrix (VecMatrix→FinMatrix M) ≡ M
VecMatrix→FinMatrix→VecMatrix {m = zero} [] = refl
VecMatrix→FinMatrix→VecMatrix {m = suc m} (M ∷ MS) i =
Vec→FinVec→Vec M i ∷ VecMatrix→FinMatrix→VecMatrix MS i
FinMatrixIsoVecMatrix : (A : Type ℓ) (m n : ℕ) → Iso (FinMatrix A m n) (VecMatrix A m n)
FinMatrixIsoVecMatrix A m n =
iso FinMatrix→VecMatrix VecMatrix→FinMatrix VecMatrix→FinMatrix→VecMatrix FinMatrix→VecMatrix→FinMatrix
FinMatrix≃VecMatrix : {m n : ℕ} → FinMatrix A m n ≃ VecMatrix A m n
FinMatrix≃VecMatrix {_} {A} {m} {n} = isoToEquiv (FinMatrixIsoVecMatrix A m n)
FinMatrix≡VecMatrix : (A : Type ℓ) (m n : ℕ) → FinMatrix A m n ≡ VecMatrix A m n
FinMatrix≡VecMatrix _ _ _ = ua FinMatrix≃VecMatrix
-- We could have constructed the above Path as follows, but that
-- doesn't reduce as nicely as ua isn't on the toplevel:
--
-- FinMatrix≡VecMatrix : (A : Type ℓ) (m n : ℕ) → FinMatrix A m n ≡ VecMatrix A m n
-- FinMatrix≡VecMatrix A m n i = FinVec≡Vec (FinVec≡Vec A n i) m i
-- Experiment using addition. Transport commutativity from one
-- representation to the the other and relate the transported
-- operation with a more direct definition.
module _ (R' : CommRing {ℓ}) where
open CommRing R' renaming ( Carrier to R )
addFinMatrix : ∀ {m n} → FinMatrix R m n → FinMatrix R m n → FinMatrix R m n
addFinMatrix M N = λ k l → M k l + N k l
addFinMatrixComm : ∀ {m n} → (M N : FinMatrix R m n) → addFinMatrix M N ≡ addFinMatrix N M
addFinMatrixComm M N i k l = +-comm (M k l) (N k l) i
addVecMatrix : ∀ {m n} → VecMatrix R m n → VecMatrix R m n → VecMatrix R m n
addVecMatrix {m} {n} = transport (λ i → FinMatrix≡VecMatrix R m n i
→ FinMatrix≡VecMatrix R m n i
→ FinMatrix≡VecMatrix R m n i)
addFinMatrix
addMatrixPath : ∀ {m n} → PathP (λ i → FinMatrix≡VecMatrix R m n i
→ FinMatrix≡VecMatrix R m n i
→ FinMatrix≡VecMatrix R m n i)
addFinMatrix addVecMatrix
addMatrixPath {m} {n} i = transp (λ j → FinMatrix≡VecMatrix R m n (i ∧ j)
→ FinMatrix≡VecMatrix R m n (i ∧ j)
→ FinMatrix≡VecMatrix R m n (i ∧ j))
(~ i) addFinMatrix
addVecMatrixComm : ∀ {m n} → (M N : VecMatrix R m n) → addVecMatrix M N ≡ addVecMatrix N M
addVecMatrixComm {m} {n} = transport (λ i → (M N : FinMatrix≡VecMatrix R m n i)
→ addMatrixPath i M N ≡ addMatrixPath i N M)
addFinMatrixComm
-- More direct definition of addition for VecMatrix:
addVec : ∀ {m} → Vec R m → Vec R m → Vec R m
addVec [] [] = []
addVec (x ∷ xs) (y ∷ ys) = x + y ∷ addVec xs ys
addVecLem : ∀ {m} → (M N : Vec R m)
→ FinVec→Vec (λ l → lookup l M + lookup l N) ≡ addVec M N
addVecLem {zero} [] [] = refl
addVecLem {suc m} (x ∷ xs) (y ∷ ys) = cong (λ zs → x + y ∷ zs) (addVecLem xs ys)
addVecMatrix' : ∀ {m n} → VecMatrix R m n → VecMatrix R m n → VecMatrix R m n
addVecMatrix' [] [] = []
addVecMatrix' (M ∷ MS) (N ∷ NS) = addVec M N ∷ addVecMatrix' MS NS
-- The key lemma relating addVecMatrix and addVecMatrix'
addVecMatrixEq : ∀ {m n} → (M N : VecMatrix R m n) → addVecMatrix M N ≡ addVecMatrix' M N
addVecMatrixEq {zero} {n} [] [] j = transp (λ i → Vec (Vec R n) 0) j []
addVecMatrixEq {suc m} {n} (M ∷ MS) (N ∷ NS) =
addVecMatrix (M ∷ MS) (N ∷ NS)
≡⟨ transportUAop₂ FinMatrix≃VecMatrix addFinMatrix (M ∷ MS) (N ∷ NS) ⟩
FinVec→Vec (λ l → lookup l M + lookup l N) ∷ _
≡⟨ (λ i → addVecLem M N i ∷ FinMatrix→VecMatrix (λ k l → lookup l (lookup k MS) + lookup l (lookup k NS))) ⟩
addVec M N ∷ _
≡⟨ cong (λ X → addVec M N ∷ X) (sym (transportUAop₂ FinMatrix≃VecMatrix addFinMatrix MS NS) ∙ addVecMatrixEq MS NS) ⟩
addVec M N ∷ addVecMatrix' MS NS ∎
-- By binary funext we get an equality as functions
addVecMatrixEqFun : ∀ {m} {n} → addVecMatrix {m} {n} ≡ addVecMatrix'
addVecMatrixEqFun i M N = addVecMatrixEq M N i
-- We then directly get the properties about addVecMatrix'
addVecMatrixComm' : ∀ {m n} → (M N : VecMatrix R m n) → addVecMatrix' M N ≡ addVecMatrix' N M
addVecMatrixComm' M N = sym (addVecMatrixEq M N) ∙∙ addVecMatrixComm M N ∙∙ addVecMatrixEq N M
-- TODO: prove more properties about addition of matrices for both
-- FinMatrix and VecMatrix
-- TODO: define multiplication of matrices and do the same kind of
-- reasoning as we did for addition
|
import data.fintype
structure finite_graph :=
(vertices : Type)
(vertices_are_finite : fintype vertices)
(edges : vertices → vertices → Prop)
(no_loops : ∀ v : vertices, ¬ (edges v v))
(edges_symm : ∀ v w : vertices, edges v w → edges w v)
open finite_graph
variable {G : finite_graph}
notation : v ` E ` w := edges v w -- notation for edges -- can be anything.
example (v w : G.vertices) : v E w → w E v := sorry -- curses
/-
Can we prove that a graph has a Hamilton cycle or Euler cycle, iff it's connected and all but at most 2 degrees are even
-/ |
[STATEMENT]
lemma square_base: "get_base (square_base b) = get_base b * get_base b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. get_base (square_base b) = get_base b * get_base b
[PROOF STEP]
by (transfer, auto) |
If $f$ is holomorphic on $s$ and $g$ is holomorphic on $t$, and $f(s) \subseteq t$, then $g \circ f$ is holomorphic on $s$. |
[STATEMENT]
lemma stc_not_Infinitesimal: "stc(x) \<noteq> 0 \<Longrightarrow> x \<notin> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. stc x \<noteq> 0 \<Longrightarrow> x \<notin> Infinitesimal
[PROOF STEP]
by (fast intro: stc_Infinitesimal) |
[STATEMENT]
lemma trace_sim:
assumes "E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'" "E,F: s \<sqsubseteq>\<^sub>\<pi> t"
shows "\<exists>t'. (F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t') \<and> (E,F: s' \<sqsubseteq>\<^sub>\<pi> t')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'
E,F: s \<sqsubseteq>\<^sub>\<pi> t
goal (1 subgoal):
1. \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
proof (induction \<tau> s' rule: trace.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> []\<rangle>\<rightarrow> t' \<and> E,F: s \<sqsubseteq>\<^sub>\<pi> t'
2. \<And>\<tau> s' e s''. \<lbrakk>E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'; E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'; E: s'\<midarrow>e\<rightarrow> s''; E,F: s \<sqsubseteq>\<^sub>\<pi> t\<rbrakk> \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
case trace_nil
[PROOF STATE]
proof (state)
this:
E,F: s \<sqsubseteq>\<^sub>\<pi> t
goal (2 subgoals):
1. E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> []\<rangle>\<rightarrow> t' \<and> E,F: s \<sqsubseteq>\<^sub>\<pi> t'
2. \<And>\<tau> s' e s''. \<lbrakk>E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'; E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'; E: s'\<midarrow>e\<rightarrow> s''; E,F: s \<sqsubseteq>\<^sub>\<pi> t\<rbrakk> \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
E,F: s \<sqsubseteq>\<^sub>\<pi> t
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
E,F: s \<sqsubseteq>\<^sub>\<pi> t
goal (1 subgoal):
1. \<exists>t'. F: t \<midarrow>\<langle>map \<pi> []\<rangle>\<rightarrow> t' \<and> E,F: s \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>t'. F: t \<midarrow>\<langle>map \<pi> []\<rangle>\<rightarrow> t' \<and> E,F: s \<sqsubseteq>\<^sub>\<pi> t'
goal (1 subgoal):
1. \<And>\<tau> s' e s''. \<lbrakk>E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'; E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'; E: s'\<midarrow>e\<rightarrow> s''; E,F: s \<sqsubseteq>\<^sub>\<pi> t\<rbrakk> \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>\<tau> s' e s''. \<lbrakk>E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'; E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'; E: s'\<midarrow>e\<rightarrow> s''; E,F: s \<sqsubseteq>\<^sub>\<pi> t\<rbrakk> \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
case (trace_snoc \<tau> s' e s'')
[PROOF STATE]
proof (state)
this:
E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'
E: s'\<midarrow>e\<rightarrow> s''
E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'
E,F: s \<sqsubseteq>\<^sub>\<pi> t
goal (1 subgoal):
1. \<And>\<tau> s' e s''. \<lbrakk>E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'; E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'; E: s'\<midarrow>e\<rightarrow> s''; E,F: s \<sqsubseteq>\<^sub>\<pi> t\<rbrakk> \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'
E: s'\<midarrow>e\<rightarrow> s''
E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'
E,F: s \<sqsubseteq>\<^sub>\<pi> t
[PROOF STEP]
obtain t' where "F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t'" "E,F: s' \<sqsubseteq>\<^sub>\<pi> t'"
[PROOF STATE]
proof (prove)
using this:
E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'
E: s'\<midarrow>e\<rightarrow> s''
E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'
E,F: s \<sqsubseteq>\<^sub>\<pi> t
goal (1 subgoal):
1. (\<And>t'. \<lbrakk>F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t'; E,F: s' \<sqsubseteq>\<^sub>\<pi> t'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t'
E,F: s' \<sqsubseteq>\<^sub>\<pi> t'
goal (1 subgoal):
1. \<And>\<tau> s' e s''. \<lbrakk>E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'; E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'; E: s'\<midarrow>e\<rightarrow> s''; E,F: s \<sqsubseteq>\<^sub>\<pi> t\<rbrakk> \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
from \<open>E,F: s' \<sqsubseteq>\<^sub>\<pi> t'\<close> \<open>E: s'\<midarrow>e\<rightarrow> s''\<close>
[PROOF STATE]
proof (chain)
picking this:
E,F: s' \<sqsubseteq>\<^sub>\<pi> t'
E: s'\<midarrow>e\<rightarrow> s''
[PROOF STEP]
obtain t'' where "F: t' \<midarrow>\<pi> e\<rightarrow> t''" "E,F: s'' \<sqsubseteq>\<^sub>\<pi> t''"
[PROOF STATE]
proof (prove)
using this:
E,F: s' \<sqsubseteq>\<^sub>\<pi> t'
E: s'\<midarrow>e\<rightarrow> s''
goal (1 subgoal):
1. (\<And>t''. \<lbrakk>F: t'\<midarrow>\<pi> e\<rightarrow> t''; E,F: s'' \<sqsubseteq>\<^sub>\<pi> t''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim sim.cases) fastforce
[PROOF STATE]
proof (state)
this:
F: t'\<midarrow>\<pi> e\<rightarrow> t''
E,F: s'' \<sqsubseteq>\<^sub>\<pi> t''
goal (1 subgoal):
1. \<And>\<tau> s' e s''. \<lbrakk>E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'; E,F: s \<sqsubseteq>\<^sub>\<pi> t \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t' \<and> E,F: s' \<sqsubseteq>\<^sub>\<pi> t'; E: s'\<midarrow>e\<rightarrow> s''; E,F: s \<sqsubseteq>\<^sub>\<pi> t\<rbrakk> \<Longrightarrow> \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
F: t'\<midarrow>\<pi> e\<rightarrow> t''
E,F: s'' \<sqsubseteq>\<^sub>\<pi> t''
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
F: t'\<midarrow>\<pi> e\<rightarrow> t''
E,F: s'' \<sqsubseteq>\<^sub>\<pi> t''
goal (1 subgoal):
1. \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
using \<open>F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t'\<close> \<open>E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'\<close> \<open>E: s'\<midarrow>e\<rightarrow> s''\<close>
[PROOF STATE]
proof (prove)
using this:
F: t'\<midarrow>\<pi> e\<rightarrow> t''
E,F: s'' \<sqsubseteq>\<^sub>\<pi> t''
F: t \<midarrow>\<langle>map \<pi> \<tau>\<rangle>\<rightarrow> t'
E: s \<midarrow>\<langle>\<tau>\<rangle>\<rightarrow> s'
E: s'\<midarrow>e\<rightarrow> s''
goal (1 subgoal):
1. \<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>t'. F: t \<midarrow>\<langle>map \<pi> (\<tau> @ [e])\<rangle>\<rightarrow> t' \<and> E,F: s'' \<sqsubseteq>\<^sub>\<pi> t'
goal:
No subgoals!
[PROOF STEP]
qed |
module BayesianTools
using Reexport
include("improperdist.jl")
include("Links/Links.jl")
include("ProductDistributions/ProductDistributions.jl")
include("crossmethods.jl")
#export ProductDistribution, link, invlink
end # module
|
If $x$ is an algebraic integer, then $\sqrt{x}$ is an algebraic integer. |
If $x$ is an algebraic integer, then $\sqrt{x}$ is an algebraic integer. |
{-# OPTIONS --without-K #-}
open import Relation.Binary.PropositionalEquality
open import Data.Product
open import Data.Unit
open import Data.Empty
open import Function
-- some HoTT-inspired combinators
_&_ = cong
_⁻¹ = sym
_◾_ = trans
coe : {A B : Set} → A ≡ B → A → B
coe refl a = a
_⊗_ : ∀ {A B : Set}{f g : A → B}{a a'} → f ≡ g → a ≡ a' → f a ≡ g a'
refl ⊗ refl = refl
infix 6 _⁻¹
infixr 4 _◾_
infixl 9 _&_
infixl 8 _⊗_
-- Syntax
--------------------------------------------------------------------------------
infixr 4 _⇒_
infixr 4 _,_
data Ty : Set where
ι : Ty
_⇒_ : Ty → Ty → Ty
data Con : Set where
∙ : Con
_,_ : Con → Ty → Con
data _∈_ (A : Ty) : Con → Set where
vz : ∀ {Γ} → A ∈ (Γ , A)
vs : ∀ {B Γ} → A ∈ Γ → A ∈ (Γ , B)
data Tm Γ : Ty → Set where
var : ∀ {A} → A ∈ Γ → Tm Γ A
lam : ∀ {A B} → Tm (Γ , A) B → Tm Γ (A ⇒ B)
app : ∀ {A B} → Tm Γ (A ⇒ B) → Tm Γ A → Tm Γ B
-- Embedding
--------------------------------------------------------------------------------
-- Order-preserving embedding
data OPE : Con → Con → Set where
∙ : OPE ∙ ∙
drop : ∀ {A Γ Δ} → OPE Γ Δ → OPE (Γ , A) Δ
keep : ∀ {A Γ Δ} → OPE Γ Δ → OPE (Γ , A) (Δ , A)
-- OPE is a category
idₑ : ∀ {Γ} → OPE Γ Γ
idₑ {∙} = ∙
idₑ {Γ , A} = keep (idₑ {Γ})
wk : ∀ {A Γ} → OPE (Γ , A) Γ
wk = drop idₑ
_∘ₑ_ : ∀ {Γ Δ Σ} → OPE Δ Σ → OPE Γ Δ → OPE Γ Σ
σ ∘ₑ ∙ = σ
σ ∘ₑ drop δ = drop (σ ∘ₑ δ)
drop σ ∘ₑ keep δ = drop (σ ∘ₑ δ)
keep σ ∘ₑ keep δ = keep (σ ∘ₑ δ)
idlₑ : ∀ {Γ Δ}(σ : OPE Γ Δ) → idₑ ∘ₑ σ ≡ σ
idlₑ ∙ = refl
idlₑ (drop σ) = drop & idlₑ σ
idlₑ (keep σ) = keep & idlₑ σ
idrₑ : ∀ {Γ Δ}(σ : OPE Γ Δ) → σ ∘ₑ idₑ ≡ σ
idrₑ ∙ = refl
idrₑ (drop σ) = drop & idrₑ σ
idrₑ (keep σ) = keep & idrₑ σ
assₑ :
∀ {Γ Δ Σ Ξ}(σ : OPE Σ Ξ)(δ : OPE Δ Σ)(ν : OPE Γ Δ)
→ (σ ∘ₑ δ) ∘ₑ ν ≡ σ ∘ₑ (δ ∘ₑ ν)
assₑ σ δ ∙ = refl
assₑ σ δ (drop ν) = drop & assₑ σ δ ν
assₑ σ (drop δ) (keep ν) = drop & assₑ σ δ ν
assₑ (drop σ) (keep δ) (keep ν) = drop & assₑ σ δ ν
assₑ (keep σ) (keep δ) (keep ν) = keep & assₑ σ δ ν
∈ₑ : ∀ {A Γ Δ} → OPE Γ Δ → A ∈ Δ → A ∈ Γ
∈ₑ ∙ v = v
∈ₑ (drop σ) v = vs (∈ₑ σ v)
∈ₑ (keep σ) vz = vz
∈ₑ (keep σ) (vs v) = vs (∈ₑ σ v)
∈-idₑ : ∀ {A Γ}(v : A ∈ Γ) → ∈ₑ idₑ v ≡ v
∈-idₑ vz = refl
∈-idₑ (vs v) = vs & ∈-idₑ v
∈-∘ₑ : ∀ {A Γ Δ Σ}(σ : OPE Δ Σ)(δ : OPE Γ Δ)(v : A ∈ Σ) → ∈ₑ (σ ∘ₑ δ) v ≡ ∈ₑ δ (∈ₑ σ v)
∈-∘ₑ ∙ ∙ v = refl
∈-∘ₑ σ (drop δ) v = vs & ∈-∘ₑ σ δ v
∈-∘ₑ (drop σ) (keep δ) v = vs & ∈-∘ₑ σ δ v
∈-∘ₑ (keep σ) (keep δ) vz = refl
∈-∘ₑ (keep σ) (keep δ) (vs v) = vs & ∈-∘ₑ σ δ v
Tmₑ : ∀ {A Γ Δ} → OPE Γ Δ → Tm Δ A → Tm Γ A
Tmₑ σ (var v) = var (∈ₑ σ v)
Tmₑ σ (lam t) = lam (Tmₑ (keep σ) t)
Tmₑ σ (app f a) = app (Tmₑ σ f) (Tmₑ σ a)
Tm-idₑ : ∀ {A Γ}(t : Tm Γ A) → Tmₑ idₑ t ≡ t
Tm-idₑ (var v) = var & ∈-idₑ v
Tm-idₑ (lam t) = lam & Tm-idₑ t
Tm-idₑ (app f a) = app & Tm-idₑ f ⊗ Tm-idₑ a
Tm-∘ₑ : ∀ {A Γ Δ Σ}(σ : OPE Δ Σ)(δ : OPE Γ Δ)(t : Tm Σ A) → Tmₑ (σ ∘ₑ δ) t ≡ Tmₑ δ (Tmₑ σ t)
Tm-∘ₑ σ δ (var v) = var & ∈-∘ₑ σ δ v
Tm-∘ₑ σ δ (lam t) = lam & Tm-∘ₑ (keep σ) (keep δ) t
Tm-∘ₑ σ δ (app f a) = app & Tm-∘ₑ σ δ f ⊗ Tm-∘ₑ σ δ a
-- Theory of substitution & embedding
--------------------------------------------------------------------------------
infixr 6 _ₑ∘ₛ_ _ₛ∘ₑ_ _∘ₛ_
data Sub (Γ : Con) : Con → Set where
∙ : Sub Γ ∙
_,_ : ∀ {A : Ty}{Δ : Con} → Sub Γ Δ → Tm Γ A → Sub Γ (Δ , A)
_ₛ∘ₑ_ : ∀ {Γ Δ Σ} → Sub Δ Σ → OPE Γ Δ → Sub Γ Σ
∙ ₛ∘ₑ δ = ∙
(σ , t) ₛ∘ₑ δ = σ ₛ∘ₑ δ , Tmₑ δ t
_ₑ∘ₛ_ : ∀ {Γ Δ Σ} → OPE Δ Σ → Sub Γ Δ → Sub Γ Σ
∙ ₑ∘ₛ δ = δ
drop σ ₑ∘ₛ (δ , t) = σ ₑ∘ₛ δ
keep σ ₑ∘ₛ (δ , t) = σ ₑ∘ₛ δ , t
dropₛ : ∀ {A Γ Δ} → Sub Γ Δ → Sub (Γ , A) Δ
dropₛ σ = σ ₛ∘ₑ wk
keepₛ : ∀ {A Γ Δ} → Sub Γ Δ → Sub (Γ , A) (Δ , A)
keepₛ σ = dropₛ σ , var vz
⌜_⌝ᵒᵖᵉ : ∀ {Γ Δ} → OPE Γ Δ → Sub Γ Δ
⌜ ∙ ⌝ᵒᵖᵉ = ∙
⌜ drop σ ⌝ᵒᵖᵉ = dropₛ ⌜ σ ⌝ᵒᵖᵉ
⌜ keep σ ⌝ᵒᵖᵉ = keepₛ ⌜ σ ⌝ᵒᵖᵉ
∈ₛ : ∀ {A Γ Δ} → Sub Γ Δ → A ∈ Δ → Tm Γ A
∈ₛ (σ , t) vz = t
∈ₛ (σ , t)(vs v) = ∈ₛ σ v
Tmₛ : ∀ {A Γ Δ} → Sub Γ Δ → Tm Δ A → Tm Γ A
Tmₛ σ (var v) = ∈ₛ σ v
Tmₛ σ (lam t) = lam (Tmₛ (keepₛ σ) t)
Tmₛ σ (app f a) = app (Tmₛ σ f) (Tmₛ σ a)
idₛ : ∀ {Γ} → Sub Γ Γ
idₛ {∙} = ∙
idₛ {Γ , A} = (idₛ {Γ} ₛ∘ₑ drop idₑ) , var vz
_∘ₛ_ : ∀ {Γ Δ Σ} → Sub Δ Σ → Sub Γ Δ → Sub Γ Σ
∙ ∘ₛ δ = ∙
(σ , t) ∘ₛ δ = σ ∘ₛ δ , Tmₛ δ t
assₛₑₑ :
∀ {Γ Δ Σ Ξ}(σ : Sub Σ Ξ)(δ : OPE Δ Σ)(ν : OPE Γ Δ)
→ (σ ₛ∘ₑ δ) ₛ∘ₑ ν ≡ σ ₛ∘ₑ (δ ∘ₑ ν)
assₛₑₑ ∙ δ ν = refl
assₛₑₑ (σ , t) δ ν = _,_ & assₛₑₑ σ δ ν ⊗ (Tm-∘ₑ δ ν t ⁻¹)
assₑₛₑ :
∀ {Γ Δ Σ Ξ}(σ : OPE Σ Ξ)(δ : Sub Δ Σ)(ν : OPE Γ Δ)
→ (σ ₑ∘ₛ δ) ₛ∘ₑ ν ≡ σ ₑ∘ₛ (δ ₛ∘ₑ ν)
assₑₛₑ ∙ δ ν = refl
assₑₛₑ (drop σ) (δ , t) ν = assₑₛₑ σ δ ν
assₑₛₑ (keep σ) (δ , t) ν = (_, Tmₑ ν t) & assₑₛₑ σ δ ν
idlₑₛ : ∀ {Γ Δ}(σ : Sub Γ Δ) → idₑ ₑ∘ₛ σ ≡ σ
idlₑₛ ∙ = refl
idlₑₛ (σ , t) = (_, t) & idlₑₛ σ
idlₛₑ : ∀ {Γ Δ}(σ : OPE Γ Δ) → idₛ ₛ∘ₑ σ ≡ ⌜ σ ⌝ᵒᵖᵉ
idlₛₑ ∙ = refl
idlₛₑ (drop σ) =
((idₛ ₛ∘ₑ_) ∘ drop) & idrₑ σ ⁻¹
◾ assₛₑₑ idₛ σ wk ⁻¹
◾ dropₛ & idlₛₑ σ
idlₛₑ (keep σ) =
(_, var vz) &
(assₛₑₑ idₛ wk (keep σ)
◾ ((idₛ ₛ∘ₑ_) ∘ drop) & (idlₑ σ ◾ idrₑ σ ⁻¹)
◾ assₛₑₑ idₛ σ wk ⁻¹
◾ (_ₛ∘ₑ wk) & idlₛₑ σ )
idrₑₛ : ∀ {Γ Δ}(σ : OPE Γ Δ) → σ ₑ∘ₛ idₛ ≡ ⌜ σ ⌝ᵒᵖᵉ
idrₑₛ ∙ = refl
idrₑₛ (drop σ) = assₑₛₑ σ idₛ wk ⁻¹ ◾ dropₛ & idrₑₛ σ
idrₑₛ (keep σ) = (_, var vz) & (assₑₛₑ σ idₛ wk ⁻¹ ◾ (_ₛ∘ₑ wk) & idrₑₛ σ)
∈-ₑ∘ₛ : ∀ {A Γ Δ Σ}(σ : OPE Δ Σ)(δ : Sub Γ Δ)(v : A ∈ Σ) → ∈ₛ (σ ₑ∘ₛ δ) v ≡ ∈ₛ δ (∈ₑ σ v)
∈-ₑ∘ₛ ∙ δ v = refl
∈-ₑ∘ₛ (drop σ) (δ , t) v = ∈-ₑ∘ₛ σ δ v
∈-ₑ∘ₛ (keep σ) (δ , t) vz = refl
∈-ₑ∘ₛ (keep σ) (δ , t) (vs v) = ∈-ₑ∘ₛ σ δ v
Tm-ₑ∘ₛ : ∀ {A Γ Δ Σ}(σ : OPE Δ Σ)(δ : Sub Γ Δ)(t : Tm Σ A) → Tmₛ (σ ₑ∘ₛ δ) t ≡ Tmₛ δ (Tmₑ σ t)
Tm-ₑ∘ₛ σ δ (var v) = ∈-ₑ∘ₛ σ δ v
Tm-ₑ∘ₛ σ δ (lam t) =
lam & ((λ x → Tmₛ (x , var vz) t) & assₑₛₑ σ δ wk ◾ Tm-ₑ∘ₛ (keep σ) (keepₛ δ) t)
Tm-ₑ∘ₛ σ δ (app f a) = app & Tm-ₑ∘ₛ σ δ f ⊗ Tm-ₑ∘ₛ σ δ a
∈-ₛ∘ₑ : ∀ {A Γ Δ Σ}(σ : Sub Δ Σ)(δ : OPE Γ Δ)(v : A ∈ Σ) → ∈ₛ (σ ₛ∘ₑ δ) v ≡ Tmₑ δ (∈ₛ σ v)
∈-ₛ∘ₑ (σ , _) δ vz = refl
∈-ₛ∘ₑ (σ , _) δ (vs v) = ∈-ₛ∘ₑ σ δ v
Tm-ₛ∘ₑ : ∀ {A Γ Δ Σ}(σ : Sub Δ Σ)(δ : OPE Γ Δ)(t : Tm Σ A) → Tmₛ (σ ₛ∘ₑ δ) t ≡ Tmₑ δ (Tmₛ σ t)
Tm-ₛ∘ₑ σ δ (var v) = ∈-ₛ∘ₑ σ δ v
Tm-ₛ∘ₑ σ δ (lam t) =
lam &
((λ x → Tmₛ (x , var vz) t) &
(assₛₑₑ σ δ wk
◾ (σ ₛ∘ₑ_) & (drop & (idrₑ δ ◾ idlₑ δ ⁻¹))
◾ assₛₑₑ σ wk (keep δ) ⁻¹)
◾ Tm-ₛ∘ₑ (keepₛ σ) (keep δ) t)
Tm-ₛ∘ₑ σ δ (app f a) = app & Tm-ₛ∘ₑ σ δ f ⊗ Tm-ₛ∘ₑ σ δ a
assₛₑₛ :
∀ {Γ Δ Σ Ξ}(σ : Sub Σ Ξ)(δ : OPE Δ Σ)(ν : Sub Γ Δ)
→ (σ ₛ∘ₑ δ) ∘ₛ ν ≡ σ ∘ₛ (δ ₑ∘ₛ ν)
assₛₑₛ ∙ δ ν = refl
assₛₑₛ (σ , t) δ ν = _,_ & assₛₑₛ σ δ ν ⊗ (Tm-ₑ∘ₛ δ ν t ⁻¹)
assₛₛₑ :
∀ {Γ Δ Σ Ξ}(σ : Sub Σ Ξ)(δ : Sub Δ Σ)(ν : OPE Γ Δ)
→ (σ ∘ₛ δ) ₛ∘ₑ ν ≡ σ ∘ₛ (δ ₛ∘ₑ ν)
assₛₛₑ ∙ δ ν = refl
assₛₛₑ (σ , t) δ ν = _,_ & assₛₛₑ σ δ ν ⊗ (Tm-ₛ∘ₑ δ ν t ⁻¹)
∈-idₛ : ∀ {A Γ}(v : A ∈ Γ) → ∈ₛ idₛ v ≡ var v
∈-idₛ vz = refl
∈-idₛ (vs v) = ∈-ₛ∘ₑ idₛ wk v ◾ Tmₑ wk & ∈-idₛ v ◾ (var ∘ vs) & ∈-idₑ v
∈-∘ₛ : ∀ {A Γ Δ Σ}(σ : Sub Δ Σ)(δ : Sub Γ Δ)(v : A ∈ Σ) → ∈ₛ (σ ∘ₛ δ) v ≡ Tmₛ δ (∈ₛ σ v)
∈-∘ₛ (σ , _) δ vz = refl
∈-∘ₛ (σ , _) δ (vs v) = ∈-∘ₛ σ δ v
Tm-idₛ : ∀ {A Γ}(t : Tm Γ A) → Tmₛ idₛ t ≡ t
Tm-idₛ (var v) = ∈-idₛ v
Tm-idₛ (lam t) = lam & Tm-idₛ t
Tm-idₛ (app f a) = app & Tm-idₛ f ⊗ Tm-idₛ a
Tm-∘ₛ : ∀ {A Γ Δ Σ}(σ : Sub Δ Σ)(δ : Sub Γ Δ)(t : Tm Σ A) → Tmₛ (σ ∘ₛ δ) t ≡ Tmₛ δ (Tmₛ σ t)
Tm-∘ₛ σ δ (var v) = ∈-∘ₛ σ δ v
Tm-∘ₛ σ δ (lam t) =
lam &
((λ x → Tmₛ (x , var vz) t) &
(assₛₛₑ σ δ wk
◾ (σ ∘ₛ_) & (idlₑₛ (dropₛ δ) ⁻¹) ◾ assₛₑₛ σ wk (keepₛ δ) ⁻¹)
◾ Tm-∘ₛ (keepₛ σ) (keepₛ δ) t)
Tm-∘ₛ σ δ (app f a) = app & Tm-∘ₛ σ δ f ⊗ Tm-∘ₛ σ δ a
idrₛ : ∀ {Γ Δ}(σ : Sub Γ Δ) → σ ∘ₛ idₛ ≡ σ
idrₛ ∙ = refl
idrₛ (σ , t) = _,_ & idrₛ σ ⊗ Tm-idₛ t
idlₛ : ∀ {Γ Δ}(σ : Sub Γ Δ) → idₛ ∘ₛ σ ≡ σ
idlₛ ∙ = refl
idlₛ (σ , t) = (_, t) & (assₛₑₛ idₛ wk (σ , t) ◾ (idₛ ∘ₛ_) & idlₑₛ σ ◾ idlₛ σ)
-- Reduction
--------------------------------------------------------------------------------
data _~>_ {Γ} : ∀ {A} → Tm Γ A → Tm Γ A → Set where
β : ∀ {A B}(t : Tm (Γ , A) B) t' → app (lam t) t' ~> Tmₛ (idₛ , t') t
lam : ∀ {A B}{t t' : Tm (Γ , A) B} → t ~> t' → lam t ~> lam t'
app₁ : ∀ {A B}{f}{f' : Tm Γ (A ⇒ B)}{a} → f ~> f' → app f a ~> app f' a
app₂ : ∀ {A B}{f : Tm Γ (A ⇒ B)} {a a'} → a ~> a' → app f a ~> app f a'
infix 3 _~>_
~>ₛ : ∀ {Γ Δ A}{t t' : Tm Γ A}(σ : Sub Δ Γ) → t ~> t' → Tmₛ σ t ~> Tmₛ σ t'
~>ₛ σ (β t t') =
coe ((app (lam (Tmₛ (keepₛ σ) t)) (Tmₛ σ t') ~>_) &
(Tm-∘ₛ (keepₛ σ) (idₛ , Tmₛ σ t') t ⁻¹
◾ (λ x → Tmₛ (x , Tmₛ σ t') t) &
(assₛₑₛ σ wk (idₛ , Tmₛ σ t')
◾ ((σ ∘ₛ_) & idlₑₛ idₛ ◾ idrₛ σ) ◾ idlₛ σ ⁻¹)
◾ Tm-∘ₛ (idₛ , t') σ t))
(β (Tmₛ (keepₛ σ) t) (Tmₛ σ t'))
~>ₛ σ (lam step) = lam (~>ₛ (keepₛ σ) step)
~>ₛ σ (app₁ step) = app₁ (~>ₛ σ step)
~>ₛ σ (app₂ step) = app₂ (~>ₛ σ step)
~>ₑ : ∀ {Γ Δ A}{t t' : Tm Γ A}(σ : OPE Δ Γ) → t ~> t' → Tmₑ σ t ~> Tmₑ σ t'
~>ₑ σ (β t t') =
coe ((app (lam (Tmₑ (keep σ) t)) (Tmₑ σ t') ~>_)
& (Tm-ₑ∘ₛ (keep σ) (idₛ , Tmₑ σ t') t ⁻¹
◾ (λ x → Tmₛ (x , Tmₑ σ t') t) & (idrₑₛ σ ◾ idlₛₑ σ ⁻¹)
◾ Tm-ₛ∘ₑ (idₛ , t') σ t))
(β (Tmₑ (keep σ) t) (Tmₑ σ t'))
~>ₑ σ (lam step) = lam (~>ₑ (keep σ) step)
~>ₑ σ (app₁ step) = app₁ (~>ₑ σ step)
~>ₑ σ (app₂ step) = app₂ (~>ₑ σ step)
Tmₑ~> :
∀ {Γ Δ A}{t : Tm Γ A}{σ : OPE Δ Γ}{t'}
→ Tmₑ σ t ~> t' → ∃ λ t'' → (t ~> t'') × (Tmₑ σ t'' ≡ t')
Tmₑ~> {t = var x} ()
Tmₑ~> {t = lam t} (lam step) with Tmₑ~> step
... | t'' , (p , refl) = lam t'' , lam p , refl
Tmₑ~> {t = app (var v) a} (app₁ ())
Tmₑ~> {t = app (var v) a} (app₂ step) with Tmₑ~> step
... | t'' , (p , refl) = app (var v) t'' , app₂ p , refl
Tmₑ~> {t = app (lam f) a} {σ} (β _ _) =
Tmₛ (idₛ , a) f , β _ _ ,
Tm-ₛ∘ₑ (idₛ , a) σ f ⁻¹
◾ (λ x → Tmₛ (x , Tmₑ σ a) f) & (idlₛₑ σ ◾ idrₑₛ σ ⁻¹)
◾ Tm-ₑ∘ₛ (keep σ) (idₛ , Tmₑ σ a) f
Tmₑ~> {t = app (lam f) a} (app₁ (lam step)) with Tmₑ~> step
... | t'' , (p , refl) = app (lam t'') a , app₁ (lam p) , refl
Tmₑ~> {t = app (lam f) a} (app₂ step) with Tmₑ~> step
... | t'' , (p , refl) = app (lam f) t'' , app₂ p , refl
Tmₑ~> {t = app (app f a) a'} (app₁ step) with Tmₑ~> step
... | t'' , (p , refl) = app t'' a' , app₁ p , refl
Tmₑ~> {t = app (app f a) a''} (app₂ step) with Tmₑ~> step
... | t'' , (p , refl) = app (app f a) t'' , app₂ p , refl
-- Strong normalization/neutrality definition
--------------------------------------------------------------------------------
data SN {Γ A} (t : Tm Γ A) : Set where
sn : (∀ {t'} → t ~> t' → SN t') → SN t
SNₑ→ : ∀ {Γ Δ A}{t : Tm Γ A}(σ : OPE Δ Γ) → SN t → SN (Tmₑ σ t)
SNₑ→ σ (sn s) = sn λ {t'} step →
let (t'' , (p , q)) = Tmₑ~> step in coe (SN & q) (SNₑ→ σ (s p))
SNₑ← : ∀ {Γ Δ A}{t : Tm Γ A}(σ : OPE Δ Γ) → SN (Tmₑ σ t) → SN t
SNₑ← σ (sn s) = sn λ step → SNₑ← σ (s (~>ₑ σ step))
SN-app₁ : ∀ {Γ A B}{f : Tm Γ (A ⇒ B)}{a} → SN (app f a) → SN f
SN-app₁ (sn s) = sn λ f~>f' → SN-app₁ (s (app₁ f~>f'))
neu : ∀ {Γ A} → Tm Γ A → Set
neu (lam _) = ⊥
neu _ = ⊤
neuₑ : ∀ {Γ Δ A}(σ : OPE Δ Γ)(t : Tm Γ A) → neu t → neu (Tmₑ σ t)
neuₑ σ (lam t) nt = nt
neuₑ σ (var v) nt = tt
neuₑ σ (app f a) nt = tt
-- The actual proof, by Kripke logical predicate
--------------------------------------------------------------------------------
Tmᴾ : ∀ {Γ A} → Tm Γ A → Set
Tmᴾ {Γ}{ι} t = SN t
Tmᴾ {Γ}{A ⇒ B} t = ∀ {Δ}(σ : OPE Δ Γ){a} → Tmᴾ a → Tmᴾ (app (Tmₑ σ t) a)
data Subᴾ {Γ} : ∀ {Δ} → Sub Γ Δ → Set where
∙ : Subᴾ ∙
_,_ : ∀ {A Δ}{σ : Sub Γ Δ}{t : Tm Γ A}(σᴾ : Subᴾ σ)(tᴾ : Tmᴾ t) → Subᴾ (σ , t)
Tmᴾₑ : ∀ {Γ Δ A}{t : Tm Γ A}(σ : OPE Δ Γ) → Tmᴾ t → Tmᴾ (Tmₑ σ t)
Tmᴾₑ {A = ι} σ tᴾ = SNₑ→ σ tᴾ
Tmᴾₑ {A = A ⇒ B}{t} σ tᴾ δ aᴾ rewrite Tm-∘ₑ σ δ t ⁻¹ = tᴾ (σ ∘ₑ δ) aᴾ
Subᴾₑ : ∀ {Γ Δ Σ}{σ : Sub Δ Σ}(δ : OPE Γ Δ) → Subᴾ σ → Subᴾ (σ ₛ∘ₑ δ)
Subᴾₑ σ ∙ = ∙
Subᴾₑ σ (δ , tᴾ) = Subᴾₑ σ δ , Tmᴾₑ σ tᴾ
~>ᴾ : ∀ {Γ A}{t t' : Tm Γ A} → t ~> t' → Tmᴾ t → Tmᴾ t'
~>ᴾ {A = ι} t~>t' (sn tˢⁿ) = tˢⁿ t~>t'
~>ᴾ {A = A ⇒ B} t~>t' tᴾ = λ σ aᴾ → ~>ᴾ (app₁ (~>ₑ σ t~>t')) (tᴾ σ aᴾ)
mutual
-- quote
qᴾ : ∀ {Γ A}{t : Tm Γ A} → Tmᴾ t → SN t
qᴾ {A = ι} tᴾ = tᴾ
qᴾ {A = A ⇒ B} tᴾ = SNₑ← wk $ SN-app₁ (qᴾ $ tᴾ wk (uᴾ (var vz) (λ ())))
-- unquote
uᴾ : ∀ {Γ A}(t : Tm Γ A){nt : neu t} → (∀ {t'} → t ~> t' → Tmᴾ t') → Tmᴾ t
uᴾ {Γ} {A = ι} t f = sn f
uᴾ {Γ} {A ⇒ B} t {nt} f {Δ} σ {a} aᴾ =
uᴾ (app (Tmₑ σ t) a) (go (Tmₑ σ t) (neuₑ σ t nt) f' a aᴾ (qᴾ aᴾ))
where
f' : ∀ {t'} → Tmₑ σ t ~> t' → Tmᴾ t'
f' step δ aᴾ with Tmₑ~> step
... | t'' , step' , refl rewrite Tm-∘ₑ σ δ t'' ⁻¹ = f step' (σ ∘ₑ δ) aᴾ
go :
∀ {Γ A B}(t : Tm Γ (A ⇒ B)) → neu t → (∀ {t'} → t ~> t' → Tmᴾ t')
→ ∀ a → Tmᴾ a → SN a → ∀ {t'} → app t a ~> t' → Tmᴾ t'
go _ () _ _ _ _ (β _ _)
go t nt f a aᴾ sna (app₁ {f' = f'} step) =
coe ((λ x → Tmᴾ (app x a)) & Tm-idₑ f') (f step idₑ aᴾ)
go t nt f a aᴾ (sn aˢⁿ) (app₂ {a' = a'} step) =
uᴾ (app t a') (go t nt f a' (~>ᴾ step aᴾ) (aˢⁿ step))
fundThm-∈ : ∀ {Γ A}(v : A ∈ Γ) → ∀ {Δ}{σ : Sub Δ Γ} → Subᴾ σ → Tmᴾ (∈ₛ σ v)
fundThm-∈ vz (σᴾ , tᴾ) = tᴾ
fundThm-∈ (vs v) (σᴾ , tᴾ) = fundThm-∈ v σᴾ
fundThm-lam :
∀ {Γ A B}
(t : Tm (Γ , A) B)
→ SN t
→ (∀ {a} → Tmᴾ a → Tmᴾ (Tmₛ (idₛ , a) t))
→ ∀ a → SN a → Tmᴾ a → Tmᴾ (app (lam t) a)
fundThm-lam {Γ} t (sn tˢⁿ) hyp a (sn aˢⁿ) aᴾ = uᴾ (app (lam t) a)
λ {(β _ _) → hyp aᴾ;
(app₁ (lam {t' = t'} t~>t')) →
fundThm-lam t' (tˢⁿ t~>t') (λ aᴾ → ~>ᴾ (~>ₛ _ t~>t') (hyp aᴾ)) a (sn aˢⁿ) aᴾ;
(app₂ a~>a') →
fundThm-lam t (sn tˢⁿ) hyp _ (aˢⁿ a~>a') (~>ᴾ a~>a' aᴾ)}
fundThm : ∀ {Γ A}(t : Tm Γ A) → ∀ {Δ}{σ : Sub Δ Γ} → Subᴾ σ → Tmᴾ (Tmₛ σ t)
fundThm (var v) σᴾ = fundThm-∈ v σᴾ
fundThm (lam {A} t) {σ = σ} σᴾ δ {a} aᴾ
rewrite Tm-ₛ∘ₑ (keepₛ σ) (keep δ) t ⁻¹ | assₛₑₑ σ (wk {A}) (keep δ) | idlₑ δ
= fundThm-lam
(Tmₛ (σ ₛ∘ₑ drop δ , var vz) t)
(qᴾ (fundThm t (Subᴾₑ (drop δ) σᴾ , uᴾ (var vz) (λ ()))))
(λ aᴾ → coe (Tmᴾ & sub-sub-lem) (fundThm t (Subᴾₑ δ σᴾ , aᴾ)))
a (qᴾ aᴾ) aᴾ
where
sub-sub-lem : ∀ {a} → Tmₛ (σ ₛ∘ₑ δ , a) t ≡ Tmₛ (idₛ , a) (Tmₛ (σ ₛ∘ₑ drop δ , var vz) t)
sub-sub-lem {a} =
(λ x → Tmₛ (x , a) t) &
(idrₛ (σ ₛ∘ₑ δ) ⁻¹ ◾ assₛₑₛ σ δ idₛ ◾ assₛₑₛ σ (drop δ) (idₛ , a) ⁻¹)
◾ Tm-∘ₛ (σ ₛ∘ₑ drop δ , var vz) (idₛ , a) t
fundThm (app f a) {σ = σ} σᴾ
rewrite Tm-idₑ (Tmₛ σ f) ⁻¹
= fundThm f σᴾ idₑ (fundThm a σᴾ)
idₛᴾ : ∀ {Γ} → Subᴾ (idₛ {Γ})
idₛᴾ {∙} = ∙
idₛᴾ {Γ , A} = Subᴾₑ wk idₛᴾ , uᴾ (var vz) (λ ())
strongNorm : ∀ {Γ A}(t : Tm Γ A) → SN t
strongNorm t = qᴾ (coe (Tmᴾ & Tm-idₛ t) (fundThm t idₛᴾ))
|
Require Export Arith. (* to use ring for natural numbers *)
Require Export Ltac.
Require Export Numbers_facts.
Lemma Zmult_lt_reg_l: forall n m p : Z, (0 < p)%Z -> (p * n < p * m)%Z -> (n < m)%Z.
Proof.
intros.
rewrite (Zmult_comm p n) in *.
rewrite (Zmult_comm p m) in *.
eapply Zmult_lt_reg_r; eassumption.
Qed.
(** *************************************************************************************************************)
(** Laugwitz-Schmieden *)
(** *************************************************************************************************************)
Module LS <: Num_facts.
Definition A :=nat->Z.
(** Operations **)
Definition a0 : A := fun (n:nat) => 0%Z.
Definition a1: A := fun (n:nat) => 1%Z.
Definition plusA (u v:A) : A := fun (n:nat) => Zplus (u n) (v n).
Definition oppA (u:A) : A := fun (n:nat) => Z.opp (u n).
Definition minusA x y := plusA x (oppA y).
Definition multA (u v:A) : A := fun (n:nat) => Zmult (u n) (v n).
Definition divA (u v:A) : A := fun (n:nat) => Z.div (u n) (v n).
Definition modA (u v:A) : A := fun (n:nat) => Z.modulo (u n) (v n).
Definition absA (u:A) : A := fun (n:nat) => Z.abs (u n).
Notation "x + y " := (plusA x y).
Notation "x * y " := (multA x y).
Notation "x / y " := (divA x y).
Notation "x mod% y" := (modA x y) (at level 60).
Notation "0" := (a0).
Notation "1" := (a1).
Notation "- x" := (oppA x).
Notation "| x |" := (absA x) (at level 60).
(** Relations **)
Definition equalA (u v:A) :=
exists N:nat, forall n:nat, n>N -> (u n)=(v n).
Notation "x =A y" := (equalA x y) (at level 80).
Definition leA (u v:A) :=
exists N:nat, forall n:nat, n>N -> Z.le (u n) (v n).
Definition ltA (u v:A) :=
exists N:nat, forall n:nat, n>N -> Z.lt (u n) (v n).
Notation "x <=A y" := (leA x y) (at level 50).
Notation "x <A y" := (ltA x y) (at level 50).
Definition std (u:A) := exists N:nat, forall n m, n>N -> m>N -> (u n)=(u m).
Definition non_std (u:A) := ~std u.
Definition lim (a:A) := exists p, std p /\ leA a0 p /\ ltA (absA a) p.
(** Tactics **)
Ltac gen_eq n0 := (match goal with |[ H : forall n:nat, n > ?X -> _ |- _ ] =>
let myH:=fresh "Hyp" in assert (myH:(n0 > X)) by (unfold sum_plus1 in *;omega); generalize (H n0 myH); clear H; intro end).
Ltac gen_props :=
match goal with
[|- forall n:nat, _ ] => let id:= fresh "p" in let Hid := fresh "Hp" in (intros id Hid; repeat (gen_eq id))
| [|- False] => let l:= collect_nats in repeat (gen_eq (sum_plus1 l))
end .
Ltac unfold_intros := unfold lim, std, leA, ltA, equalA, absA, minusA, multA, plusA, divA, modA, oppA, A, a0, a1; intros.
Ltac solve_ls_w_l x :=
unfold_intros;
destruct_exists;
let l:= collect_nats in exists (sum_plus1 l); simpl;
gen_props;
(apply x|| eapply x); solve [eassumption | omega].
Ltac autorew_aux :=
match goal with [H:(_=_)%Z |- _ ] => rewrite <- H end.
Ltac autorew := repeat autorew_aux.
Ltac solve_ls :=
(unfold_intros;
solve [ intros; solve [omega | ring] |
destruct_exists; try gen_props; intros; omega |
destruct_exists; let l:= collect_nats in exists (sum_plus1 l); intros; ring |
destruct_exists; let l:= collect_nats in exists (sum_plus1 l); simpl; gen_props; autorew; solve [assumption | omega | ring]]).
(*** Equality **)
Lemma equalA_refl : forall x, x =A x.
Proof.
solve_ls.
Qed.
Lemma equalA_sym : forall x y, x =A y -> y =A x.
Proof.
solve_ls.
Qed.
Lemma equalA_trans : forall x y z, x =A y -> y =A z -> x=A z.
Proof.
solve_ls.
Qed.
Instance equalA_equiv : Equivalence equalA.
Proof.
split; red; [apply equalA_refl | apply equalA_sym | apply equalA_trans ].
Qed.
(** Morphisms **)
Instance plusA_morphism : Proper (equalA ==> equalA ==> equalA) plusA.
Proof.
repeat red; solve_ls.
Qed.
Instance oppA_morphism : Proper (equalA ==> equalA) oppA.
Proof.
repeat red; solve_ls.
Qed.
Instance multA_morphism : Proper (equalA ==> equalA ==> equalA) multA.
Proof.
repeat red; solve_ls.
Qed.
Instance absA_morphism : Proper (equalA ==> equalA) absA.
Proof.
repeat red; solve_ls.
Qed.
Instance leA_morphism : Proper (equalA ==> equalA ==> Logic.iff) leA.
Proof.
repeat red; unfold_intros; split; solve_ls.
Qed.
Instance ltA_morphism : Proper (equalA ==> equalA ==> Logic.iff) ltA.
Proof.
repeat red; unfold_intros; split; solve_ls.
Qed.
Instance divA_morphism : Proper (equalA ==> equalA ==> equalA) divA.
Proof.
repeat red; solve_ls.
Qed.
Instance modA_morphism : Proper (equalA ==> equalA ==> equalA) modA.
Proof.
repeat red; unfold_intros; solve_ls.
Qed.
(** Implementation of axioms of Numbers.v and Numbers_facts.v **)
(** Ring properties **)
Lemma plus_neutral : forall x:A,0 + x =A x.
Proof.
solve_ls.
Qed.
Lemma plus_comm : forall x y, x + y =A y + x.
Proof.
solve_ls.
Qed.
Lemma plus_assoc : forall x y z, x + (y + z) =A (x + y) + z.
Proof.
solve_ls.
Qed.
Lemma plus_opp : forall x:A, x + (- x) =A a0.
Proof.
solve_ls.
Qed.
Lemma mult_neutral : forall x, a1 * x =A x.
Proof.
solve_ls.
Qed.
Lemma mult_comm : forall x y, x * y =A y * x.
Proof.
solve_ls.
Qed.
Lemma mult_assoc : forall x y z, x * (y * z) =A (x * y) * z.
Proof.
solve_ls.
Qed.
Lemma mult_absorb : forall x, x * a0 =A a0.
Proof.
solve_ls.
Qed.
Lemma mult_distr_l : forall x y z, (x+y)*z =A x*z + y*z.
Proof.
solve_ls.
Qed.
Definition Radd_0_l := plus_neutral.
Definition Radd_comm := plus_comm.
Definition Radd_assoc :=plus_assoc.
Definition Rmul_1_l :=mult_neutral.
Definition Rmul_comm :=mult_comm.
Definition Rmul_assoc := mult_assoc.
Definition Rdistr_l := mult_distr_l.
Lemma Rsub_def : forall x y : A, (minusA x y) =A (plusA x (oppA y)).
Proof.
intros; unfold minusA; apply equalA_refl.
Qed.
Definition Ropp_def := plus_opp.
Lemma stdlib_ring_theory : ring_theory a0 a1 plusA multA minusA oppA equalA.
Proof.
constructor.
exact Radd_0_l.
exact Radd_comm.
exact Radd_assoc.
exact Rmul_1_l.
exact Rmul_comm.
exact Rmul_assoc.
exact Rdistr_l.
exact Rsub_def.
exact Ropp_def.
Qed.
Add Ring A_ring : stdlib_ring_theory (abstract).
Lemma mult_distr_r : forall x y z, x*(y+z) =A x*y + x*z.
Proof.
intros; ring.
Qed.
(** absA **)
Lemma abs_pos : forall x, a0 <=A |x|.
Proof.
unfold_intros.
exists 0%nat.
intros; simpl.
assert ((x n)<>0\/x n=0)%Z by omega.
destruct H0.
assert (0 < Z.abs (x n))%Z by (apply Z.abs_pos; assumption).
omega.
rewrite H0; simpl; omega.
Qed.
Lemma abs_pos_val : forall x, a0<=A x -> |x|=A x.
Proof.
solve_ls_w_l Z.abs_eq.
Qed.
Lemma abs_neg_val : forall x, x<=A a0 -> |x|=A -x.
Proof.
solve_ls_w_l Z.abs_neq.
Qed.
Lemma abs_new : forall x a, x<=A a -> -x <=A a -> |x|<=A a.
Proof.
unfold_intros; destruct_exists.
let l := collect_nats in exists (sum_plus1 l).
gen_props.
assert (Hom:(x p<0)%Z\/(x p>=0)%Z)by omega.
elim Hom; clear Hom; intros Hom'.
rewrite Z.abs_neq.
assumption.
omega.
rewrite Z.abs_eq.
assumption.
omega.
Qed.
Lemma abs_new2 : forall x a, |x|<=A a -> -a <=A x .
Proof.
unfold_intros; destruct_exists.
let l := collect_nats in exists (sum_plus1 l).
gen_props.
assert (Hom:(x p<0)%Z\/(x p>=0)%Z)by omega.
elim Hom; clear Hom; intros Hom'.
rewrite Z.abs_neq in *.
omega.
omega.
rewrite Z.abs_eq in *.
omega.
omega.
Qed.
Lemma abs_triang : forall x y, |x+y| <=A |x| + | y |.
Proof.
solve_ls_w_l Z.abs_triangle.
Qed.
Lemma abs_prod : forall x y, |x * y| =A |x| * |y|.
Proof.
solve_ls_w_l Z.abs_mul.
Qed.
Lemma div_mod : forall a b, 0<A a\/a<A 0 -> b =A a*(b / a) + (b mod% a).
Proof.
intros; destruct H.
revert a b H.
solve_ls_w_l Z_div_mod_eq_full.
revert a b H.
solve_ls_w_l Z_div_mod_eq_full.
Qed.
Lemma div_mod2 : forall a b, 0<A a\/a<A 0 -> a*(b/a) =A b + - (b mod% a).
Proof.
intros a b H; generalize (div_mod a b H).
revert a b H.
solve_ls.
Qed.
Lemma div_mod3a : forall a b, 0 <A a -> (b mod% a) <A a.
Proof.
solve_ls_w_l Z_mod_lt.
Qed.
Lemma div_mod3b : forall a b, 0 <A a -> 0 <=A (b mod% a).
Proof.
solve_ls_w_l Z_mod_lt.
Qed.
Lemma div_mod3 : forall a b, 0<A a -> |(b mod% a)| <A a.
Proof.
intros.
rewrite abs_pos_val.
apply div_mod3a.
assumption.
apply div_mod3b.
assumption.
Qed.
Lemma lt_le : forall x y, (x <A y) -> (x <=A y).
Proof.
solve_ls.
Qed.
Lemma div_mod3_abs: forall a b:A, 0<A b \/ b<A 0 -> | a mod% b | <=A |b|.
Proof.
intros; destruct H.
rewrite (abs_pos_val b).
apply lt_le; apply div_mod3.
assumption.
apply lt_le; assumption.
revert a b H.
unfold_intros.
destruct H; destruct_exists.
exists (x+1)%nat.
gen_props.
rewrite (Z.abs_neq (b p)).
generalize (Z_mod_neg (a p) (b p) H); intros H'; destruct H'.
rewrite Z.abs_neq.
omega.
assumption.
omega.
Qed.
Lemma div_le : forall a b c, 0 <A c -> a <=A b -> a / c <=A b / c.
Proof.
solve_ls_w_l Z_div_le.
Qed.
Lemma div_pos : forall a b, 0 <=A a -> 0 <A b -> 0 <=A a/b.
Proof.
solve_ls_w_l Z_div_pos.
Qed.
Lemma bingo : forall x y:Z, (x<y -> x<>y)%Z.
Proof.
unfold_intros.
omega.
Qed.
Lemma bingo2 : forall x y:Z, (x>y -> x<>y)%Z.
Proof.
unfold_intros.
omega.
Qed.
Lemma div_idg : forall x y, a0 <A y -> (x * y) / y =A x.
Proof.
unfold_intros.
destruct_exists.
let l:=collect_nats in exists (sum_plus1 l).
gen_props.
apply Z_div_mult_full.
apply bingo2.
omega.
Qed.
Lemma mult_le : forall a b c d,
a0 <=A a -> a <=A b -> a0 <=A c -> c <=A d -> a*c <=A b * d.
Proof.
solve_ls_w_l Zmult_le_compat.
Qed.
Lemma le_refl : forall x, x <=A x.
Proof.
solve_ls.
Qed.
Lemma le_trans : forall x y z, x <=A y -> y <=A z -> x <=A z .
Proof.
solve_ls.
Qed.
Lemma lt_plus : forall x y z t, x <A y -> z <A t -> (x + z) <A (y + t).
Proof.
solve_ls.
Qed.
Lemma mult_pos : forall x y : A, 0<A x -> 0<A y -> 0<A x*y.
Proof.
solve_ls_w_l Z.mul_pos_pos.
Qed.
Lemma lt_plus_inv : forall x y z, (x + z) <A (y + z) -> x <A y .
Proof.
solve_ls.
Qed.
Lemma le_plus : forall x y z t, x <=A y -> z <=A t -> (x + z) <=A (y + t).
Proof.
solve_ls.
Qed.
Lemma le_lt_plus : forall x y z t, x <=A y -> z <A t -> (x + z) <A (y + t).
Proof.
solve_ls.
Qed.
Lemma le_plus_inv : forall x y z, (x + z) <=A (y + z) -> x <=A y .
Proof.
solve_ls.
Qed.
Lemma le_mult_simpl : forall x y z , (a0 <=A z) -> (x <=A y)-> (x * z) <=A (y *z).
Proof.
solve_ls_w_l Zmult_le_compat_r.
Qed.
Lemma le_mult : forall x y z, a0 <=A x -> y <=A z -> x*y <=A x*z.
Proof.
solve_ls_w_l Zmult_le_compat_l.
Qed.
Lemma lt_mult_inv : forall x y z, a0 <A x -> (x * y) <A (x * z) -> y <A z .
Proof.
solve_ls_w_l Zmult_lt_reg_l.
Qed.
Lemma Zlt_mult_inv2 : forall x y z:Z, (x < 0 -> (x * y) < (x * z) -> z < y)%Z .
Proof.
intros.
apply Zmult_lt_reg_l with (- x)%Z.
omega.
apply Zplus_lt_reg_l with (x* z + x*y)%Z.
ring_simplify.
assumption.
Qed.
Lemma lt_mult_inv2 : forall x y z, x <A 0 -> (x * y) <A (x * z) -> z <A y .
Proof.
solve_ls_w_l Zlt_mult_inv2.
Qed.
Lemma Zle_mult_inv2 : forall x y z:Z, (x < 0 -> (x * y) <= (x * z) -> z <= y)%Z.
Proof.
intros.
apply Zmult_le_reg_r with (-x)%Z.
omega.
ring_simplify.
eapply Zplus_le_reg_l with (x*y + z*x)%Z.
ring_simplify.
apply H0.
Qed.
Lemma le_mult_inv2 : forall x y z, x <A 0 -> (x * y) <=A (x * z) -> z <=A y .
Proof.
solve_ls_w_l Zle_mult_inv2.
Qed.
Lemma lt_mult : forall x y z, 0 <A x -> y <A z -> x*y <A x*z.
Proof.
solve_ls_w_l Zmult_lt_compat_l.
Qed.
Lemma Zle_mult_inv : forall x y z:Z, (0 < x)%Z -> (x * y <= x * z)%Z -> (y <= z)%Z.
Proof.
intros.
eapply Zmult_lt_0_le_reg_r.
eassumption.
rewrite (Zmult_comm y x).
rewrite (Zmult_comm z x).
eassumption.
Qed.
Lemma le_mult_inv : forall x y z, a0 <A x -> (x * y) <=A (x * z) -> y <=A z .
Proof.
solve_ls_w_l Zle_mult_inv.
Qed.
Lemma le_mult_general :
forall x y z t, 0 <=A x -> x <=A y -> 0 <=A z -> z <=A t -> x*z <=A y*t.
Proof.
solve_ls_w_l Zmult_le_compat.
Qed.
Lemma le_mult_neg : forall x y z, x <A 0 -> y <=A z -> x*z <=A x*y.
Proof.
solve_ls_w_l Z.mul_le_mono_neg_l.
Qed.
Lemma lt_0_1 : (a0 <A a1).
Proof.
solve_ls.
Qed.
Lemma lt_m1_0 : (-a1 <A 0).
Proof.
solve_ls.
Qed.
Lemma lt_trans : forall x y z, x <A y -> y <A z -> x <A z .
Proof.
solve_ls.
Qed.
Lemma le_lt_trans : forall x y z, x <=A y -> y <A z -> x <A z .
Proof.
solve_ls.
Qed.
Lemma lt_le_trans : forall x y z, x <A y -> y <=A z -> x <A z .
Proof.
solve_ls.
Qed.
Lemma lt_le_2 : forall x y, (x <A y) -> (x+1 <=A y).
Proof.
solve_ls.
Qed.
Lemma Znot_le_lt : forall x y:Z, ~(x <= y)%Z -> (y < x)%Z.
Proof.
intros; omega.
Qed.
Lemma abs_minus : forall x, | - x| =A |x|.
Proof.
solve_ls_w_l Z.abs_opp.
Qed.
Lemma abs_max : forall x, x <=A |x|.
Proof.
unfold_intros.
destruct_exists.
exists 0%nat.
intros.
rewrite Z.abs_max.
assert (H':((x n)<= -(x n) \/ (x n) >= - (x n))%Z) by omega.
destruct H'.
rewrite Zmax_right.
omega.
omega.
rewrite Zmax_left.
omega.
omega.
Qed.
Lemma le_id : forall x y, x <=A y -> y <=A x -> x =A y.
Proof.
solve_ls.
Qed.
Lemma not_lt_0_0 : ~a0 <A a0.
Proof.
unfold_intros.
intro H; destruct H.
assert (0<0)%Z.
apply (H (x+1)%nat).
omega.
omega.
Qed.
Lemma contradict_lt_le : forall s x, s <A x -> x <=A s -> False.
Proof.
solve_ls.
Qed.
Lemma le_lt_False : forall x y, x <=A y -> y <A x -> False.
Proof.
solve_ls.
Qed.
Lemma div_le2 : forall a b, 0 <A a -> 0<=A b -> a*(b/a) <=A b.
Proof.
intros.
rewrite div_mod2.
setoid_replace b with (b+0) at 3 by ring.
apply le_plus.
apply le_refl.
apply le_plus_inv with (b mod%a).
ring_simplify.
apply div_mod3b.
assumption.
left.
assumption.
Qed.
(** properties of lim **)
Lemma ANS1 : lim a1.
Proof.
unfold lim.
exists (fun (n:nat) => 2%Z).
split.
unfold std.
exists 0%nat.
intros; trivial.
split.
unfold leA, ltA, a0; simpl.
exists 0%nat.
intros; solve [auto with zarith].
rewrite abs_pos_val.
unfold ltA, a1; intros.
exists 0%nat.
intros; simpl; omega.
unfold leA; intros.
exists 0%nat.
unfold a0, a1.
intros; simpl; omega.
Qed.
Lemma ANS2a : forall x y, lim x -> lim y -> lim (x + y).
Proof.
intros x y Hx Hy.
elim Hx.
intros pp (Hstdpp, (Hle0pp,Habspp)).
elim Hy.
intros qq (Hstdqq, (Hle0qq,Habsqq)).
unfold lim.
unfold absA,ltA,a0 in *.
elim Habspp.
intros a Ha.
elim Habsqq.
intros b Hb.
elim Hle0pp.
intros r Hr.
elim Hle0qq.
intros s Hs.
elim Hstdpp.
intros ep Hep.
elim Hstdqq.
intros eq Heq.
exists (fun (n:nat) => (Zplus (pp (a+r+ep+1)%nat) (qq (b+s+eq+1)%nat))).
split.
unfold std.
exists (0)%nat.
intros; trivial.
split.
unfold leA, a0.
exists (plus a (plus b (plus r s)))%nat.
intros.
assert (Z.le 0 (pp (a+r+ep+1)%nat)).
apply Hr.
omega.
assert (Z.le 0 (qq (b+s+eq+1)%nat)).
apply Hs.
omega.
omega.
unfold plusA.
exists (plus ep (plus eq (plus a b)))%nat.
intros.
apply Z.le_lt_trans with (m:=Zplus (Z.abs (x n)) (Z.abs (y n))).
apply Z.abs_triangle.
assert (forall a b c d:Z, Z.lt a b -> Z.lt c d -> Z.lt (Zplus a c) (Zplus b d)).
intros; omega.
apply H0.
replace (pp (a + r + ep + 1)%nat) with (pp n).
apply Ha.
omega.
apply Hep.
omega.
omega.
replace (qq (b + s + eq + 1)%nat) with (qq n).
apply Hb.
omega.
apply Heq.
omega.
omega.
Qed.
Lemma ANS2b : forall x y, lim x -> lim y -> lim (x * y).
Proof.
intros x y Hx Hy.
elim Hx.
intros pp (Hstdpp, (Hle0pp,Habspp)).
elim Hy.
intros qq (Hstdqq, (Hle0qq,Habsqq)).
unfold lim.
unfold absA,ltA,a0 in *.
elim Habspp.
intros a Ha.
elim Habsqq.
intros b Hb.
elim Hle0pp.
intros r Hr.
elim Hle0qq.
intros s Hs.
elim Hstdpp.
intros ep Hep.
elim Hstdqq.
intros eq Heq.
exists (fun (n:nat) => (Zmult (Z.abs (pp (a+r+ep+1)%nat)+1%Z) (Z.abs (qq (b+s+eq+1)%nat)+1%Z))).
split.
unfold std.
exists (0)%nat.
intros; trivial.
split.
unfold leA, a0.
exists (plus a (plus b (plus r s)))%nat.
intros.
solve [auto with zarith].
unfold multA.
exists (plus ep (plus eq (plus a b)))%nat.
intros.
rewrite Zabs_Zmult.
apply Zmult_lt_compat.
split.
solve [auto with zarith].
rewrite (Z.abs_eq (pp (a + r + ep + 1)%nat)).
apply Z.lt_le_trans with (m:= pp (a + r + ep + 1)%nat ).
replace (pp (a + r + ep + 1)%nat) with (pp n).
apply Ha.
omega.
apply Hep.
omega.
omega.
omega.
apply Hr.
omega.
split.
solve [auto with zarith].
rewrite (Z.abs_eq (qq (b + s + eq + 1)%nat)).
apply Z.lt_le_trans with (m:= qq (b + s + eq + 1)%nat ).
replace (qq (b + s + eq + 1)%nat) with (qq n).
apply Hb.
omega.
apply Heq.
omega.
omega.
omega.
apply Hs.
omega.
Qed.
Lemma ANS2a' : forall x y : A, std x -> std y -> std (x + y).
Proof.
Admitted. (* easy : ANS2' *)
Lemma ANS1' : std 1.
Proof.
Admitted. (* easy : ANS1' *)
Lemma std0 : std 0.
Proof.
Admitted. (* easy : std 0 *)
Lemma ANS2a_minus : forall x, std x -> std (-x ).
Proof.
Admitted. (* easy : ANS2a_minus *)
Lemma ANS4 : forall x, (exists y, lim y/\ | x | <=A | y |)-> lim x.
Proof.
intros.
elim H; clear H.
intros y (Hlimy,Hy).
unfold lim in *.
elim Hlimy.
intros n (Hstdn, (Hle0n,Hyn)).
exists n.
split.
solve [auto].
split.
solve [auto].
apply le_lt_trans with (y:=(|y|)); assumption.
Qed.
Definition std_alt (u:A) :=exists N:nat, exists a, forall n:nat, n > N -> u n = a.
Lemma std_std_alt : forall u:A, std u <-> std_alt u.
Proof.
intros u; split.
intros H ; unfold std, std_alt in *.
destruct H as [N HN].
exists N.
exists (u (plus N 1)).
intros.
apply HN.
easy.
omega.
intros H; unfold std, std_alt in *.
destruct H as [N HN].
exists N.
intros.
destruct HN as [a Ha].
apply eq_trans with a.
now apply Ha.
now (symmetry; apply Ha).
Qed.
Lemma std_A0_dec : forall x, std x -> {x <A 0}+{x =A 0}+{0 <A x}.
(* to be fixed with Set-exists *)
Proof.
intros x H.
assert (H':std_alt x) by now apply std_std_alt.
clear H.
unfold std_alt in H'.
assert (H'':{N:nat & {a:Z | forall n, n>N -> x n = a}}).
admit. (* only requires std to be defined using Set-exists *)
destruct H'' as [N [a Ha]].
assert (Hdec:({a<0%Z}+{a=0%Z}+{a>0%Z})%Z).
destruct a.
left;right; reflexivity.
right; apply Zgt_pos_0.
left; left; apply Zlt_neg_0.
destruct Hdec as [[HH | HH] | HH].
left; left.
exists N.
intros; unfold a0.
now rewrite Ha.
left;right.
exists N.
now subst.
right.
exists N.
intros; unfold a0.
rewrite Ha.
omega.
easy.
Admitted.
Lemma std_lim : forall x, std x -> lim x.
(* lim x -> std x is false, e.g. (-1)^n *)
Proof.
intros x Hstdx.
unfold lim, std in *.
elim Hstdx.
intros N HN.
exists (fun (n:nat) => (Z.abs (x (N+1)%nat)+1)%Z).
split.
exists 0%nat; intros; trivial.
split.
unfold leA.
exists 0%nat; intros; simpl.
unfold a0.
solve [auto with zarith].
unfold ltA.
exists N.
intros.
unfold absA.
rewrite (HN (N+1)%nat n).
solve [auto with zarith].
solve [auto with zarith].
assumption.
Qed.
Instance lim_morphism : Proper (equalA ==> Logic.iff) lim.
repeat red.
unfold_intros.
split.
unfold_intros; destruct_exists.
destruct H1 as [H1' [H2' H3']].
exists H0.
split.
assumption.
split.
assumption.
elim H3'.
intros x0 Hx0.
exists (H+x0+1)%nat.
intros.
rewrite <- H2.
apply Hx0.
omega.
omega.
unfold_intros; destruct_exists.
destruct H1 as [H1' [H2' H3']].
exists H0.
split.
assumption.
split.
assumption.
elim H3'.
intros x0 Hx0.
exists (H+x0+1)%nat.
intros.
rewrite H2.
apply Hx0.
omega.
omega.
Qed.
Instance std_morphism : Proper (equalA ==> Logic.iff) std.
repeat red.
unfold_intros.
split.
unfold_intros; destruct_exists.
let l:= collect_nats in exists (sum_plus1 l); simpl in *.
intros.
transitivity (x n).
symmetry; apply H2; omega.
transitivity (x m).
apply H1; omega.
apply H2; omega.
unfold_intros; destruct_exists.
let l:= collect_nats in exists (sum_plus1 l); simpl in *.
intros.
transitivity (y n).
apply H2; omega.
transitivity (y m).
apply H1; omega.
symmetry; apply H2; omega.
Qed.
(** beta may be w or some non-standard Laugwitz-Schmieden number which is <= w *)
Definition beta : A := fun (n:nat) => (Z_of_nat n).
Lemma Abeta : 0 <A beta.
Proof.
unfold ltA,a0,beta.
exists 1%nat.
intros.
omega.
Qed.
Lemma beta_std : ~std beta.
Proof.
intro H; unfold std in *.
elim H; clear H; intros N HN.
unfold beta in *.
assert (H1:(S N>N)%nat).
omega.
assert (H2:(S (S N)>N)%nat).
omega.
generalize (HN (S N)%nat (S(S N))%nat H1 H2); intro Heq.
assert (S N=S (S N)).
apply inj_eq_rev; assumption.
injection H; intros Hinj.
assert (Hth:(forall n:nat, ~n=(S n))).
intros n; elim n.
simpl; discriminate.
intros n0 Hn0 H'.
apply Hn0.
injection H'.
solve [auto].
generalize (Hth N); intros HthN.
solve [auto].
Qed.
Lemma beta_lim : ~ lim beta.
Proof.
intro H; unfold lim in *.
elim H; clear H; intros p (Hstdp,(Hle0p,Hwp)).
unfold ltA,a0 in *.
elim Hstdp.
intros b Hb.
elim Hwp.
intros a Ha.
elim Hle0p.
intros c Hc.
(* w (p (a+b+c+1) + a + b + c + 1) = p (a+b+c+1) + a+b+c+1 *)
(* p (p (a+b+c+1) + a + b + c + 1) = p (a + b + c + 1) because p(a+b+c+1)>=0 et Hb: p is std *)
pose (px:=p (a+b+c+1)%nat).
assert (0<= px)%Z.
apply Hc.
omega.
pose (x:=((Z.abs_nat px)+a+b+c+1)%nat).
assert ((|beta |) (x) < p (x))%Z.
apply Ha.
unfold px,x in *.
omega.
assert ((|beta |) (x) >= p (x))%Z.
unfold absA in *.
unfold beta.
unfold x.
replace (p (Z.abs_nat px + a + b + c + 1)%nat)%Z with
(p (a+b+c+1)%nat)%Z.
rewrite Z.abs_eq.
replace (Z.abs_nat px + a + b + c + 1)%nat with (Z.abs_nat (px + (Z_of_nat (a + b + c + 1))))%nat.
rewrite inj_Zabs_nat.
rewrite Z.abs_eq.
unfold px.
omega.
omega.
rewrite Zabs_nat_Zplus.
rewrite Zabs_nat_Z_of_nat.
ring.
unfold px; apply Hc.
omega.
solve [auto with zarith].
solve [auto with zarith].
apply Hb.
omega.
omega.
omega.
Qed.
Lemma nat_Z : forall a:Z, (0 <= a)%Z -> exists qnat, Z.of_nat qnat = a.
Proof.
intros.
exists (Z.to_nat a).
apply Z2Nat.id; assumption.
Qed.
Lemma std_alt_lt_beta : forall a, std_alt a /\ 0<=A a -> a <A beta.
Proof.
intros.
destruct H as [Hn Hp].
destruct Hn as [n Hn].
destruct Hn as [q Hq].
destruct Hp as [p Hp].
unfold beta, ltA.
assert (Hq0: (0<=q)%Z).
generalize (Hq (n+p+1)%nat); intros.
generalize (Hp (n+p+1)%nat); intros.
rewrite <- H.
apply H0.
omega.
omega.
elim (nat_Z q Hq0).
intros qnat Hqnat.
exists (n+qnat+p)%nat.
intros;rewrite Hq by omega.
rewrite <- Hqnat.
omega.
Qed.
Lemma lim_lt_beta : forall a, lim a/\ 0<=A a -> a <A beta.
Proof.
unfold lim;intros.
destruct H as [[c H] H1].
destruct H as [Hex [Hex2 Hex3]].
assert (std_alt c) by (apply std_std_alt; assumption).
rewrite abs_pos_val in Hex3 by assumption.
apply lt_trans with c.
assumption.
apply std_alt_lt_beta; split; assumption.
Qed.
(** induction *)
Parameter nat_like_induction :
forall P : A -> Type,
P a0 ->
(forall n:A, (std n /\ 0 <=A n) -> P n -> P (plusA n a1)) ->
forall n:A, (std n /\ 0<=A n) -> P n.
(*
Definition nat2A : nat -> {n:A | std n /\ 0<=A n}.
Proof.
fix 1.
intros n; case n.
exists a0.
clear nat2A n; abstract (split; [apply std0 | apply le_refl]).
intros p.
case (nat2A p).
intros xp Hxp.
exists (xp+a1).
clear nat2A n p;
abstract (split; [apply ANS2a'; [intuition | apply ANS1']| setoid_replace 0 with (0+0) by ring; apply le_plus; [intuition| apply lt_le;apply lt_0_1]]).
Defined.
Lemma A_is_nat :
forall a:A, std a /\ 0<=A a -> exists n:nat, a=proj1_sig (nat2A n).
Proof.
intros.
apply (nat_like_induction (fun (a:A) => exists n : nat, a = proj1_sig (nat2A n))).
exists 0%nat.
simpl; reflexivity.
intros n Hn Hex.
destruct Hex as [p Hp].
exists (S p)%nat.
simpl.
destruct (nat2A p) as [x Hx].
simpl in *.
now apply f_equal2.
assumption.
Qed.
*)
Parameter nat_like_induction_r1 :
forall H:std 0 /\ 0<=A0, forall P : A -> Type,
forall (h0: P a0),
forall hr : (forall n:A, (std n /\ 0 <=A n) -> P n -> P (plusA n a1)),
nat_like_induction P h0 hr a0 H = h0.
Parameter nat_like_induction_r2 :
forall P : A -> Type,
forall n:A, forall H:std n/\0<=A n,
forall Hn':std (n+1)/\0<=A(n+1),
forall (h0: P a0),
forall hr : (forall n:A, (std n /\ 0 <=A n) -> P n -> P (plusA n a1)),
nat_like_induction P h0 hr (n + 1) Hn' =
hr n H (nat_like_induction P h0 hr n H).
End LS.
|
lemma Lim_dist_ubound: assumes "\<not>(trivial_limit net)" and "(f \<longlongrightarrow> l) net" and "eventually (\<lambda>x. dist a (f x) \<le> e) net" shows "dist a l \<le> e" |
Formal statement is: lemma positiveD1: "positive M f \<Longrightarrow> f {} = 0" Informal statement is: If $f$ is a positive measure, then $f(\emptyset) = 0$. |
Formal statement is: lemma islimpt_subset: "x islimpt S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> x islimpt T" Informal statement is: If $x$ is a limit point of $S$ and $S \subseteq T$, then $x$ is a limit point of $T$. |
```python
# This will setup our sympy powered jupyter environment
from IPython.display import display
from sympy.interactive import printing
printing.init_printing()
import sympy
from sympy import S, symbols, exp, log, solve
print(sympy.__version__)
from batemaneq import bateman_parent
```
0.7.6
```python
N = 3
zero, one, t = S('0'), S('1'), symbols('t')
lmbd = symbols('lambda:'+str(N))
```
```python
bateman_parent(lmbd, t, one, zero, exp)
```
```python
k = symbols('k')
bateman_parent([i*k for i in range(1, 7)], one, one, zero, exp)
```
|
\newpage
\section*{References}
\begin{enumerate}
\item \href{https://www.mindsports.nl/index.php/side-dishes/interesting-games?start=2}{Mindsports - Interesting game - Congo}
\item \href{https://en.wikipedia.org/wiki/Congo_(chess_variant)}{Wikipedia - Congo (chess variant)}
\item \href{https://www.chessvariants.com/ms.dir/congo.html}{Chess variants - Congo}
\item \href{https://en.wikipedia.org/wiki/Glossary_of_chess}{Wikipedia - Glossary of chess}
\item \href{https://www.chessprogramming.org/}{Chess Programming Wiki}
\item \href{http://www.frayn.net/beowulf/theory.html}{Computer Chess Programming Theory}
\end{enumerate}
|
/-
Copyright (c) 2020 Aaron Anderson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Aaron Anderson.
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.order.bounded_lattice
import Mathlib.data.set.intervals.basic
import Mathlib.PostPort
universes u_1
namespace Mathlib
/-!
# Intervals in Lattices
In this file, we provide instances of lattice structures on intervals within lattices.
Some of them depend on the order of the endpoints of the interval, and thus are not made
global instances. These are probably not all of the lattice instances that could be placed on these
intervals, but more can be added easily along the same lines when needed.
## Main definitions
In the following, `*` can represent either `c`, `o`, or `i`.
* `set.Ic*.semilattice_inf_bot`
* `set.Ii*.semillatice_inf`
* `set.I*c.semilattice_sup_top`
* `set.I*c.semillatice_inf`
* `set.Iic.bounded_lattice`, within a `bounded_lattice`
* `set.Ici.bounded_lattice`, within a `bounded_lattice`
-/
namespace set
namespace Ico
protected instance semilattice_inf {α : Type u_1} {a : α} {b : α} [semilattice_inf α] :
semilattice_inf ↥(Ico a b) :=
subtype.semilattice_inf sorry
/-- `Ico a b` has a bottom element whenever `a < b`. -/
def order_bot {α : Type u_1} {a : α} {b : α} [partial_order α] (h : a < b) : order_bot ↥(Ico a b) :=
order_bot.mk { val := a, property := sorry } partial_order.le partial_order.lt sorry sorry sorry
sorry
/-- `Ico a b` is a `semilattice_inf_bot` whenever `a < b`. -/
def semilattice_inf_bot {α : Type u_1} {a : α} {b : α} [semilattice_inf α] (h : a < b) :
semilattice_inf_bot ↥(Ico a b) :=
semilattice_inf_bot.mk order_bot.bot semilattice_inf.le semilattice_inf.lt sorry sorry sorry sorry
semilattice_inf.inf sorry sorry sorry
end Ico
namespace Iio
protected instance semilattice_inf {α : Type u_1} [semilattice_inf α] {a : α} :
semilattice_inf ↥(Iio a) :=
subtype.semilattice_inf sorry
end Iio
namespace Ioc
protected instance semilattice_sup {α : Type u_1} {a : α} {b : α} [semilattice_sup α] :
semilattice_sup ↥(Ioc a b) :=
subtype.semilattice_sup sorry
/-- `Ioc a b` has a top element whenever `a < b`. -/
def order_top {α : Type u_1} {a : α} {b : α} [partial_order α] (h : a < b) : order_top ↥(Ioc a b) :=
order_top.mk { val := b, property := sorry } partial_order.le partial_order.lt sorry sorry sorry
sorry
/-- `Ioc a b` is a `semilattice_sup_top` whenever `a < b`. -/
def semilattice_sup_top {α : Type u_1} {a : α} {b : α} [semilattice_sup α] (h : a < b) :
semilattice_sup_top ↥(Ioc a b) :=
semilattice_sup_top.mk order_top.top semilattice_sup.le semilattice_sup.lt sorry sorry sorry sorry
semilattice_sup.sup sorry sorry sorry
end Ioc
namespace Iio
protected instance set.Ioi.semilattice_sup {α : Type u_1} [semilattice_sup α] {a : α} :
semilattice_sup ↥(Ioi a) :=
subtype.semilattice_sup sorry
end Iio
namespace Iic
protected instance semilattice_inf {α : Type u_1} {a : α} [semilattice_inf α] :
semilattice_inf ↥(Iic a) :=
subtype.semilattice_inf sorry
protected instance semilattice_sup {α : Type u_1} {a : α} [semilattice_sup α] :
semilattice_sup ↥(Iic a) :=
subtype.semilattice_sup sorry
protected instance lattice {α : Type u_1} {a : α} [lattice α] : lattice ↥(Iic a) :=
lattice.mk semilattice_sup.sup semilattice_inf.le semilattice_inf.lt sorry sorry sorry sorry sorry
sorry semilattice_inf.inf sorry sorry sorry
protected instance order_top {α : Type u_1} {a : α} [partial_order α] : order_top ↥(Iic a) :=
order_top.mk { val := a, property := sorry } partial_order.le partial_order.lt sorry sorry sorry
sorry
@[simp] theorem coe_top {α : Type u_1} [partial_order α] {a : α} : ↑⊤ = a := rfl
protected instance semilattice_inf_top {α : Type u_1} {a : α} [semilattice_inf α] :
semilattice_inf_top ↥(Iic a) :=
semilattice_inf_top.mk order_top.top semilattice_inf.le semilattice_inf.lt sorry sorry sorry sorry
semilattice_inf.inf sorry sorry sorry
protected instance semilattice_sup_top {α : Type u_1} {a : α} [semilattice_sup α] :
semilattice_sup_top ↥(Iic a) :=
semilattice_sup_top.mk order_top.top semilattice_sup.le semilattice_sup.lt sorry sorry sorry sorry
semilattice_sup.sup sorry sorry sorry
protected instance order_bot {α : Type u_1} {a : α} [order_bot α] : order_bot ↥(Iic a) :=
order_bot.mk { val := ⊥, property := bot_le } partial_order.le partial_order.lt sorry sorry sorry
sorry
@[simp] theorem coe_bot {α : Type u_1} [order_bot α] {a : α} : ↑⊥ = ⊥ := rfl
protected instance semilattice_inf_bot {α : Type u_1} {a : α} [semilattice_inf_bot α] :
semilattice_inf_bot ↥(Iic a) :=
semilattice_inf_bot.mk order_bot.bot semilattice_inf.le semilattice_inf.lt sorry sorry sorry sorry
semilattice_inf.inf sorry sorry sorry
protected instance semilattice_sup_bot {α : Type u_1} {a : α} [semilattice_sup_bot α] :
semilattice_sup_bot ↥(Iic a) :=
semilattice_sup_bot.mk order_bot.bot semilattice_sup.le semilattice_sup.lt sorry sorry sorry sorry
semilattice_sup.sup sorry sorry sorry
protected instance bounded_lattice {α : Type u_1} {a : α} [bounded_lattice α] :
bounded_lattice ↥(Iic a) :=
bounded_lattice.mk lattice.sup order_top.le order_top.lt sorry sorry sorry sorry sorry sorry
lattice.inf sorry sorry sorry order_top.top sorry order_bot.bot sorry
end Iic
namespace Ici
protected instance semilattice_inf {α : Type u_1} {a : α} [semilattice_inf α] :
semilattice_inf ↥(Ici a) :=
subtype.semilattice_inf sorry
protected instance semilattice_sup {α : Type u_1} {a : α} [semilattice_sup α] :
semilattice_sup ↥(Ici a) :=
subtype.semilattice_sup sorry
protected instance lattice {α : Type u_1} {a : α} [lattice α] : lattice ↥(Ici a) :=
lattice.mk semilattice_sup.sup semilattice_inf.le semilattice_inf.lt sorry sorry sorry sorry sorry
sorry semilattice_inf.inf sorry sorry sorry
protected instance order_bot {α : Type u_1} {a : α} [partial_order α] : order_bot ↥(Ici a) :=
order_bot.mk { val := a, property := sorry } partial_order.le partial_order.lt sorry sorry sorry
sorry
@[simp] theorem coe_bot {α : Type u_1} [partial_order α] {a : α} : ↑⊥ = a := rfl
protected instance semilattice_inf_bot {α : Type u_1} {a : α} [semilattice_inf α] :
semilattice_inf_bot ↥(Ici a) :=
semilattice_inf_bot.mk order_bot.bot semilattice_inf.le semilattice_inf.lt sorry sorry sorry sorry
semilattice_inf.inf sorry sorry sorry
protected instance semilattice_sup_bot {α : Type u_1} {a : α} [semilattice_sup α] :
semilattice_sup_bot ↥(Ici a) :=
semilattice_sup_bot.mk order_bot.bot semilattice_sup.le semilattice_sup.lt sorry sorry sorry sorry
semilattice_sup.sup sorry sorry sorry
protected instance order_top {α : Type u_1} {a : α} [order_top α] : order_top ↥(Ici a) :=
order_top.mk { val := ⊤, property := le_top } partial_order.le partial_order.lt sorry sorry sorry
sorry
@[simp] theorem coe_top {α : Type u_1} [order_top α] {a : α} : ↑⊤ = ⊤ := rfl
protected instance semilattice_sup_top {α : Type u_1} {a : α} [semilattice_sup_top α] :
semilattice_sup_top ↥(Ici a) :=
semilattice_sup_top.mk order_top.top semilattice_sup.le semilattice_sup.lt sorry sorry sorry sorry
semilattice_sup.sup sorry sorry sorry
protected instance semilattice_inf_top {α : Type u_1} {a : α} [semilattice_inf_top α] :
semilattice_inf_top ↥(Ici a) :=
semilattice_inf_top.mk order_top.top semilattice_inf.le semilattice_inf.lt sorry sorry sorry sorry
semilattice_inf.inf sorry sorry sorry
protected instance bounded_lattice {α : Type u_1} {a : α} [bounded_lattice α] :
bounded_lattice ↥(Ici a) :=
bounded_lattice.mk lattice.sup order_top.le order_top.lt sorry sorry sorry sorry sorry sorry
lattice.inf sorry sorry sorry order_top.top sorry order_bot.bot sorry
end Ici
namespace Icc
protected instance semilattice_inf {α : Type u_1} [semilattice_inf α] {a : α} {b : α} :
semilattice_inf ↥(Icc a b) :=
subtype.semilattice_inf sorry
protected instance semilattice_sup {α : Type u_1} [semilattice_sup α] {a : α} {b : α} :
semilattice_sup ↥(Icc a b) :=
subtype.semilattice_sup sorry
protected instance lattice {α : Type u_1} [lattice α] {a : α} {b : α} : lattice ↥(Icc a b) :=
lattice.mk semilattice_sup.sup semilattice_inf.le semilattice_inf.lt sorry sorry sorry sorry sorry
sorry semilattice_inf.inf sorry sorry sorry
/-- `Icc a b` has a bottom element whenever `a ≤ b`. -/
def order_bot {α : Type u_1} [partial_order α] {a : α} {b : α} (h : a ≤ b) : order_bot ↥(Icc a b) :=
order_bot.mk { val := a, property := sorry } partial_order.le partial_order.lt sorry sorry sorry
sorry
/-- `Icc a b` has a top element whenever `a ≤ b`. -/
def order_top {α : Type u_1} [partial_order α] {a : α} {b : α} (h : a ≤ b) : order_top ↥(Icc a b) :=
order_top.mk { val := b, property := sorry } partial_order.le partial_order.lt sorry sorry sorry
sorry
/-- `Icc a b` is a `semilattice_inf_bot` whenever `a ≤ b`. -/
def semilattice_inf_bot {α : Type u_1} [semilattice_inf α] {a : α} {b : α} (h : a ≤ b) :
semilattice_inf_bot ↥(Icc a b) :=
semilattice_inf_bot.mk order_bot.bot order_bot.le order_bot.lt sorry sorry sorry sorry
semilattice_inf.inf sorry sorry sorry
/-- `Icc a b` is a `semilattice_inf_top` whenever `a ≤ b`. -/
def semilattice_inf_top {α : Type u_1} [semilattice_inf α] {a : α} {b : α} (h : a ≤ b) :
semilattice_inf_top ↥(Icc a b) :=
semilattice_inf_top.mk order_top.top order_top.le order_top.lt sorry sorry sorry sorry
semilattice_inf.inf sorry sorry sorry
/-- `Icc a b` is a `semilattice_sup_bot` whenever `a ≤ b`. -/
def semilattice_sup_bot {α : Type u_1} [semilattice_sup α] {a : α} {b : α} (h : a ≤ b) :
semilattice_sup_bot ↥(Icc a b) :=
semilattice_sup_bot.mk order_bot.bot order_bot.le order_bot.lt sorry sorry sorry sorry
semilattice_sup.sup sorry sorry sorry
/-- `Icc a b` is a `semilattice_sup_top` whenever `a ≤ b`. -/
def semilattice_sup_top {α : Type u_1} [semilattice_sup α] {a : α} {b : α} (h : a ≤ b) :
semilattice_sup_top ↥(Icc a b) :=
semilattice_sup_top.mk order_top.top order_top.le order_top.lt sorry sorry sorry sorry
semilattice_sup.sup sorry sorry sorry
/-- `Icc a b` is a `bounded_lattice` whenever `a ≤ b`. -/
def bounded_lattice {α : Type u_1} [lattice α] {a : α} {b : α} (h : a ≤ b) :
bounded_lattice ↥(Icc a b) :=
bounded_lattice.mk semilattice_sup_top.sup semilattice_inf_bot.le semilattice_inf_bot.lt sorry
sorry sorry sorry sorry sorry semilattice_inf_bot.inf sorry sorry sorry semilattice_sup_top.top
sorry semilattice_inf_bot.bot sorry
end Mathlib |
If $f_n$ is a sequence of functions that are differentiable on a convex set $S$, and if the sequence of derivatives $f'_n$ converges uniformly to a function $g'$, then the sequence of functions $f_n$ converges uniformly to a function $g$ whose derivative is $g'$. |
[STATEMENT]
lemma is_class_type_aux: "is_class P C \<Longrightarrow> is_type P (Class C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. is_class P C \<Longrightarrow> is_type P (Class C)
[PROOF STEP]
by(simp) |
[STATEMENT]
lemma is_rel_irrefl_alt:
assumes "(u, v) \<in> adj_relation"
shows "u \<noteq> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. u \<noteq> v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. u \<noteq> v
[PROOF STEP]
have "vert_adj u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. vert_adj u v
[PROOF STEP]
using adj_relation_def assms
[PROOF STATE]
proof (prove)
using this:
adj_relation \<equiv> {(u, v) |u v. vert_adj u v}
adj u v
goal (1 subgoal):
1. vert_adj u v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vert_adj u v
goal (1 subgoal):
1. u \<noteq> v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vert_adj u v
[PROOF STEP]
have "{u, v} \<in> E"
[PROOF STATE]
proof (prove)
using this:
vert_adj u v
goal (1 subgoal):
1. {u, v} \<in> E
[PROOF STEP]
using vert_adj_def
[PROOF STATE]
proof (prove)
using this:
vert_adj u v
vert_adj ?v1.0 ?v2.0 \<equiv> {?v1.0, ?v2.0} \<in> E
goal (1 subgoal):
1. {u, v} \<in> E
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{u, v} \<in> E
goal (1 subgoal):
1. u \<noteq> v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{u, v} \<in> E
[PROOF STEP]
have "card {u, v} = 2"
[PROOF STATE]
proof (prove)
using this:
{u, v} \<in> E
goal (1 subgoal):
1. card {u, v} = 2
[PROOF STEP]
using two_edges
[PROOF STATE]
proof (prove)
using this:
{u, v} \<in> E
?e \<in> E \<Longrightarrow> card ?e = 2
goal (1 subgoal):
1. card {u, v} = 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {u, v} = 2
goal (1 subgoal):
1. u \<noteq> v
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card {u, v} = 2
goal (1 subgoal):
1. u \<noteq> v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<noteq> v
goal:
No subgoals!
[PROOF STEP]
qed |
(* Title: HOL/Auth/n_germanSymIndex_lemma_on_inv__42.thy
Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences
*)
header{*The n_germanSymIndex Protocol Case Study*}
theory n_germanSymIndex_lemma_on_inv__42 imports n_germanSymIndex_base
begin
section{*All lemmas on causal relation between inv__42 and some rule r*}
lemma n_RecvReqSVsinv__42:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqS N i)" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvReqS N i" apply fastforce done
from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__42 p__Inv2" apply fastforce done
have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv2)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Chan3'') p__Inv2) ''Cmd'')) (Const InvAck)) (eqn (IVar (Ident ''CurCmd'')) (Const Empty))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv2)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Chan3'') p__Inv2) ''Cmd'')) (Const InvAck)) (eqn (IVar (Ident ''CurCmd'')) (Const Empty))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_RecvReqEVsinv__42:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqE N i)" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvReqE N i" apply fastforce done
from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__42 p__Inv2" apply fastforce done
have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv2)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Chan3'') p__Inv2) ''Cmd'')) (Const InvAck)) (eqn (IVar (Ident ''CurCmd'')) (Const Empty))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv2)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Chan3'') p__Inv2) ''Cmd'')) (Const InvAck)) (eqn (IVar (Ident ''CurCmd'')) (Const Empty))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_SendInv__part__0Vsinv__42:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInv__part__0 i" apply fastforce done
from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__42 p__Inv2" apply fastforce done
have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv2)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv2)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_SendInv__part__1Vsinv__42:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInv__part__1 i" apply fastforce done
from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__42 p__Inv2" apply fastforce done
have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv2)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv2)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_SendInvAckVsinv__42:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInvAck i" apply fastforce done
from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__42 p__Inv2" apply fastforce done
have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv2)"
have "?P3 s"
apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Para (Ident ''InvSet'') p__Inv2)) (Const true)) (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv2) ''Cmd'')) (Const Inv))))" in exI, auto) done
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv2)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_RecvInvAckVsinv__42:
assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s")
proof -
from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvInvAck i" apply fastforce done
from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__42 p__Inv2" apply fastforce done
have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done
moreover {
assume b1: "(i=p__Inv2)"
have "?P1 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
moreover {
assume b1: "(i~=p__Inv2)"
have "?P2 s"
proof(cut_tac a1 a2 b1, auto) qed
then have "invHoldForRule s f r (invariants N)" by auto
}
ultimately show "invHoldForRule s f r (invariants N)" by satx
qed
lemma n_SendReqE__part__1Vsinv__42:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_StoreVsinv__42:
assumes a1: "\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_RecvGntSVsinv__42:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_RecvGntS i" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_SendGntSVsinv__42:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendGntS i" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_RecvGntEVsinv__42:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_RecvGntE i" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_SendReqE__part__0Vsinv__42:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_SendReqSVsinv__42:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqS i" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
lemma n_SendGntEVsinv__42:
assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendGntE N i" and
a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__42 p__Inv2)"
shows "invHoldForRule s f r (invariants N)"
apply (rule noEffectOnRule, cut_tac a1 a2, auto) done
end
|
module A
public export
defA : Int -> Int
|
/-
Copyright (c) 2018 Sean Leather. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sean Leather, Mario Carneiro
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.data.list.alist
import Mathlib.data.finset.basic
import Mathlib.data.pfun
import Mathlib.PostPort
universes u v l u_1 w
namespace Mathlib
/-!
# Finite maps over `multiset`
-/
/-! ### multisets of sigma types-/
namespace multiset
/-- Multiset of keys of an association multiset. -/
def keys {α : Type u} {β : α → Type v} (s : multiset (sigma β)) : multiset α :=
map sigma.fst s
@[simp] theorem coe_keys {α : Type u} {β : α → Type v} {l : List (sigma β)} : keys ↑l = ↑(list.keys l) :=
rfl
/-- `nodupkeys s` means that `s` has no duplicate keys. -/
def nodupkeys {α : Type u} {β : α → Type v} (s : multiset (sigma β)) :=
quot.lift_on s list.nodupkeys sorry
@[simp] theorem coe_nodupkeys {α : Type u} {β : α → Type v} {l : List (sigma β)} : nodupkeys ↑l ↔ list.nodupkeys l :=
iff.rfl
end multiset
/-! ### finmap -/
/-- `finmap β` is the type of finite maps over a multiset. It is effectively
a quotient of `alist β` by permutation of the underlying list. -/
structure finmap {α : Type u} (β : α → Type v)
where
entries : multiset (sigma β)
nodupkeys : multiset.nodupkeys entries
/-- The quotient map from `alist` to `finmap`. -/
def alist.to_finmap {α : Type u} {β : α → Type v} (s : alist β) : finmap β :=
finmap.mk (↑(alist.entries s)) (alist.nodupkeys s)
theorem alist.to_finmap_eq {α : Type u} {β : α → Type v} {s₁ : alist β} {s₂ : alist β} : alist.to_finmap s₁ = alist.to_finmap s₂ ↔ alist.entries s₁ ~ alist.entries s₂ := sorry
@[simp] theorem alist.to_finmap_entries {α : Type u} {β : α → Type v} (s : alist β) : finmap.entries (alist.to_finmap s) = ↑(alist.entries s) :=
rfl
/-- Given `l : list (sigma β)`, create a term of type `finmap β` by removing
entries with duplicate keys. -/
def list.to_finmap {α : Type u} {β : α → Type v} [DecidableEq α] (s : List (sigma β)) : finmap β :=
alist.to_finmap (list.to_alist s)
namespace finmap
/-! ### lifting from alist -/
/-- Lift a permutation-respecting function on `alist` to `finmap`. -/
def lift_on {α : Type u} {β : α → Type v} {γ : Type u_1} (s : finmap β) (f : alist β → γ) (H : ∀ (a b : alist β), alist.entries a ~ alist.entries b → f a = f b) : γ :=
roption.get
(quotient.lift_on (entries s)
(fun (l : List (sigma β)) => roption.mk (list.nodupkeys l) fun (nd : list.nodupkeys l) => f (alist.mk l nd)) sorry)
sorry
@[simp] theorem lift_on_to_finmap {α : Type u} {β : α → Type v} {γ : Type u_1} (s : alist β) (f : alist β → γ) (H : ∀ (a b : alist β), alist.entries a ~ alist.entries b → f a = f b) : lift_on (alist.to_finmap s) f H = f s :=
alist.cases_on s
fun (s_entries : List (sigma β)) (s_nodupkeys : list.nodupkeys s_entries) =>
Eq.refl (lift_on (alist.to_finmap (alist.mk s_entries s_nodupkeys)) f H)
/-- Lift a permutation-respecting function on 2 `alist`s to 2 `finmap`s. -/
def lift_on₂ {α : Type u} {β : α → Type v} {γ : Type u_1} (s₁ : finmap β) (s₂ : finmap β) (f : alist β → alist β → γ) (H : ∀ (a₁ b₁ a₂ b₂ : alist β), alist.entries a₁ ~ alist.entries a₂ → alist.entries b₁ ~ alist.entries b₂ → f a₁ b₁ = f a₂ b₂) : γ :=
lift_on s₁ (fun (l₁ : alist β) => lift_on s₂ (f l₁) sorry) sorry
@[simp] theorem lift_on₂_to_finmap {α : Type u} {β : α → Type v} {γ : Type u_1} (s₁ : alist β) (s₂ : alist β) (f : alist β → alist β → γ) (H : ∀ (a₁ b₁ a₂ b₂ : alist β), alist.entries a₁ ~ alist.entries a₂ → alist.entries b₁ ~ alist.entries b₂ → f a₁ b₁ = f a₂ b₂) : lift_on₂ (alist.to_finmap s₁) (alist.to_finmap s₂) f H = f s₁ s₂ := sorry
/-! ### induction -/
theorem induction_on {α : Type u} {β : α → Type v} {C : finmap β → Prop} (s : finmap β) (H : ∀ (a : alist β), C (alist.to_finmap a)) : C s := sorry
theorem induction_on₂ {α : Type u} {β : α → Type v} {C : finmap β → finmap β → Prop} (s₁ : finmap β) (s₂ : finmap β) (H : ∀ (a₁ a₂ : alist β), C (alist.to_finmap a₁) (alist.to_finmap a₂)) : C s₁ s₂ :=
induction_on s₁ fun (l₁ : alist β) => induction_on s₂ fun (l₂ : alist β) => H l₁ l₂
theorem induction_on₃ {α : Type u} {β : α → Type v} {C : finmap β → finmap β → finmap β → Prop} (s₁ : finmap β) (s₂ : finmap β) (s₃ : finmap β) (H : ∀ (a₁ a₂ a₃ : alist β), C (alist.to_finmap a₁) (alist.to_finmap a₂) (alist.to_finmap a₃)) : C s₁ s₂ s₃ :=
induction_on₂ s₁ s₂ fun (l₁ l₂ : alist β) => induction_on s₃ fun (l₃ : alist β) => H l₁ l₂ l₃
/-! ### extensionality -/
theorem ext {α : Type u} {β : α → Type v} {s : finmap β} {t : finmap β} : entries s = entries t → s = t := sorry
@[simp] theorem ext_iff {α : Type u} {β : α → Type v} {s : finmap β} {t : finmap β} : entries s = entries t ↔ s = t :=
{ mp := ext, mpr := congr_arg fun {s : finmap β} => entries s }
/-! ### mem -/
/-- The predicate `a ∈ s` means that `s` has a value associated to the key `a`. -/
protected instance has_mem {α : Type u} {β : α → Type v} : has_mem α (finmap β) :=
has_mem.mk fun (a : α) (s : finmap β) => a ∈ multiset.keys (entries s)
theorem mem_def {α : Type u} {β : α → Type v} {a : α} {s : finmap β} : a ∈ s ↔ a ∈ multiset.keys (entries s) :=
iff.rfl
@[simp] theorem mem_to_finmap {α : Type u} {β : α → Type v} {a : α} {s : alist β} : a ∈ alist.to_finmap s ↔ a ∈ s :=
iff.rfl
/-! ### keys -/
/-- The set of keys of a finite map. -/
def keys {α : Type u} {β : α → Type v} (s : finmap β) : finset α :=
finset.mk (multiset.keys (entries s)) sorry
@[simp] theorem keys_val {α : Type u} {β : α → Type v} (s : alist β) : finset.val (keys (alist.to_finmap s)) = ↑(alist.keys s) :=
rfl
@[simp] theorem keys_ext {α : Type u} {β : α → Type v} {s₁ : alist β} {s₂ : alist β} : keys (alist.to_finmap s₁) = keys (alist.to_finmap s₂) ↔ alist.keys s₁ ~ alist.keys s₂ := sorry
theorem mem_keys {α : Type u} {β : α → Type v} {a : α} {s : finmap β} : a ∈ keys s ↔ a ∈ s :=
induction_on s fun (s : alist β) => alist.mem_keys
/-! ### empty -/
/-- The empty map. -/
protected instance has_emptyc {α : Type u} {β : α → Type v} : has_emptyc (finmap β) :=
has_emptyc.mk (mk 0 list.nodupkeys_nil)
protected instance inhabited {α : Type u} {β : α → Type v} : Inhabited (finmap β) :=
{ default := ∅ }
@[simp] theorem empty_to_finmap {α : Type u} {β : α → Type v} : alist.to_finmap ∅ = ∅ :=
rfl
@[simp] theorem to_finmap_nil {α : Type u} {β : α → Type v} [DecidableEq α] : list.to_finmap [] = ∅ :=
rfl
theorem not_mem_empty {α : Type u} {β : α → Type v} {a : α} : ¬a ∈ ∅ :=
multiset.not_mem_zero a
@[simp] theorem keys_empty {α : Type u} {β : α → Type v} : keys ∅ = ∅ :=
rfl
/-! ### singleton -/
/-- The singleton map. -/
def singleton {α : Type u} {β : α → Type v} (a : α) (b : β a) : finmap β :=
alist.to_finmap (alist.singleton a b)
@[simp] theorem keys_singleton {α : Type u} {β : α → Type v} (a : α) (b : β a) : keys (singleton a b) = singleton a :=
rfl
@[simp] theorem mem_singleton {α : Type u} {β : α → Type v} (x : α) (y : α) (b : β y) : x ∈ singleton y b ↔ x = y := sorry
protected instance has_decidable_eq {α : Type u} {β : α → Type v} [DecidableEq α] [(a : α) → DecidableEq (β a)] : DecidableEq (finmap β) :=
sorry
/-! ### lookup -/
/-- Look up the value associated to a key in a map. -/
def lookup {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : finmap β) : Option (β a) :=
lift_on s (alist.lookup a) sorry
@[simp] theorem lookup_to_finmap {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : alist β) : lookup a (alist.to_finmap s) = alist.lookup a s :=
rfl
@[simp] theorem lookup_list_to_finmap {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : List (sigma β)) : lookup a (list.to_finmap s) = list.lookup a s := sorry
@[simp] theorem lookup_empty {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) : lookup a ∅ = none :=
rfl
theorem lookup_is_some {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {s : finmap β} : ↥(option.is_some (lookup a s)) ↔ a ∈ s :=
induction_on s fun (s : alist β) => alist.lookup_is_some
theorem lookup_eq_none {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {s : finmap β} : lookup a s = none ↔ ¬a ∈ s :=
induction_on s fun (s : alist β) => alist.lookup_eq_none
@[simp] theorem lookup_singleton_eq {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} : lookup a (singleton a b) = some b := sorry
protected instance has_mem.mem.decidable {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : finmap β) : Decidable (a ∈ s) :=
decidable_of_iff ↥(option.is_some (lookup a s)) sorry
theorem mem_iff {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {s : finmap β} : a ∈ s ↔ ∃ (b : β a), lookup a s = some b :=
induction_on s
fun (s : alist β) =>
iff.trans list.mem_keys (exists_congr fun (b : β a) => iff.symm (list.mem_lookup_iff (alist.nodupkeys s)))
theorem mem_of_lookup_eq_some {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} {s : finmap β} (h : lookup a s = some b) : a ∈ s :=
iff.mpr mem_iff (Exists.intro b h)
theorem ext_lookup {α : Type u} {β : α → Type v} [DecidableEq α] {s₁ : finmap β} {s₂ : finmap β} : (∀ (x : α), lookup x s₁ = lookup x s₂) → s₁ = s₂ := sorry
/-! ### replace -/
/-- Replace a key with a given value in a finite map.
If the key is not present it does nothing. -/
def replace {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (b : β a) (s : finmap β) : finmap β :=
lift_on s (fun (t : alist β) => alist.to_finmap (alist.replace a b t)) sorry
@[simp] theorem replace_to_finmap {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (b : β a) (s : alist β) : replace a b (alist.to_finmap s) = alist.to_finmap (alist.replace a b s) := sorry
@[simp] theorem keys_replace {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (b : β a) (s : finmap β) : keys (replace a b s) = keys s := sorry
@[simp] theorem mem_replace {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {a' : α} {b : β a} {s : finmap β} : a' ∈ replace a b s ↔ a' ∈ s := sorry
/-! ### foldl -/
/-- Fold a commutative function over the key-value pairs in the map -/
def foldl {α : Type u} {β : α → Type v} {δ : Type w} (f : δ → (a : α) → β a → δ) (H : ∀ (d : δ) (a₁ : α) (b₁ : β a₁) (a₂ : α) (b₂ : β a₂), f (f d a₁ b₁) a₂ b₂ = f (f d a₂ b₂) a₁ b₁) (d : δ) (m : finmap β) : δ :=
multiset.foldl (fun (d : δ) (s : sigma β) => f d (sigma.fst s) (sigma.snd s)) sorry d (entries m)
/-- `any f s` returns `tt` iff there exists a value `v` in `s` such that `f v = tt`. -/
def any {α : Type u} {β : α → Type v} (f : (x : α) → β x → Bool) (s : finmap β) : Bool :=
foldl (fun (x : Bool) (y : α) (z : β y) => to_bool (↥x ∨ ↥(f y z))) sorry false s
/-- `all f s` returns `tt` iff `f v = tt` for all values `v` in `s`. -/
def all {α : Type u} {β : α → Type v} (f : (x : α) → β x → Bool) (s : finmap β) : Bool :=
foldl (fun (x : Bool) (y : α) (z : β y) => to_bool (↥x ∧ ↥(f y z))) sorry false s
/-! ### erase -/
/-- Erase a key from the map. If the key is not present it does nothing. -/
def erase {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : finmap β) : finmap β :=
lift_on s (fun (t : alist β) => alist.to_finmap (alist.erase a t)) sorry
@[simp] theorem erase_to_finmap {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : alist β) : erase a (alist.to_finmap s) = alist.to_finmap (alist.erase a s) := sorry
@[simp] theorem keys_erase_to_finset {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : alist β) : keys (alist.to_finmap (alist.erase a s)) = finset.erase (keys (alist.to_finmap s)) a := sorry
@[simp] theorem keys_erase {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : finmap β) : keys (erase a s) = finset.erase (keys s) a := sorry
@[simp] theorem mem_erase {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {a' : α} {s : finmap β} : a' ∈ erase a s ↔ a' ≠ a ∧ a' ∈ s := sorry
theorem not_mem_erase_self {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {s : finmap β} : ¬a ∈ erase a s :=
eq.mpr (id (Eq._oldrec (Eq.refl (¬a ∈ erase a s)) (propext mem_erase)))
(eq.mpr (id (Eq._oldrec (Eq.refl (¬(a ≠ a ∧ a ∈ s))) (propext not_and_distrib)))
(eq.mpr (id (Eq._oldrec (Eq.refl (¬a ≠ a ∨ ¬a ∈ s)) (propext not_not))) (Or.inl (Eq.refl a))))
@[simp] theorem lookup_erase {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : finmap β) : lookup a (erase a s) = none :=
induction_on s (alist.lookup_erase a)
@[simp] theorem lookup_erase_ne {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {a' : α} {s : finmap β} (h : a ≠ a') : lookup a (erase a' s) = lookup a s :=
induction_on s fun (s : alist β) => alist.lookup_erase_ne h
theorem erase_erase {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {a' : α} {s : finmap β} : erase a (erase a' s) = erase a' (erase a s) := sorry
/-! ### sdiff -/
/-- `sdiff s s'` consists of all key-value pairs from `s` and `s'` where the keys are in `s` or
`s'` but not both. -/
def sdiff {α : Type u} {β : α → Type v} [DecidableEq α] (s : finmap β) (s' : finmap β) : finmap β :=
foldl (fun (s : finmap β) (x : α) (_x : β x) => erase x s) sorry s s'
protected instance has_sdiff {α : Type u} {β : α → Type v} [DecidableEq α] : has_sdiff (finmap β) :=
has_sdiff.mk sdiff
/-! ### insert -/
/-- Insert a key-value pair into a finite map, replacing any existing pair with
the same key. -/
def insert {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (b : β a) (s : finmap β) : finmap β :=
lift_on s (fun (t : alist β) => alist.to_finmap (alist.insert a b t)) sorry
@[simp] theorem insert_to_finmap {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (b : β a) (s : alist β) : insert a b (alist.to_finmap s) = alist.to_finmap (alist.insert a b s) := sorry
theorem insert_entries_of_neg {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} {s : finmap β} : ¬a ∈ s → entries (insert a b s) = sigma.mk a b ::ₘ entries s := sorry
@[simp] theorem mem_insert {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {a' : α} {b' : β a'} {s : finmap β} : a ∈ insert a' b' s ↔ a = a' ∨ a ∈ s :=
induction_on s alist.mem_insert
@[simp] theorem lookup_insert {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} (s : finmap β) : lookup a (insert a b s) = some b := sorry
@[simp] theorem lookup_insert_of_ne {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {a' : α} {b : β a} (s : finmap β) (h : a' ≠ a) : lookup a' (insert a b s) = lookup a' s := sorry
@[simp] theorem insert_insert {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} {b' : β a} (s : finmap β) : insert a b' (insert a b s) = insert a b' s := sorry
theorem insert_insert_of_ne {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {a' : α} {b : β a} {b' : β a'} (s : finmap β) (h : a ≠ a') : insert a' b' (insert a b s) = insert a b (insert a' b' s) := sorry
theorem to_finmap_cons {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (b : β a) (xs : List (sigma β)) : list.to_finmap (sigma.mk a b :: xs) = insert a b (list.to_finmap xs) :=
rfl
theorem mem_list_to_finmap {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (xs : List (sigma β)) : a ∈ list.to_finmap xs ↔ ∃ (b : β a), sigma.mk a b ∈ xs := sorry
@[simp] theorem insert_singleton_eq {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} {b' : β a} : insert a b (singleton a b') = singleton a b := sorry
/-! ### extract -/
/-- Erase a key from the map, and return the corresponding value, if found. -/
def extract {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : finmap β) : Option (β a) × finmap β :=
lift_on s (fun (t : alist β) => prod.map id alist.to_finmap (alist.extract a t)) sorry
@[simp] theorem extract_eq_lookup_erase {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (s : finmap β) : extract a s = (lookup a s, erase a s) := sorry
/-! ### union -/
/-- `s₁ ∪ s₂` is the key-based union of two finite maps. It is left-biased: if
there exists an `a ∈ s₁`, `lookup a (s₁ ∪ s₂) = lookup a s₁`. -/
def union {α : Type u} {β : α → Type v} [DecidableEq α] (s₁ : finmap β) (s₂ : finmap β) : finmap β :=
lift_on₂ s₁ s₂ (fun (s₁ s₂ : alist β) => alist.to_finmap (s₁ ∪ s₂)) sorry
protected instance has_union {α : Type u} {β : α → Type v} [DecidableEq α] : has_union (finmap β) :=
has_union.mk union
@[simp] theorem mem_union {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {s₁ : finmap β} {s₂ : finmap β} : a ∈ s₁ ∪ s₂ ↔ a ∈ s₁ ∨ a ∈ s₂ :=
induction_on₂ s₁ s₂ fun (_x _x_1 : alist β) => alist.mem_union
@[simp] theorem union_to_finmap {α : Type u} {β : α → Type v} [DecidableEq α] (s₁ : alist β) (s₂ : alist β) : alist.to_finmap s₁ ∪ alist.to_finmap s₂ = alist.to_finmap (s₁ ∪ s₂) := sorry
theorem keys_union {α : Type u} {β : α → Type v} [DecidableEq α] {s₁ : finmap β} {s₂ : finmap β} : keys (s₁ ∪ s₂) = keys s₁ ∪ keys s₂ := sorry
@[simp] theorem lookup_union_left {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {s₁ : finmap β} {s₂ : finmap β} : a ∈ s₁ → lookup a (s₁ ∪ s₂) = lookup a s₁ :=
induction_on₂ s₁ s₂ fun (s₁ s₂ : alist β) => alist.lookup_union_left
@[simp] theorem lookup_union_right {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {s₁ : finmap β} {s₂ : finmap β} : ¬a ∈ s₁ → lookup a (s₁ ∪ s₂) = lookup a s₂ :=
induction_on₂ s₁ s₂ fun (s₁ s₂ : alist β) => alist.lookup_union_right
theorem lookup_union_left_of_not_in {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {s₁ : finmap β} {s₂ : finmap β} (h : ¬a ∈ s₂) : lookup a (s₁ ∪ s₂) = lookup a s₁ := sorry
@[simp] theorem mem_lookup_union {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} {s₁ : finmap β} {s₂ : finmap β} : b ∈ lookup a (s₁ ∪ s₂) ↔ b ∈ lookup a s₁ ∨ ¬a ∈ s₁ ∧ b ∈ lookup a s₂ :=
induction_on₂ s₁ s₂ fun (s₁ s₂ : alist β) => alist.mem_lookup_union
theorem mem_lookup_union_middle {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} {s₁ : finmap β} {s₂ : finmap β} {s₃ : finmap β} : b ∈ lookup a (s₁ ∪ s₃) → ¬a ∈ s₂ → b ∈ lookup a (s₁ ∪ s₂ ∪ s₃) :=
induction_on₃ s₁ s₂ s₃ fun (s₁ s₂ s₃ : alist β) => alist.mem_lookup_union_middle
theorem insert_union {α : Type u} {β : α → Type v} [DecidableEq α] {a : α} {b : β a} {s₁ : finmap β} {s₂ : finmap β} : insert a b (s₁ ∪ s₂) = insert a b s₁ ∪ s₂ := sorry
theorem union_assoc {α : Type u} {β : α → Type v} [DecidableEq α] {s₁ : finmap β} {s₂ : finmap β} {s₃ : finmap β} : s₁ ∪ s₂ ∪ s₃ = s₁ ∪ (s₂ ∪ s₃) := sorry
@[simp] theorem empty_union {α : Type u} {β : α → Type v} [DecidableEq α] {s₁ : finmap β} : ∅ ∪ s₁ = s₁ := sorry
@[simp] theorem union_empty {α : Type u} {β : α → Type v} [DecidableEq α] {s₁ : finmap β} : s₁ ∪ ∅ = s₁ := sorry
theorem erase_union_singleton {α : Type u} {β : α → Type v} [DecidableEq α] (a : α) (b : β a) (s : finmap β) (h : lookup a s = some b) : erase a s ∪ singleton a b = s := sorry
/-! ### disjoint -/
/-- `disjoint s₁ s₂` holds if `s₁` and `s₂` have no keys in common. -/
def disjoint {α : Type u} {β : α → Type v} (s₁ : finmap β) (s₂ : finmap β) :=
∀ (x : α), x ∈ s₁ → ¬x ∈ s₂
theorem disjoint_empty {α : Type u} {β : α → Type v} (x : finmap β) : disjoint ∅ x :=
fun (x_1 : α) (H : x_1 ∈ ∅) (ᾰ : x_1 ∈ x) => false.dcases_on (fun (H : x_1 ∈ ∅) => False) H
theorem disjoint.symm {α : Type u} {β : α → Type v} (x : finmap β) (y : finmap β) (h : disjoint x y) : disjoint y x :=
fun (p : α) (hy : p ∈ y) (hx : p ∈ x) => h p hx hy
theorem disjoint.symm_iff {α : Type u} {β : α → Type v} (x : finmap β) (y : finmap β) : disjoint x y ↔ disjoint y x :=
{ mp := disjoint.symm x y, mpr := disjoint.symm y x }
protected instance disjoint.decidable_rel {α : Type u} {β : α → Type v} [DecidableEq α] : DecidableRel disjoint :=
fun (x y : finmap β) => id multiset.decidable_dforall_multiset
theorem disjoint_union_left {α : Type u} {β : α → Type v} [DecidableEq α] (x : finmap β) (y : finmap β) (z : finmap β) : disjoint (x ∪ y) z ↔ disjoint x z ∧ disjoint y z := sorry
theorem disjoint_union_right {α : Type u} {β : α → Type v} [DecidableEq α] (x : finmap β) (y : finmap β) (z : finmap β) : disjoint x (y ∪ z) ↔ disjoint x y ∧ disjoint x z := sorry
theorem union_comm_of_disjoint {α : Type u} {β : α → Type v} [DecidableEq α] {s₁ : finmap β} {s₂ : finmap β} : disjoint s₁ s₂ → s₁ ∪ s₂ = s₂ ∪ s₁ := sorry
theorem union_cancel {α : Type u} {β : α → Type v} [DecidableEq α] {s₁ : finmap β} {s₂ : finmap β} {s₃ : finmap β} (h : disjoint s₁ s₃) (h' : disjoint s₂ s₃) : s₁ ∪ s₃ = s₂ ∪ s₃ ↔ s₁ = s₂ := sorry
|
open import Algebra using (CommutativeMonoid)
open import Relation.Binary.Structures using (IsEquivalence)
open import Relation.Binary.PropositionalEquality using () renaming (cong to ≡-cong)
module AKS.Exponentiation {c ℓ} (M : CommutativeMonoid c ℓ) where
open import AKS.Nat using (ℕ; _+_; _<_)
open ℕ
open import AKS.Nat using (ℕ⁺; ℕ+; ⟅_⇓⟆)
open import AKS.Nat using (Acc; acc; <-well-founded)
open import AKS.Binary using (2*; 𝔹; 𝔹⁺; ⟦_⇑⟧; ⟦_⇓⟧; ⟦_⇑⟧⁺; ⟦_⇓⟧⁺; ℕ→𝔹→ℕ; ⌈log₂_⌉)
open 𝔹
open 𝔹⁺
open CommutativeMonoid M
using (_≈_; isEquivalence; setoid; ε; _∙_; ∙-cong; ∙-congˡ; identityˡ; identityʳ; assoc; comm)
renaming (Carrier to C)
open IsEquivalence isEquivalence using (refl; sym)
open import Relation.Binary.Reasoning.Setoid setoid
_^ⁱ_ : C → ℕ → C
x ^ⁱ zero = ε
x ^ⁱ suc n = x ∙ x ^ⁱ n
^ⁱ-homo : ∀ x n m → x ^ⁱ (n + m) ≈ x ^ⁱ n ∙ x ^ⁱ m
^ⁱ-homo x zero m = sym (identityˡ (x ^ⁱ m))
^ⁱ-homo x (suc n) m = begin
x ∙ x ^ⁱ (n + m) ≈⟨ ∙-congˡ (^ⁱ-homo x n m) ⟩
x ∙ (x ^ⁱ n ∙ x ^ⁱ m) ≈⟨ sym (assoc _ _ _) ⟩
x ∙ x ^ⁱ n ∙ x ^ⁱ m ∎
∙-^ⁱ-dist : ∀ x y n → (x ∙ y) ^ⁱ n ≈ x ^ⁱ n ∙ y ^ⁱ n
∙-^ⁱ-dist x y zero = sym (identityˡ ε)
∙-^ⁱ-dist x y (suc n) = begin
x ∙ y ∙ ((x ∙ y) ^ⁱ n) ≈⟨ ∙-congˡ (∙-^ⁱ-dist x y n) ⟩
x ∙ y ∙ (x ^ⁱ n ∙ y ^ⁱ n) ≈⟨ assoc _ _ _ ⟩
x ∙ (y ∙ (x ^ⁱ n ∙ y ^ⁱ n)) ≈⟨ ∙-congˡ (comm _ _) ⟩
x ∙ (x ^ⁱ n ∙ y ^ⁱ n ∙ y) ≈⟨ ∙-congˡ (assoc _ _ _) ⟩
x ∙ (x ^ⁱ n ∙ (y ^ⁱ n ∙ y)) ≈⟨ ∙-congˡ (∙-congˡ (comm _ _)) ⟩
x ∙ (x ^ⁱ n ∙ (y ∙ y ^ⁱ n)) ≈⟨ sym (assoc _ _ _) ⟩
x ∙ (x ^ⁱ n) ∙ (y ∙ (y ^ⁱ n)) ∎
_^ᵇ⁺_ : C → 𝔹⁺ → C
x ^ᵇ⁺ 𝕓1ᵇ = x
x ^ᵇ⁺ (b 0ᵇ) = (x ∙ x) ^ᵇ⁺ b
x ^ᵇ⁺ (b 1ᵇ) = x ∙ (x ∙ x) ^ᵇ⁺ b
_^ᵇ_ : C → 𝔹 → C
x ^ᵇ 𝕓0ᵇ = ε
x ^ᵇ (+ b) = x ^ᵇ⁺ b
_^⁺_ : C → ℕ⁺ → C
x ^⁺ n = x ^ᵇ⁺ ⟦ n ⇑⟧⁺
_^_ : C → ℕ → C
x ^ n = x ^ᵇ ⟦ n ⇑⟧
x^n≈x^ⁱn : ∀ x n → x ^ n ≈ x ^ⁱ n
x^n≈x^ⁱn x n = begin
x ^ n ≈⟨ loop x ⟦ n ⇑⟧ ⟩
x ^ⁱ ⟦ ⟦ n ⇑⟧ ⇓⟧ ≡⟨ ≡-cong (λ t → x ^ⁱ t) (ℕ→𝔹→ℕ n) ⟩
x ^ⁱ n ∎
where
even : ∀ x b → (x ∙ x) ^ᵇ⁺ b ≈ x ^ⁱ 2* ⟦ b ⇓⟧⁺
loop⁺ : ∀ x b → x ^ᵇ⁺ b ≈ x ^ⁱ ⟦ b ⇓⟧⁺
even x b = begin
(x ∙ x) ^ᵇ⁺ b ≈⟨ loop⁺ (x ∙ x) b ⟩
(x ∙ x) ^ⁱ ⟦ b ⇓⟧⁺ ≈⟨ ∙-^ⁱ-dist x x ⟦ b ⇓⟧⁺ ⟩
x ^ⁱ ⟦ b ⇓⟧⁺ ∙ x ^ⁱ ⟦ b ⇓⟧⁺ ≈⟨ sym (^ⁱ-homo x ⟦ b ⇓⟧⁺ ⟦ b ⇓⟧⁺) ⟩
x ^ⁱ 2* ⟦ b ⇓⟧⁺ ∎
loop⁺ x 𝕓1ᵇ = sym (identityʳ x)
loop⁺ x (b 0ᵇ) = even x b
loop⁺ x (b 1ᵇ) = ∙-congˡ (even x b)
loop : ∀ x b → x ^ᵇ b ≈ x ^ⁱ ⟦ b ⇓⟧
loop x 𝕓0ᵇ = refl
loop x (+ b) = loop⁺ x b
^-homo : ∀ x n m → x ^ (n + m) ≈ x ^ n ∙ x ^ m
^-homo x n m = begin
x ^ (n + m) ≈⟨ x^n≈x^ⁱn x (n + m) ⟩
x ^ⁱ (n + m) ≈⟨ ^ⁱ-homo x n m ⟩
x ^ⁱ n ∙ x ^ⁱ m ≈⟨ ∙-cong (sym (x^n≈x^ⁱn x n)) (sym (x^n≈x^ⁱn x m)) ⟩
x ^ n ∙ x ^ m ∎
x^n≈x^⁺n : ∀ x n → x ^ ⟅ n ⇓⟆ ≈ x ^⁺ n
x^n≈x^⁺n x (ℕ+ n) = refl
^-^⁺-homo : ∀ x n m → x ^ (n + ⟅ m ⇓⟆) ≈ x ^ n ∙ x ^⁺ m
^-^⁺-homo x n (ℕ+ m) = ^-homo x n (suc m)
|
\section{Calendar}
\label{sec:calendar}
The calendar is a new feature in \salespoint{} to manage appointments and events.
Figure~\ref{calendar_overview} shows the UML model of the calendar.
\begin{figure}[ht]
\centering
\includegraphics[width=1.0\textwidth]{images/Calendar_Overview.eps}
\label{calendar_overview}
\caption{Calendar - Class Overview}
\end{figure}
\code{Calendar} is an interface that provides simple functionality to store and retrieve \code{CalendarEntry}s.
\code{CalendarEntry} is an interface to set, store and access information of a single appointment/event.
Both interfaces are implemented by \code{PersistentCalendar} and \code{PersistentCalendarEntry}, respectively.
\code{PersistentCalendarEntry} is a persistence entity containing all information and \code{PersistentCalendar} manages the JPA access.
\\
Every calendar entry is uniquely identified by a \code{CalendarEntryIdentifier}.
This identifier also serves as primary key attribute when persisting an entry to the database.
Additionally, a \code{PersistentCalendarEntry} must have an owner, a title, a start and an end date.
The user who created the entry is known as the owner and identified by \code{ownerID} of the type \code{UserIdentifier}.
\\
The access of other users than the owner to a calendar entry is restricted by capabilities.
For each calendar entry, a user identifier and a set of capabilities are stored.
Possible capabilities are:
\begin{itemize}
\item \code{READ} - indicates if a user can read this entry
\item \code{WRITE} - indicates if a user can change this entry
\item \code{DELETE} - indicates if a user can delete this entry
\item \code{SHARE} - indicates if a user can share this entry with other users
\end{itemize}.
Because \salespoint{} only implements the model of the MVC pattern (see Section~\ref{spring}), the developer has to check and enforce capabilities in the controller.
\\
Besides the minimum information of owner, title, start and end a calendar entry can also have a description, which may contain more information.
Periodic appointments are also supported, by specifing the number of repetitions (\code{count} in Figure~\ref{calendar_overview}) and a time span between two appointments (\code{period} in Figure~\ref{calendar_overview}).
\\
There are some conditions for temporal attributes of an calendar entry:
\begin{itemize}
\item the start must not be after the end
\item the time between two repetitions of an appointment need to be longer than the duration of the appointment, so that appointments do not overlap
\end{itemize}
%All attributes of the entry can be changed, except of the owner, who will be defined when the entry is created and then becomes immutable.
|
library(phybase)
mptree1 = "(buffalo:9.181499,((yak:1.905599,(bison:1.014857,wisent:1.014857):0.890742):0.275900,(cattle:1,indicus:1):1.181499):7.000000);"
spname <- species.name(mptree1)
nodematrix <- read.tree.nodes(str=mptree1, name=spname)$nodes
nodematrix[,5]<-2
genetrees=1:200000
for(i in 1:200000)
genetrees[i]<-sim.coaltree.sp(rootnode=11, nodematrix=nodematrix,nspecies=6,seq=rep(1,6), name=spname)$gt
write(genetrees,"wisent_simulated.tre")
|
{-# OPTIONS --without-K --safe #-}
module Definition.Conversion.Stability where
open import Definition.Untyped
open import Definition.Untyped.Properties
open import Definition.Typed
open import Definition.Typed.Weakening
open import Definition.Conversion
open import Definition.Conversion.Soundness
open import Definition.Typed.Consequences.Syntactic
open import Definition.Typed.Consequences.Substitution
open import Tools.Product
import Tools.PropositionalEquality as PE
-- Equality of contexts.
data ⊢_≡_ : (Γ Δ : Con Term) → Set where
ε : ⊢ ε ≡ ε
_∙_ : ∀ {Γ Δ A B} → ⊢ Γ ≡ Δ → Γ ⊢ A ≡ B → ⊢ Γ ∙ A ≡ Δ ∙ B
mutual
-- Syntactic validity and conversion substitution of a context equality.
contextConvSubst : ∀ {Γ Δ} → ⊢ Γ ≡ Δ → ⊢ Γ × ⊢ Δ × Δ ⊢ˢ idSubst ∷ Γ
contextConvSubst ε = ε , ε , id
contextConvSubst (_∙_ {Γ} {Δ} {A} {B} Γ≡Δ A≡B) =
let ⊢Γ , ⊢Δ , [σ] = contextConvSubst Γ≡Δ
⊢A , ⊢B = syntacticEq A≡B
Δ⊢B = stability Γ≡Δ ⊢B
in ⊢Γ ∙ ⊢A , ⊢Δ ∙ Δ⊢B
, (wk1Subst′ ⊢Γ ⊢Δ Δ⊢B [σ]
, conv (var (⊢Δ ∙ Δ⊢B) here)
(PE.subst (λ x → _ ⊢ _ ≡ x)
(wk1-tailId A)
(wkEq (step id) (⊢Δ ∙ Δ⊢B) (stabilityEq Γ≡Δ (sym A≡B)))))
-- Stability of types under equal contexts.
stability : ∀ {A Γ Δ} → ⊢ Γ ≡ Δ → Γ ⊢ A → Δ ⊢ A
stability Γ≡Δ A =
let ⊢Γ , ⊢Δ , σ = contextConvSubst Γ≡Δ
q = substitution A σ ⊢Δ
in PE.subst (λ x → _ ⊢ x) (subst-id _) q
-- Stability of type equality.
stabilityEq : ∀ {A B Γ Δ} → ⊢ Γ ≡ Δ → Γ ⊢ A ≡ B → Δ ⊢ A ≡ B
stabilityEq Γ≡Δ A≡B =
let ⊢Γ , ⊢Δ , σ = contextConvSubst Γ≡Δ
q = substitutionEq A≡B (substRefl σ) ⊢Δ
in PE.subst₂ (λ x y → _ ⊢ x ≡ y) (subst-id _) (subst-id _) q
-- Reflexivity of context equality.
reflConEq : ∀ {Γ} → ⊢ Γ → ⊢ Γ ≡ Γ
reflConEq ε = ε
reflConEq (⊢Γ ∙ ⊢A) = reflConEq ⊢Γ ∙ refl ⊢A
-- Symmetry of context equality.
symConEq : ∀ {Γ Δ} → ⊢ Γ ≡ Δ → ⊢ Δ ≡ Γ
symConEq ε = ε
symConEq (Γ≡Δ ∙ A≡B) = symConEq Γ≡Δ ∙ stabilityEq Γ≡Δ (sym A≡B)
-- Stability of terms.
stabilityTerm : ∀ {t A Γ Δ} → ⊢ Γ ≡ Δ → Γ ⊢ t ∷ A → Δ ⊢ t ∷ A
stabilityTerm Γ≡Δ t =
let ⊢Γ , ⊢Δ , σ = contextConvSubst Γ≡Δ
q = substitutionTerm t σ ⊢Δ
in PE.subst₂ (λ x y → _ ⊢ x ∷ y) (subst-id _) (subst-id _) q
-- Stability of term reduction.
stabilityRedTerm : ∀ {t u A Γ Δ} → ⊢ Γ ≡ Δ → Γ ⊢ t ⇒ u ∷ A → Δ ⊢ t ⇒ u ∷ A
stabilityRedTerm Γ≡Δ (conv d x) =
conv (stabilityRedTerm Γ≡Δ d) (stabilityEq Γ≡Δ x)
stabilityRedTerm Γ≡Δ (app-subst d x) =
app-subst (stabilityRedTerm Γ≡Δ d) (stabilityTerm Γ≡Δ x)
stabilityRedTerm Γ≡Δ (fst-subst ⊢F ⊢G t⇒) =
fst-subst (stability Γ≡Δ ⊢F)
(stability (Γ≡Δ ∙ refl ⊢F) ⊢G)
(stabilityRedTerm Γ≡Δ t⇒)
stabilityRedTerm Γ≡Δ (snd-subst ⊢F ⊢G t⇒) =
snd-subst (stability Γ≡Δ ⊢F)
(stability (Γ≡Δ ∙ refl ⊢F) ⊢G)
(stabilityRedTerm Γ≡Δ t⇒)
stabilityRedTerm Γ≡Δ (Σ-β₁ ⊢F ⊢G ⊢t ⊢u) =
Σ-β₁ (stability Γ≡Δ ⊢F)
(stability (Γ≡Δ ∙ refl ⊢F) ⊢G)
(stabilityTerm Γ≡Δ ⊢t)
(stabilityTerm Γ≡Δ ⊢u)
stabilityRedTerm Γ≡Δ (Σ-β₂ ⊢F ⊢G ⊢t ⊢u) =
Σ-β₂ (stability Γ≡Δ ⊢F)
(stability (Γ≡Δ ∙ refl ⊢F) ⊢G)
(stabilityTerm Γ≡Δ ⊢t)
(stabilityTerm Γ≡Δ ⊢u)
stabilityRedTerm Γ≡Δ (β-red x x₁ x₂) =
β-red (stability Γ≡Δ x) (stabilityTerm (Γ≡Δ ∙ refl x) x₁)
(stabilityTerm Γ≡Δ x₂)
stabilityRedTerm Γ≡Δ (natrec-subst x x₁ x₂ d) =
let ⊢Γ , _ , _ = contextConvSubst Γ≡Δ
in natrec-subst (stability (Γ≡Δ ∙ refl (ℕⱼ ⊢Γ)) x) (stabilityTerm Γ≡Δ x₁)
(stabilityTerm Γ≡Δ x₂) (stabilityRedTerm Γ≡Δ d)
stabilityRedTerm Γ≡Δ (natrec-zero x x₁ x₂) =
let ⊢Γ , _ , _ = contextConvSubst Γ≡Δ
in natrec-zero (stability (Γ≡Δ ∙ refl (ℕⱼ ⊢Γ)) x) (stabilityTerm Γ≡Δ x₁)
(stabilityTerm Γ≡Δ x₂)
stabilityRedTerm Γ≡Δ (natrec-suc x x₁ x₂ x₃) =
let ⊢Γ , _ , _ = contextConvSubst Γ≡Δ
in natrec-suc (stabilityTerm Γ≡Δ x) (stability (Γ≡Δ ∙ refl (ℕⱼ ⊢Γ)) x₁)
(stabilityTerm Γ≡Δ x₂) (stabilityTerm Γ≡Δ x₃)
stabilityRedTerm Γ≡Δ (Emptyrec-subst x d) =
Emptyrec-subst (stability Γ≡Δ x) (stabilityRedTerm Γ≡Δ d)
-- Stability of type reductions.
stabilityRed : ∀ {A B Γ Δ} → ⊢ Γ ≡ Δ → Γ ⊢ A ⇒ B → Δ ⊢ A ⇒ B
stabilityRed Γ≡Δ (univ x) = univ (stabilityRedTerm Γ≡Δ x)
-- Stability of type reduction closures.
stabilityRed* : ∀ {A B Γ Δ} → ⊢ Γ ≡ Δ → Γ ⊢ A ⇒* B → Δ ⊢ A ⇒* B
stabilityRed* Γ≡Δ (id x) = id (stability Γ≡Δ x)
stabilityRed* Γ≡Δ (x ⇨ D) = stabilityRed Γ≡Δ x ⇨ stabilityRed* Γ≡Δ D
-- Stability of term reduction closures.
stabilityRed*Term : ∀ {t u A Γ Δ} → ⊢ Γ ≡ Δ → Γ ⊢ t ⇒* u ∷ A → Δ ⊢ t ⇒* u ∷ A
stabilityRed*Term Γ≡Δ (id x) = id (stabilityTerm Γ≡Δ x)
stabilityRed*Term Γ≡Δ (x ⇨ d) = stabilityRedTerm Γ≡Δ x ⇨ stabilityRed*Term Γ≡Δ d
mutual
-- Stability of algorithmic equality of neutrals.
stability~↑ : ∀ {k l A Γ Δ}
→ ⊢ Γ ≡ Δ
→ Γ ⊢ k ~ l ↑ A
→ Δ ⊢ k ~ l ↑ A
stability~↑ Γ≡Δ (var-refl x x≡y) =
var-refl (stabilityTerm Γ≡Δ x) x≡y
stability~↑ Γ≡Δ (app-cong k~l x) =
app-cong (stability~↓ Γ≡Δ k~l) (stabilityConv↑Term Γ≡Δ x)
stability~↑ Γ≡Δ (fst-cong p~r) =
fst-cong (stability~↓ Γ≡Δ p~r)
stability~↑ Γ≡Δ (snd-cong p~r) =
snd-cong (stability~↓ Γ≡Δ p~r)
stability~↑ Γ≡Δ (natrec-cong x₁ x₂ x₃ k~l) =
let ⊢Γ , _ , _ = contextConvSubst Γ≡Δ
in natrec-cong (stabilityConv↑ (Γ≡Δ ∙ (refl (ℕⱼ ⊢Γ))) x₁)
(stabilityConv↑Term Γ≡Δ x₂)
(stabilityConv↑Term Γ≡Δ x₃)
(stability~↓ Γ≡Δ k~l)
stability~↑ Γ≡Δ (Emptyrec-cong x₁ k~l) =
Emptyrec-cong (stabilityConv↑ Γ≡Δ x₁)
(stability~↓ Γ≡Δ k~l)
-- Stability of algorithmic equality of neutrals of types in WHNF.
stability~↓ : ∀ {k l A Γ Δ}
→ ⊢ Γ ≡ Δ
→ Γ ⊢ k ~ l ↓ A
→ Δ ⊢ k ~ l ↓ A
stability~↓ Γ≡Δ ([~] A D whnfA k~l) =
[~] A (stabilityRed* Γ≡Δ D) whnfA (stability~↑ Γ≡Δ k~l)
-- Stability of algorithmic equality of types.
stabilityConv↑ : ∀ {A B Γ Δ}
→ ⊢ Γ ≡ Δ
→ Γ ⊢ A [conv↑] B
→ Δ ⊢ A [conv↑] B
stabilityConv↑ Γ≡Δ ([↑] A′ B′ D D′ whnfA′ whnfB′ A′<>B′) =
[↑] A′ B′ (stabilityRed* Γ≡Δ D) (stabilityRed* Γ≡Δ D′) whnfA′ whnfB′
(stabilityConv↓ Γ≡Δ A′<>B′)
-- Stability of algorithmic equality of types in WHNF.
stabilityConv↓ : ∀ {A B Γ Δ}
→ ⊢ Γ ≡ Δ
→ Γ ⊢ A [conv↓] B
→ Δ ⊢ A [conv↓] B
stabilityConv↓ Γ≡Δ (U-refl x) =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ
in U-refl ⊢Δ
stabilityConv↓ Γ≡Δ (ℕ-refl x) =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ
in ℕ-refl ⊢Δ
stabilityConv↓ Γ≡Δ (Empty-refl x) =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ
in Empty-refl ⊢Δ
stabilityConv↓ Γ≡Δ (Unit-refl x) =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ
in Unit-refl ⊢Δ
stabilityConv↓ Γ≡Δ (ne x) =
ne (stability~↓ Γ≡Δ x)
stabilityConv↓ Γ≡Δ (Π-cong F A<>B A<>B₁) =
Π-cong (stability Γ≡Δ F) (stabilityConv↑ Γ≡Δ A<>B)
(stabilityConv↑ (Γ≡Δ ∙ refl F) A<>B₁)
stabilityConv↓ Γ≡Δ (Σ-cong F A<>B A<>B₁) =
Σ-cong (stability Γ≡Δ F) (stabilityConv↑ Γ≡Δ A<>B)
(stabilityConv↑ (Γ≡Δ ∙ refl F) A<>B₁)
-- Stability of algorithmic equality of terms.
stabilityConv↑Term : ∀ {t u A Γ Δ}
→ ⊢ Γ ≡ Δ
→ Γ ⊢ t [conv↑] u ∷ A
→ Δ ⊢ t [conv↑] u ∷ A
stabilityConv↑Term Γ≡Δ ([↑]ₜ B t′ u′ D d d′ whnfB whnft′ whnfu′ t<>u) =
[↑]ₜ B t′ u′ (stabilityRed* Γ≡Δ D) (stabilityRed*Term Γ≡Δ d)
(stabilityRed*Term Γ≡Δ d′) whnfB whnft′ whnfu′
(stabilityConv↓Term Γ≡Δ t<>u)
-- Stability of algorithmic equality of terms in WHNF.
stabilityConv↓Term : ∀ {t u A Γ Δ}
→ ⊢ Γ ≡ Δ
→ Γ ⊢ t [conv↓] u ∷ A
→ Δ ⊢ t [conv↓] u ∷ A
stabilityConv↓Term Γ≡Δ (ℕ-ins x) =
ℕ-ins (stability~↓ Γ≡Δ x)
stabilityConv↓Term Γ≡Δ (Empty-ins x) =
Empty-ins (stability~↓ Γ≡Δ x)
stabilityConv↓Term Γ≡Δ (Unit-ins x) =
Unit-ins (stability~↓ Γ≡Δ x)
stabilityConv↓Term Γ≡Δ (ne-ins t u neN x) =
ne-ins (stabilityTerm Γ≡Δ t) (stabilityTerm Γ≡Δ u) neN (stability~↓ Γ≡Δ x)
stabilityConv↓Term Γ≡Δ (univ x x₁ x₂) =
univ (stabilityTerm Γ≡Δ x) (stabilityTerm Γ≡Δ x₁) (stabilityConv↓ Γ≡Δ x₂)
stabilityConv↓Term Γ≡Δ (zero-refl x) =
let _ , ⊢Δ , _ = contextConvSubst Γ≡Δ
in zero-refl ⊢Δ
stabilityConv↓Term Γ≡Δ (suc-cong t<>u) = suc-cong (stabilityConv↑Term Γ≡Δ t<>u)
stabilityConv↓Term Γ≡Δ (η-eq x x₁ y y₁ t<>u) =
let ⊢F , ⊢G = syntacticΠ (syntacticTerm x)
in η-eq (stabilityTerm Γ≡Δ x) (stabilityTerm Γ≡Δ x₁)
y y₁ (stabilityConv↑Term (Γ≡Δ ∙ refl ⊢F) t<>u)
stabilityConv↓Term Γ≡Δ (Σ-η ⊢p ⊢r pProd rProd fstConv sndConv) =
Σ-η (stabilityTerm Γ≡Δ ⊢p) (stabilityTerm Γ≡Δ ⊢r)
pProd rProd
(stabilityConv↑Term Γ≡Δ fstConv) (stabilityConv↑Term Γ≡Δ sndConv)
stabilityConv↓Term Γ≡Δ (η-unit [t] [u] tUnit uUnit) =
let [t] = stabilityTerm Γ≡Δ [t]
[u] = stabilityTerm Γ≡Δ [u]
in η-unit [t] [u] tUnit uUnit
|
lemma lim_inverse_n: "((\<lambda>n. inverse(of_nat n)) \<longlongrightarrow> (0::'a::real_normed_field)) sequentially" |
.on_load = function (ns) {
cat('a/__init__.r\n')
}
#' @export
which = function () 'nested/a'
|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#include "Map.h"
#include "MapPoint.h"
#include "MappingKeyframe.h"
#include "InitializationData.h"
#include "Tracking\KeyframeBuilder.h"
#include "Mapping\MapPointKeyframeAssociations.h"
#include "BoW\OnlineBow.h"
#include "BoW\BaseFeatureMatcher.h"
#include "BundleAdjustment\BundleAdjust.h"
#include "Data\Types.h"
#include "Data\Pose.h"
#include "Data\Data.h"
#include "Data\MapState.h"
#include "Utils\historical_queue.h"
#include "Utils\collection.h"
#include <arcana\threading\blocking_concurrent_queue.h>
#include <gsl\gsl>
#include <shared_mutex>
#include <vector>
#include <set>
// forward-declare the friend class method for accessing the root map in unit tests
namespace UnitTests
{
class TestHelperFunctions;
}
namespace mage
{
class ThreadSafeMap
{
friend class ::UnitTests::TestHelperFunctions;
public:
ThreadSafeMap(
const MageSlamSettings& settings, BaseBow& bagOfWords);
~ThreadSafeMap();
void InitializeMap(const InitializationData& initializationData, thread_memory memory);
void GetConnectedMapPoints(
const collection<Proxy<MapPoint>>& points,
thread_memory memory,
loop::vector<KeyframeReprojection>& repro) const;
// returns a sampling of mappoints
void GetSampleOfMapPoints(temp::vector<MapPointProxy>& mapPoints, uint32_t max, uint32_t offset = 0) const;
/*
Inserts a new keyframe and returns all the keyframes that
are connected to this one by the covisibility graph.
*/
Proxy<Keyframe, proxy::Image> InsertKeyframe(
const std::shared_ptr<const KeyframeBuilder>& kb,
thread_memory memory);
/*
Inserts a new keyframe and returns all the keyframes that
are connected to this one by the covisibility graph.
*/
Proxy<Keyframe, proxy::Image> InsertKeyframe(
const std::shared_ptr<const KeyframeBuilder>& keyframe,
const gsl::span<MapPointAssociations<MapPointTrackingProxy>::Association>& extraAssociation,
thread_memory memory);
std::unique_ptr<KeyframeProxy> GetKeyFrameProxy(const Id<Keyframe>& kId) const;
/*
Merge information from a set of posited keyframes into the actual keyframes.
*/
void UpdateKeyframesFromProxies(
gsl::span<const KeyframeProxy> proxies,
const OrbMatcherSettings& mergeSettings,
std::unordered_map<Id<MapPoint>, MapPointTrackingProxy>& mapPointMerges,
thread_memory memory);
/*
Updates the state of the map points in the KeyframeProxy based on the current
information in the map.
*/
void UpdateMapPoints(KeyframeProxy& proxy) const;
/*
Builds a global bundle adjust dataset of everything in the map.
NOTE: Fixes the position of fixed and distance-tethered keyframes to preserve some semblance
of consistent scale.
*/
void BuildGlobalBundleAdjustData(AdjustableData& data) const;
/*
Retrieves keyframes similar to the image provided.
*/
void FindSimilarKeyframes(const std::shared_ptr<const AnalyzedImage>& image, std::vector<KeyframeProxy>& output) const;
void FindNonCovisibleSimilarKeyframeClusters(const KeyframeProxy& proxy, thread_memory memory, std::vector<std::vector<KeyframeProxy>>& output) const;
/*
Culls map points based on requirements related to number of keyframes they are visibile in and the results found in tracking
Takes a list of points that have failed to appear where predicted during tracking to remove as well
*/
void CullRecentMapPoints(
const Id<Keyframe>& ki,
const mira::unique_vector<Id<MapPoint>>& recentFailedMapPoints,
thread_memory memory);
/*
Return the collection of all the map points
*/
void GetMapPointsAsPositions(std::vector<Position>& positions) const;
/*
Return the number of map points in the map
*/
size_t GetMapPointsCount() const;
/*
Return the number of keyframes in the map
*/
size_t GetKeyframesCount() const;
/*
Return the collection of all the keyframes
*/
void GetKeyframeViewMatrices(std::vector<Matrix>& viewMatrices) const;
/*
Creates the map points passed in and returns the keyframes that
were added to the frames connected to Ki through the covis graph
*/
std::vector<MappingKeyframe> CreateMapPoints(
const Id<Keyframe>& keyframeId,
const gsl::span<const MapPointKeyframeAssociations >& toCreate,
thread_memory memory);
/*
Returns all the map points seen by this keyframe and the ones
seen by it's neighbours in the covisibility graph. It then returns
all the keyframes that see those points and aren't in Ki's covis graph.
*/
unsigned int GetMapPointsAndDistantKeyframes(
const Id<Keyframe>& Ki,
unsigned int coVisTheta,
thread_memory memory,
std::vector<MapPointTrackingProxy>& mapPoints,
std::vector<Proxy<Keyframe, proxy::Pose, proxy::Intrinsics, proxy::PoseConstraints>>& keyframes,
std::vector<MapPointAssociation>& mapPointAssociations,
std::vector<Id<Keyframe>>& externallyTetheredKeyframes) const;
/*
Updates all the map point positions and keyframe poses and
destroys all the MapPoint outliers (Not sure if we actually destroy them or not).
*/
void AdjustPosesAndMapPoints(
const AdjustableData& adjusted,
gsl::span<const std::pair<Id<MapPoint>, Id<Keyframe>>> outlierAssociations,
thread_memory memory);
/*
Discards the duplicate keyframes that are
connected to Ki in the covisibility graph.
Returns the KeyframeIds that were removed as well as the covisability which lead to the removal decision if argument provided
*/
void CullLocalKeyframes(
Id<Keyframe> Ki,
thread_memory memory,
std::vector<std::pair<const Id<Keyframe>, const std::vector<Id<Keyframe>>>>* cullingDecisions = nullptr);
/*
gets keyframes connected to KId in the covisibility graph (more than the minimum required
map points in common to be entered as a link in the covisibility graph)
*/
void GetCovisibilityConnectedKeyframes(
const Id<Keyframe>& kId,
thread_memory memory,
std::vector<MappingKeyframe>& kc) const;
/*
gets the list of recent points the mapping thread is still carefully evaluating. track local map
will use this to collect more information on these points for use by the mapping thread, and the
age of each of these map points
*/
std::map<Id<MapPoint>, unsigned int> GetRecentlyCreatedMapPoints() const;
/*
* Will attempt to match the set of map points into the set of keyframes if matching criterea are met
*/
void TryConnectMapPoints(gsl::span<const MapPointAssociations<MapPointTrackingProxy>::Association> mapPointAssociations,
const Id<Keyframe>& insertedKeyframe,
const TrackLocalMapSettings& trackLocalMapSettings,
const OrbMatcherSettings& orbMatcherSettings,
float searchRadius,
thread_memory memory);
/*
Delete the state of the entire map
*/
void Clear(thread_memory memory);
/*
Returns all the information pertinent when saving the map
*/
MapState GetMapData() const;
float GetMedianTetherDistance() const;
float GetMapScale() const;
/*
Returns all the keyframes in the map
*/
std::vector<KeyframeProxy> GetAllKeyframes() const;
/*
Destroys this instance of the thread safe map and returns it's
internal map for use in another context.
*/
static std::unique_ptr<Map> Release(std::unique_ptr<ThreadSafeMap> tsm);
private:
void UnSafeGetCovisibilityConnectedKeyframes(
const Id<Keyframe>& kId,
thread_memory memory,
std::vector<MappingKeyframe>& kc) const;
// the int value is the number of Keyframes this map point has existed for
std::map<Id<MapPoint>, unsigned int> UnSafeGetRecentlyCreatedMapPoints() const;
/*
Performs all the logic for AdjustPosesAndMapPoints, but does not take its own
lock and so can be used by other methods as well.
*/
void UnSafeAdjustPosesAndMapPoints(
const AdjustableData& adjusted,
gsl::span<const std::pair<Id<MapPoint>, Id<Keyframe>>> outlierAssociations,
thread_memory memory);
// vector to record map point creations for map point culling
historical_queue<std::vector<Proxy<MapPoint>>, 3> m_pointHistory;
const KeyframeSettings& m_keyframeSettings;
const MappingSettings& m_mappingSettings;
const CovisibilitySettings& m_covisibilitySettings;
const BundleAdjustSettings& m_bundleAdjustSettings;
mutable std::shared_mutex m_mutex;
std::unique_ptr<Map> m_map;
BaseBow& m_bow;
float m_mapScale;
};
}
|
[STATEMENT]
lemma swap_registers:
assumes "compatible R S"
shows "R a *\<^sub>u S b = S b *\<^sub>u R a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. R a *\<^sub>u S b = S b *\<^sub>u R a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compatible R S
goal (1 subgoal):
1. R a *\<^sub>u S b = S b *\<^sub>u R a
[PROOF STEP]
unfolding compatible_def
[PROOF STATE]
proof (prove)
using this:
register R \<and> register S \<and> (\<forall>a b. R a *\<^sub>u S b = S b *\<^sub>u R a)
goal (1 subgoal):
1. R a *\<^sub>u S b = S b *\<^sub>u R a
[PROOF STEP]
by metis |
The facial decorations that previously defined the singer's visage are long gone.
Remember Disturbed frontman David Draiman‘s sweet chin piercings? Those things were the dude’s calling card back in the day. Yet the metallic decorations haven’t seen the metal singer’s face for quite some time. But why, David, why?
Well, as the musician explains to Deutsche Welle and as reported on by Loudwire, it’s all just a matter of acting your age. That, and not looking like you just stepped out of the local mall sporting Tripp pants, waiting for your mom to pick you up.
In other Disturbed news, someone recently made a viral video that shows Lady Gaga “singing” Disturbed’s signature The Sickness single “Down With The Sickness” in a crazy movie preview mash-up of A Star Is Born. See it below!
And, right now, Disturbed are gearing up to release their seventh studio album Evolution. See the band’s upcoming fall tour dates here, and view the previously announced list of cities for the group’s imminent Evolution Tour 2019 below. |
/-
Copyright (c) 2022 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
! This file was ported from Lean 3 source module data.real.enat_ennreal
! leanprover-community/mathlib commit 53b216bcc1146df1c4a0a86877890ea9f1f01589
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Data.ENat.Basic
import Mathlib.Data.Real.ENNReal
/-!
# Coercion from `ℕ∞` to `ℝ≥0∞`
In this file we define a coercion from `ℕ∞` to `ℝ≥0∞` and prove some basic lemmas about this map.
-/
open Classical NNReal ENNReal
noncomputable section
namespace ENat
variable {m n : ℕ∞}
/-- Coercion from `ℕ∞` to `ℝ≥0∞`. -/
@[coe] def toENNReal : ℕ∞ → ℝ≥0∞ := WithTop.map Nat.cast
instance hasCoeENNReal : CoeTC ℕ∞ ℝ≥0∞ := ⟨toENNReal⟩
#align enat.has_coe_ennreal ENat.hasCoeENNReal
@[simp]
theorem map_coe_nnreal : WithTop.map ((↑) : ℕ → ℝ≥0) = ((↑) : ℕ∞ → ℝ≥0∞) :=
rfl
#align enat.map_coe_nnreal ENat.map_coe_nnreal
/-- Coercion `ℕ∞ → ℝ≥0∞` as an `order_embedding`. -/
@[simps! (config := { fullyApplied := false })]
def toENNRealOrderEmbedding : ℕ∞ ↪o ℝ≥0∞ :=
Nat.castOrderEmbedding.withTopMap
#align enat.to_ennreal_order_embedding ENat.toENNRealOrderEmbedding
/-- Coercion `ℕ∞ → ℝ≥0∞` as a ring homomorphism. -/
@[simps! (config := { fullyApplied := false })]
def toENNRealRingHom : ℕ∞ →+* ℝ≥0∞ :=
.withTopMap (Nat.castRingHom ℝ≥0) Nat.cast_injective
#align enat.to_ennreal_ring_hom ENat.toENNRealRingHom
@[simp, norm_cast]
theorem toENNReal_top : ((⊤ : ℕ∞) : ℝ≥0∞) = ⊤ :=
rfl
#align enat.coe_ennreal_top ENat.toENNReal_top
@[simp, norm_cast]
theorem toENNReal_coe (n : ℕ) : ((n : ℕ∞) : ℝ≥0∞) = n :=
rfl
#align enat.coe_ennreal_coe ENat.toENNReal_coe
@[simp, norm_cast]
theorem toENNReal_ofNat (n : ℕ) [n.AtLeastTwo] : ((OfNat.ofNat n : ℕ∞) : ℝ≥0∞) = OfNat.ofNat n :=
rfl
@[simp, norm_cast]
theorem toENNReal_le : (m : ℝ≥0∞) ≤ n ↔ m ≤ n :=
toENNRealOrderEmbedding.le_iff_le
#align enat.coe_ennreal_le ENat.toENNReal_le
@[simp, norm_cast]
theorem toENNReal_lt : (m : ℝ≥0∞) < n ↔ m < n :=
toENNRealOrderEmbedding.lt_iff_lt
#align enat.coe_ennreal_lt ENat.toENNReal_lt
@[mono]
theorem toENNReal_mono : Monotone ((↑) : ℕ∞ → ℝ≥0∞) :=
toENNRealOrderEmbedding.monotone
#align enat.coe_ennreal_mono ENat.toENNReal_mono
@[mono]
theorem toENNReal_strictMono : StrictMono ((↑) : ℕ∞ → ℝ≥0∞) :=
toENNRealOrderEmbedding.strictMono
#align enat.coe_ennreal_strict_mono ENat.toENNReal_strictMono
@[simp, norm_cast]
theorem toENNReal_zero : ((0 : ℕ∞) : ℝ≥0∞) = 0 :=
map_zero toENNRealRingHom
#align enat.coe_ennreal_zero ENat.toENNReal_zero
@[simp]
theorem toENNReal_add (m n : ℕ∞) : ↑(m + n) = (m + n : ℝ≥0∞) :=
map_add toENNRealRingHom m n
#align enat.coe_ennreal_add ENat.toENNReal_add
@[simp]
theorem toENNReal_one : ((1 : ℕ∞) : ℝ≥0∞) = 1 :=
map_one toENNRealRingHom
#align enat.coe_ennreal_one ENat.toENNReal_one
#noalign enat.coe_ennreal_bit0
#noalign enat.coe_ennreal_bit1
@[simp]
theorem toENNReal_mul (m n : ℕ∞) : ↑(m * n) = (m * n : ℝ≥0∞) :=
map_mul toENNRealRingHom m n
#align enat.coe_ennreal_mul ENat.toENNReal_mul
@[simp]
theorem toENNReal_min (m n : ℕ∞) : ↑(min m n) = (min m n : ℝ≥0∞) :=
toENNReal_mono.map_min
#align enat.coe_ennreal_min ENat.toENNReal_min
@[simp]
theorem toENNReal_max (m n : ℕ∞) : ↑(max m n) = (max m n : ℝ≥0∞) :=
toENNReal_mono.map_max
#align enat.coe_ennreal_max ENat.toENNReal_max
@[simp]
theorem toENNReal_sub (m n : ℕ∞) : ↑(m - n) = (m - n : ℝ≥0∞) :=
WithTop.map_sub Nat.cast_tsub Nat.cast_zero m n
#align enat.coe_ennreal_sub ENat.toENNReal_sub
end ENat
|
This wiki holds trading related articles including Help, Tutorials, and How-To's, Traders and Trading Methods, Platforms, Tools, and Indicators, and Terms (Glossary).
The wiki is in beta test right now. Please help us add content, and report any problems. You can also find our official Wikipedia article for futures io here: futures io on Wikipedia.org.
Big Mike announced the wiki and requested feedback, read the discussion thread for more details.
This article contains a step-by-step video of how to use the wiki, including searching, linking, editing, history versioning, and discussions.
This section contains articles on traders and various trading methods. Feel free to create your own page and describe your own trading methods.
This section is for articles about trading platforms, tools used in trading like data feeds or optimizers, and indicators.
This section is where popular trading terms are defined.
The Special pages section contains multiple reports on wiki articles, a complete list of all articles, and more. |
(*
Author: Norbert Schirmer
Maintainer: Norbert Schirmer, norbert.schirmer at web de
License: LGPL
*)
(* Title: Semantic.thy
Author: Norbert Schirmer, TU Muenchen
Copyright (C) 2004-2008 Norbert Schirmer
Some rights reserved, TU Muenchen
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
*)
section \<open>Big-Step Semantics for Simpl\<close>
theory Semantic imports Language begin
notation
restrict_map ("_|\<^bsub>_\<^esub>" [90, 91] 90)
datatype ('s,'f) xstate = Normal 's | Abrupt 's | Fault 'f | Stuck
definition isAbr::"('s,'f) xstate \<Rightarrow> bool"
where "isAbr S = (\<exists>s. S=Abrupt s)"
lemma isAbr_simps [simp]:
"isAbr (Normal s) = False"
"isAbr (Abrupt s) = True"
"isAbr (Fault f) = False"
"isAbr Stuck = False"
by (auto simp add: isAbr_def)
lemma isAbrE [consumes 1, elim?]: "\<lbrakk>isAbr S; \<And>s. S=Abrupt s \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P"
by (auto simp add: isAbr_def)
lemma not_isAbrD:
"\<not> isAbr s \<Longrightarrow> (\<exists>s'. s=Normal s') \<or> s = Stuck \<or> (\<exists>f. s=Fault f)"
by (cases s) auto
definition isFault:: "('s,'f) xstate \<Rightarrow> bool"
where "isFault S = (\<exists>f. S=Fault f)"
lemma isFault_simps [simp]:
"isFault (Normal s) = False"
"isFault (Abrupt s) = False"
"isFault (Fault f) = True"
"isFault Stuck = False"
by (auto simp add: isFault_def)
lemma isFaultE [consumes 1, elim?]: "\<lbrakk>isFault s; \<And>f. s=Fault f \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P"
by (auto simp add: isFault_def)
lemma not_isFault_iff: "(\<not> isFault t) = (\<forall>f. t \<noteq> Fault f)"
by (auto elim: isFaultE)
(* ************************************************************************* *)
subsection \<open>Big-Step Execution: \<open>\<Gamma>\<turnstile>\<langle>c, s\<rangle> \<Rightarrow> t\<close>\<close>
(* ************************************************************************* *)
text \<open>The procedure environment\<close>
type_synonym ('s,'p,'f) body = "'p \<Rightarrow> ('s,'p,'f) com option"
inductive
"exec"::"[('s,'p,'f) body,('s,'p,'f) com,('s,'f) xstate,('s,'f) xstate]
\<Rightarrow> bool" ("_\<turnstile> \<langle>_,_\<rangle> \<Rightarrow> _" [60,20,98,98] 89)
for \<Gamma>::"('s,'p,'f) body"
where
Skip: "\<Gamma>\<turnstile>\<langle>Skip,Normal s\<rangle> \<Rightarrow> Normal s"
| Guard: "\<lbrakk>s\<in>g; \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Guard f g c,Normal s\<rangle> \<Rightarrow> t"
| GuardFault: "s\<notin>g \<Longrightarrow> \<Gamma>\<turnstile>\<langle>Guard f g c,Normal s\<rangle> \<Rightarrow> Fault f"
| FaultProp [intro,simp]: "\<Gamma>\<turnstile>\<langle>c,Fault f\<rangle> \<Rightarrow> Fault f"
| Basic: "\<Gamma>\<turnstile>\<langle>Basic f,Normal s\<rangle> \<Rightarrow> Normal (f s)"
| Spec: "(s,t) \<in> r
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Spec r,Normal s\<rangle> \<Rightarrow> Normal t"
| SpecStuck: "\<forall>t. (s,t) \<notin> r
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Spec r,Normal s\<rangle> \<Rightarrow> Stuck"
| Seq: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c\<^sub>1,Normal s\<rangle> \<Rightarrow> s'; \<Gamma>\<turnstile>\<langle>c\<^sub>2,s'\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Seq c\<^sub>1 c\<^sub>2,Normal s\<rangle> \<Rightarrow> t"
| CondTrue: "\<lbrakk>s \<in> b; \<Gamma>\<turnstile>\<langle>c\<^sub>1,Normal s\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Cond b c\<^sub>1 c\<^sub>2,Normal s\<rangle> \<Rightarrow> t"
| CondFalse: "\<lbrakk>s \<notin> b; \<Gamma>\<turnstile>\<langle>c\<^sub>2,Normal s\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Cond b c\<^sub>1 c\<^sub>2,Normal s\<rangle> \<Rightarrow> t"
| WhileTrue: "\<lbrakk>s \<in> b; \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> \<Rightarrow> s'; \<Gamma>\<turnstile>\<langle>While b c,s'\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> \<Rightarrow> t"
| WhileFalse: "\<lbrakk>s \<notin> b\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> \<Rightarrow> Normal s"
| Call: "\<lbrakk>\<Gamma> p=Some bdy;\<Gamma>\<turnstile>\<langle>bdy,Normal s\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> \<Rightarrow> t"
| CallUndefined: "\<lbrakk>\<Gamma> p=None\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> \<Rightarrow> Stuck"
| StuckProp [intro,simp]: "\<Gamma>\<turnstile>\<langle>c,Stuck\<rangle> \<Rightarrow> Stuck"
| DynCom: "\<lbrakk>\<Gamma>\<turnstile>\<langle>(c s),Normal s\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>DynCom c,Normal s\<rangle> \<Rightarrow> t"
| Throw: "\<Gamma>\<turnstile>\<langle>Throw,Normal s\<rangle> \<Rightarrow> Abrupt s"
| AbruptProp [intro,simp]: "\<Gamma>\<turnstile>\<langle>c,Abrupt s\<rangle> \<Rightarrow> Abrupt s"
| CatchMatch: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c\<^sub>1,Normal s\<rangle> \<Rightarrow> Abrupt s'; \<Gamma>\<turnstile>\<langle>c\<^sub>2,Normal s'\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Catch c\<^sub>1 c\<^sub>2,Normal s\<rangle> \<Rightarrow> t"
| CatchMiss: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c\<^sub>1,Normal s\<rangle> \<Rightarrow> t; \<not>isAbr t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Catch c\<^sub>1 c\<^sub>2,Normal s\<rangle> \<Rightarrow> t"
inductive_cases exec_elim_cases [cases set]:
"\<Gamma>\<turnstile>\<langle>c,Fault f\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>c,Stuck\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>c,Abrupt s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Skip,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Guard f g c,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Basic f,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Spec r,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Cond b c1 c2,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>While b c,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Call p,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>DynCom c,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Throw,s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Catch c1 c2,s\<rangle> \<Rightarrow> t"
inductive_cases exec_Normal_elim_cases [cases set]:
"\<Gamma>\<turnstile>\<langle>c,Fault f\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>c,Stuck\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>c,Abrupt s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Skip,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Guard f g c,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Basic f,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Spec r,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Seq c1 c2,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Cond b c1 c2,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>DynCom c,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Throw,Normal s\<rangle> \<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Catch c1 c2,Normal s\<rangle> \<Rightarrow> t"
lemma exec_block:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Normal t; \<Gamma>\<turnstile>\<langle>c s t,Normal (return s t)\<rangle> \<Rightarrow> u\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> \<Rightarrow> u"
apply (unfold block_def)
by (fastforce intro: exec.intros)
lemma exec_blockAbrupt:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Abrupt t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> \<Rightarrow> Abrupt (return s t)"
apply (unfold block_def)
by (fastforce intro: exec.intros)
lemma exec_blockFault:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Fault f\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> \<Rightarrow> Fault f"
apply (unfold block_def)
by (fastforce intro: exec.intros)
lemma exec_blockStuck:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Stuck\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> \<Rightarrow> Stuck"
apply (unfold block_def)
by (fastforce intro: exec.intros)
lemma exec_call:
"\<lbrakk>\<Gamma> p=Some bdy;\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Normal t; \<Gamma>\<turnstile>\<langle>c s t,Normal (return s t)\<rangle> \<Rightarrow> u\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> \<Rightarrow> u"
apply (simp add: call_def)
apply (rule exec_block)
apply (erule (1) Call)
apply assumption
done
lemma exec_callAbrupt:
"\<lbrakk>\<Gamma> p=Some bdy;\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Abrupt t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> \<Rightarrow> Abrupt (return s t)"
apply (simp add: call_def)
apply (rule exec_blockAbrupt)
apply (erule (1) Call)
done
lemma exec_callFault:
"\<lbrakk>\<Gamma> p=Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Fault f\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> \<Rightarrow> Fault f"
apply (simp add: call_def)
apply (rule exec_blockFault)
apply (erule (1) Call)
done
lemma exec_callStuck:
"\<lbrakk>\<Gamma> p=Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Stuck\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> \<Rightarrow> Stuck"
apply (simp add: call_def)
apply (rule exec_blockStuck)
apply (erule (1) Call)
done
lemma exec_callUndefined:
"\<lbrakk>\<Gamma> p=None\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> \<Rightarrow> Stuck"
apply (simp add: call_def)
apply (rule exec_blockStuck)
apply (erule CallUndefined)
done
lemma Fault_end: assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t" and s: "s=Fault f"
shows "t=Fault f"
using exec s by (induct) auto
lemma Stuck_end: assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t" and s: "s=Stuck"
shows "t=Stuck"
using exec s by (induct) auto
lemma Abrupt_end: assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t" and s: "s=Abrupt s'"
shows "t=Abrupt s'"
using exec s by (induct) auto
lemma exec_Call_body_aux:
"\<Gamma> p=Some bdy \<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p,s\<rangle> \<Rightarrow> t = \<Gamma>\<turnstile>\<langle>bdy,s\<rangle> \<Rightarrow> t"
apply (rule)
apply (fastforce elim: exec_elim_cases )
apply (cases s)
apply (cases t)
apply (auto intro: exec.intros dest: Fault_end Stuck_end Abrupt_end)
done
lemma exec_Call_body':
"p \<in> dom \<Gamma> \<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p,s\<rangle> \<Rightarrow> t = \<Gamma>\<turnstile>\<langle>the (\<Gamma> p),s\<rangle> \<Rightarrow> t"
apply clarsimp
by (rule exec_Call_body_aux)
lemma exec_block_Normal_elim [consumes 1]:
assumes exec_block: "\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> \<Rightarrow> t"
assumes Normal:
"\<And>t'.
\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Normal t';
\<Gamma>\<turnstile>\<langle>c s t',Normal (return s t')\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow> P"
assumes Abrupt:
"\<And>t'.
\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Abrupt t';
t = Abrupt (return s t')\<rbrakk>
\<Longrightarrow> P"
assumes Fault:
"\<And>f.
\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Fault f;
t = Fault f\<rbrakk>
\<Longrightarrow> P"
assumes Stuck:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Stuck;
t = Stuck\<rbrakk>
\<Longrightarrow> P"
assumes
"\<lbrakk>\<Gamma> p = None; t = Stuck\<rbrakk> \<Longrightarrow> P"
shows "P"
using exec_block
apply (unfold block_def)
apply (elim exec_Normal_elim_cases)
apply simp_all
apply (case_tac s')
apply simp_all
apply (elim exec_Normal_elim_cases)
apply simp
apply (drule Abrupt_end) apply simp
apply (erule exec_Normal_elim_cases)
apply simp
apply (rule Abrupt,assumption+)
apply (drule Fault_end) apply simp
apply (erule exec_Normal_elim_cases)
apply simp
apply (drule Stuck_end) apply simp
apply (erule exec_Normal_elim_cases)
apply simp
apply (case_tac s')
apply simp_all
apply (elim exec_Normal_elim_cases)
apply simp
apply (rule Normal, assumption+)
apply (drule Fault_end) apply simp
apply (rule Fault,assumption+)
apply (drule Stuck_end) apply simp
apply (rule Stuck,assumption+)
done
lemma exec_call_Normal_elim [consumes 1]:
assumes exec_call: "\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> \<Rightarrow> t"
assumes Normal:
"\<And>bdy t'.
\<lbrakk>\<Gamma> p = Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Normal t';
\<Gamma>\<turnstile>\<langle>c s t',Normal (return s t')\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow> P"
assumes Abrupt:
"\<And>bdy t'.
\<lbrakk>\<Gamma> p = Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Abrupt t';
t = Abrupt (return s t')\<rbrakk>
\<Longrightarrow> P"
assumes Fault:
"\<And>bdy f.
\<lbrakk>\<Gamma> p = Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Fault f;
t = Fault f\<rbrakk>
\<Longrightarrow> P"
assumes Stuck:
"\<And>bdy.
\<lbrakk>\<Gamma> p = Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> \<Rightarrow> Stuck;
t = Stuck\<rbrakk>
\<Longrightarrow> P"
assumes Undef:
"\<lbrakk>\<Gamma> p = None; t = Stuck\<rbrakk> \<Longrightarrow> P"
shows "P"
using exec_call
apply (unfold call_def)
apply (cases "\<Gamma> p")
apply (erule exec_block_Normal_elim)
apply (elim exec_Normal_elim_cases)
apply simp
apply simp
apply (elim exec_Normal_elim_cases)
apply simp
apply simp
apply (elim exec_Normal_elim_cases)
apply simp
apply simp
apply (elim exec_Normal_elim_cases)
apply simp
apply (rule Undef,assumption,assumption)
apply (rule Undef,assumption+)
apply (erule exec_block_Normal_elim)
apply (elim exec_Normal_elim_cases)
apply simp
apply (rule Normal,assumption+)
apply simp
apply (elim exec_Normal_elim_cases)
apply simp
apply (rule Abrupt,assumption+)
apply simp
apply (elim exec_Normal_elim_cases)
apply simp
apply (rule Fault, assumption+)
apply simp
apply (elim exec_Normal_elim_cases)
apply simp
apply (rule Stuck,assumption,assumption,assumption)
apply simp
apply (rule Undef,assumption+)
done
lemma exec_dynCall:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>call init (p s) return c,Normal s\<rangle> \<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>dynCall init p return c,Normal s\<rangle> \<Rightarrow> t"
apply (simp add: dynCall_def)
by (rule DynCom)
lemma exec_dynCall_Normal_elim:
assumes exec: "\<Gamma>\<turnstile>\<langle>dynCall init p return c,Normal s\<rangle> \<Rightarrow> t"
assumes call: "\<Gamma>\<turnstile>\<langle>call init (p s) return c,Normal s\<rangle> \<Rightarrow> t \<Longrightarrow> P"
shows "P"
using exec
apply (simp add: dynCall_def)
apply (erule exec_Normal_elim_cases)
apply (rule call,assumption)
done
lemma exec_Seq': "\<lbrakk>\<Gamma>\<turnstile>\<langle>c1,s\<rangle> \<Rightarrow> s'; \<Gamma>\<turnstile>\<langle>c2,s'\<rangle> \<Rightarrow> s''\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> \<Rightarrow> s''"
apply (cases s)
apply (fastforce intro: exec.intros)
apply (fastforce dest: Abrupt_end)
apply (fastforce dest: Fault_end)
apply (fastforce dest: Stuck_end)
done
lemma exec_assoc: "\<Gamma>\<turnstile>\<langle>Seq c1 (Seq c2 c3),s\<rangle> \<Rightarrow> t = \<Gamma>\<turnstile>\<langle>Seq (Seq c1 c2) c3,s\<rangle> \<Rightarrow> t"
by (blast elim!: exec_elim_cases intro: exec_Seq' )
(* ************************************************************************* *)
subsection \<open>Big-Step Execution with Recursion Limit: \<open>\<Gamma>\<turnstile>\<langle>c, s\<rangle> =n\<Rightarrow> t\<close>\<close>
(* ************************************************************************* *)
inductive "execn"::"[('s,'p,'f) body,('s,'p,'f) com,('s,'f) xstate,nat,('s,'f) xstate]
\<Rightarrow> bool" ("_\<turnstile> \<langle>_,_\<rangle> =_\<Rightarrow> _" [60,20,98,65,98] 89)
for \<Gamma>::"('s,'p,'f) body"
where
Skip: "\<Gamma>\<turnstile>\<langle>Skip,Normal s\<rangle> =n\<Rightarrow> Normal s"
| Guard: "\<lbrakk>s\<in>g; \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Guard f g c,Normal s\<rangle> =n\<Rightarrow> t"
| GuardFault: "s\<notin>g \<Longrightarrow> \<Gamma>\<turnstile>\<langle>Guard f g c,Normal s\<rangle> =n\<Rightarrow> Fault f"
| FaultProp [intro,simp]: "\<Gamma>\<turnstile>\<langle>c,Fault f\<rangle> =n\<Rightarrow> Fault f"
| Basic: "\<Gamma>\<turnstile>\<langle>Basic f,Normal s\<rangle> =n\<Rightarrow> Normal (f s)"
| Spec: "(s,t) \<in> r
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Spec r,Normal s\<rangle> =n\<Rightarrow> Normal t"
| SpecStuck: "\<forall>t. (s,t) \<notin> r
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Spec r,Normal s\<rangle> =n\<Rightarrow> Stuck"
| Seq: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c\<^sub>1,Normal s\<rangle> =n\<Rightarrow> s'; \<Gamma>\<turnstile>\<langle>c\<^sub>2,s'\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Seq c\<^sub>1 c\<^sub>2,Normal s\<rangle> =n\<Rightarrow> t"
| CondTrue: "\<lbrakk>s \<in> b; \<Gamma>\<turnstile>\<langle>c\<^sub>1,Normal s\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Cond b c\<^sub>1 c\<^sub>2,Normal s\<rangle> =n\<Rightarrow> t"
| CondFalse: "\<lbrakk>s \<notin> b; \<Gamma>\<turnstile>\<langle>c\<^sub>2,Normal s\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Cond b c\<^sub>1 c\<^sub>2,Normal s\<rangle> =n\<Rightarrow> t"
| WhileTrue: "\<lbrakk>s \<in> b; \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> s';
\<Gamma>\<turnstile>\<langle>While b c,s'\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> =n\<Rightarrow> t"
| WhileFalse: "\<lbrakk>s \<notin> b\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> =n\<Rightarrow> Normal s"
| Call: "\<lbrakk>\<Gamma> p=Some bdy;\<Gamma>\<turnstile>\<langle>bdy,Normal s\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p ,Normal s\<rangle> =Suc n\<Rightarrow> t"
| CallUndefined: "\<lbrakk>\<Gamma> p=None\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p ,Normal s\<rangle> =Suc n\<Rightarrow> Stuck"
| StuckProp [intro,simp]: "\<Gamma>\<turnstile>\<langle>c,Stuck\<rangle> =n\<Rightarrow> Stuck"
| DynCom: "\<lbrakk>\<Gamma>\<turnstile>\<langle>(c s),Normal s\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>DynCom c,Normal s\<rangle> =n\<Rightarrow> t"
| Throw: "\<Gamma>\<turnstile>\<langle>Throw,Normal s\<rangle> =n\<Rightarrow> Abrupt s"
| AbruptProp [intro,simp]: "\<Gamma>\<turnstile>\<langle>c,Abrupt s\<rangle> =n\<Rightarrow> Abrupt s"
| CatchMatch: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c\<^sub>1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'; \<Gamma>\<turnstile>\<langle>c\<^sub>2,Normal s'\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Catch c\<^sub>1 c\<^sub>2,Normal s\<rangle> =n\<Rightarrow> t"
| CatchMiss: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c\<^sub>1,Normal s\<rangle> =n\<Rightarrow> t; \<not>isAbr t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Catch c\<^sub>1 c\<^sub>2,Normal s\<rangle> =n\<Rightarrow> t"
inductive_cases execn_elim_cases [cases set]:
"\<Gamma>\<turnstile>\<langle>c,Fault f\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>c,Stuck\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>c,Abrupt s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Skip,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Guard f g c,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Basic f,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Spec r,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Cond b c1 c2,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>While b c,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Call p ,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>DynCom c,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Throw,s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Catch c1 c2,s\<rangle> =n\<Rightarrow> t"
inductive_cases execn_Normal_elim_cases [cases set]:
"\<Gamma>\<turnstile>\<langle>c,Fault f\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>c,Stuck\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>c,Abrupt s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Skip,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Guard f g c,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Basic f,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Spec r,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Seq c1 c2,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Cond b c1 c2,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>DynCom c,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Throw,Normal s\<rangle> =n\<Rightarrow> t"
"\<Gamma>\<turnstile>\<langle>Catch c1 c2,Normal s\<rangle> =n\<Rightarrow> t"
lemma execn_Skip': "\<Gamma>\<turnstile>\<langle>Skip,t\<rangle> =n\<Rightarrow> t"
by (cases t) (auto intro: execn.intros)
lemma execn_Fault_end: assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" and s: "s=Fault f"
shows "t=Fault f"
using exec s by (induct) auto
lemma execn_Stuck_end: assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" and s: "s=Stuck"
shows "t=Stuck"
using exec s by (induct) auto
lemma execn_Abrupt_end: assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" and s: "s=Abrupt s'"
shows "t=Abrupt s'"
using exec s by (induct) auto
lemma execn_block:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Normal t; \<Gamma>\<turnstile>\<langle>c s t,Normal (return s t)\<rangle> =n\<Rightarrow> u\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> =n\<Rightarrow> u"
apply (unfold block_def)
by (fastforce intro: execn.intros)
lemma execn_blockAbrupt:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Abrupt t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> =n\<Rightarrow> Abrupt (return s t)"
apply (unfold block_def)
by (fastforce intro: execn.intros)
lemma execn_blockFault:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Fault f\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> =n\<Rightarrow> Fault f"
apply (unfold block_def)
by (fastforce intro: execn.intros)
lemma execn_blockStuck:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Stuck\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> =n\<Rightarrow> Stuck"
apply (unfold block_def)
by (fastforce intro: execn.intros)
lemma execn_call:
"\<lbrakk>\<Gamma> p=Some bdy;\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Normal t;
\<Gamma>\<turnstile>\<langle>c s t,Normal (return s t)\<rangle> =Suc n\<Rightarrow> u\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> =Suc n\<Rightarrow> u"
apply (simp add: call_def)
apply (rule execn_block)
apply (erule (1) Call)
apply assumption
done
lemma execn_callAbrupt:
"\<lbrakk>\<Gamma> p=Some bdy;\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Abrupt t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> =Suc n\<Rightarrow> Abrupt (return s t)"
apply (simp add: call_def)
apply (rule execn_blockAbrupt)
apply (erule (1) Call)
done
lemma execn_callFault:
"\<lbrakk>\<Gamma> p=Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Fault f\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> =Suc n\<Rightarrow> Fault f"
apply (simp add: call_def)
apply (rule execn_blockFault)
apply (erule (1) Call)
done
lemma execn_callStuck:
"\<lbrakk>\<Gamma> p=Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Stuck\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> =Suc n\<Rightarrow> Stuck"
apply (simp add: call_def)
apply (rule execn_blockStuck)
apply (erule (1) Call)
done
lemma execn_callUndefined:
"\<lbrakk>\<Gamma> p=None\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> =Suc n\<Rightarrow> Stuck"
apply (simp add: call_def)
apply (rule execn_blockStuck)
apply (erule CallUndefined)
done
lemma execn_block_Normal_elim [consumes 1]:
assumes execn_block: "\<Gamma>\<turnstile>\<langle>block init bdy return c,Normal s\<rangle> =n\<Rightarrow> t"
assumes Normal:
"\<And>t'.
\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Normal t';
\<Gamma>\<turnstile>\<langle>c s t',Normal (return s t')\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow> P"
assumes Abrupt:
"\<And>t'.
\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Abrupt t';
t = Abrupt (return s t')\<rbrakk>
\<Longrightarrow> P"
assumes Fault:
"\<And>f.
\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Fault f;
t = Fault f\<rbrakk>
\<Longrightarrow> P"
assumes Stuck:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =n\<Rightarrow> Stuck;
t = Stuck\<rbrakk>
\<Longrightarrow> P"
assumes Undef:
"\<lbrakk>\<Gamma> p = None; t = Stuck\<rbrakk> \<Longrightarrow> P"
shows "P"
using execn_block
apply (unfold block_def)
apply (elim execn_Normal_elim_cases)
apply simp_all
apply (case_tac s')
apply simp_all
apply (elim execn_Normal_elim_cases)
apply simp
apply (drule execn_Abrupt_end) apply simp
apply (erule execn_Normal_elim_cases)
apply simp
apply (rule Abrupt,assumption+)
apply (drule execn_Fault_end) apply simp
apply (erule execn_Normal_elim_cases)
apply simp
apply (drule execn_Stuck_end) apply simp
apply (erule execn_Normal_elim_cases)
apply simp
apply (case_tac s')
apply simp_all
apply (elim execn_Normal_elim_cases)
apply simp
apply (rule Normal,assumption+)
apply (drule execn_Fault_end) apply simp
apply (rule Fault,assumption+)
apply (drule execn_Stuck_end) apply simp
apply (rule Stuck,assumption+)
done
lemma execn_call_Normal_elim [consumes 1]:
assumes exec_call: "\<Gamma>\<turnstile>\<langle>call init p return c,Normal s\<rangle> =n\<Rightarrow> t"
assumes Normal:
"\<And>bdy i t'.
\<lbrakk>\<Gamma> p = Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =i\<Rightarrow> Normal t';
\<Gamma>\<turnstile>\<langle>c s t',Normal (return s t')\<rangle> =Suc i\<Rightarrow> t; n = Suc i\<rbrakk>
\<Longrightarrow> P"
assumes Abrupt:
"\<And>bdy i t'.
\<lbrakk>\<Gamma> p = Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =i\<Rightarrow> Abrupt t'; n = Suc i;
t = Abrupt (return s t')\<rbrakk>
\<Longrightarrow> P"
assumes Fault:
"\<And>bdy i f.
\<lbrakk>\<Gamma> p = Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =i\<Rightarrow> Fault f; n = Suc i;
t = Fault f\<rbrakk>
\<Longrightarrow> P"
assumes Stuck:
"\<And>bdy i.
\<lbrakk>\<Gamma> p = Some bdy; \<Gamma>\<turnstile>\<langle>bdy,Normal (init s)\<rangle> =i\<Rightarrow> Stuck; n = Suc i;
t = Stuck\<rbrakk>
\<Longrightarrow> P"
assumes Undef:
"\<And>i. \<lbrakk>\<Gamma> p = None; n = Suc i; t = Stuck\<rbrakk> \<Longrightarrow> P"
shows "P"
using exec_call
apply (unfold call_def)
apply (cases n)
apply (simp only: block_def)
apply (fastforce elim: execn_Normal_elim_cases)
apply (cases "\<Gamma> p")
apply (erule execn_block_Normal_elim)
apply (elim execn_Normal_elim_cases)
apply simp
apply simp
apply (elim execn_Normal_elim_cases)
apply simp
apply simp
apply (elim execn_Normal_elim_cases)
apply simp
apply simp
apply (elim execn_Normal_elim_cases)
apply simp
apply (rule Undef,assumption,assumption,assumption)
apply (rule Undef,assumption+)
apply (erule execn_block_Normal_elim)
apply (elim execn_Normal_elim_cases)
apply simp
apply (rule Normal,assumption+)
apply simp
apply (elim execn_Normal_elim_cases)
apply simp
apply (rule Abrupt,assumption+)
apply simp
apply (elim execn_Normal_elim_cases)
apply simp
apply (rule Fault,assumption+)
apply simp
apply (elim execn_Normal_elim_cases)
apply simp
apply (rule Stuck,assumption,assumption,assumption,assumption)
apply (rule Undef,assumption,assumption,assumption)
apply (rule Undef,assumption+)
done
lemma execn_dynCall:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>call init (p s) return c,Normal s\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>dynCall init p return c,Normal s\<rangle> =n\<Rightarrow> t"
apply (simp add: dynCall_def)
by (rule DynCom)
lemma execn_Seq':
"\<lbrakk>\<Gamma>\<turnstile>\<langle>c1,s\<rangle> =n\<Rightarrow> s'; \<Gamma>\<turnstile>\<langle>c2,s'\<rangle> =n\<Rightarrow> s''\<rbrakk>
\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> =n\<Rightarrow> s''"
apply (cases s)
apply (fastforce intro: execn.intros)
apply (fastforce dest: execn_Abrupt_end)
apply (fastforce dest: execn_Fault_end)
apply (fastforce dest: execn_Stuck_end)
done
lemma execn_mono:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
shows "\<And> m. n \<le> m \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> =m\<Rightarrow> t"
using exec
by (induct) (auto intro: execn.intros dest: Suc_le_D)
lemma execn_Suc:
"\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> =Suc n\<Rightarrow> t"
by (rule execn_mono [OF _ le_refl [THEN le_SucI]])
lemma execn_assoc:
"\<Gamma>\<turnstile>\<langle>Seq c1 (Seq c2 c3),s\<rangle> =n\<Rightarrow> t = \<Gamma>\<turnstile>\<langle>Seq (Seq c1 c2) c3,s\<rangle> =n\<Rightarrow> t"
by (auto elim!: execn_elim_cases intro: execn_Seq')
lemma execn_to_exec:
assumes execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
using execn
by induct (auto intro: exec.intros)
lemma exec_to_execn:
assumes execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
shows "\<exists>n. \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
using execn
proof (induct)
case Skip thus ?case by (iprover intro: execn.intros)
next
case Guard thus ?case by (iprover intro: execn.intros)
next
case GuardFault thus ?case by (iprover intro: execn.intros)
next
case FaultProp thus ?case by (iprover intro: execn.intros)
next
case Basic thus ?case by (iprover intro: execn.intros)
next
case Spec thus ?case by (iprover intro: execn.intros)
next
case SpecStuck thus ?case by (iprover intro: execn.intros)
next
case (Seq c1 s s' c2 s'')
then obtain n m where
"\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> s'" "\<Gamma>\<turnstile>\<langle>c2,s'\<rangle> =m\<Rightarrow> s''"
by blast
then have
"\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =max n m\<Rightarrow> s'"
"\<Gamma>\<turnstile>\<langle>c2,s'\<rangle> =max n m\<Rightarrow> s''"
by (auto elim!: execn_mono intro: max.cobounded1 max.cobounded2)
thus ?case
by (iprover intro: execn.intros)
next
case CondTrue thus ?case by (iprover intro: execn.intros)
next
case CondFalse thus ?case by (iprover intro: execn.intros)
next
case (WhileTrue s b c s' s'')
then obtain n m where
"\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> s'" "\<Gamma>\<turnstile>\<langle>While b c,s'\<rangle> =m\<Rightarrow> s''"
by blast
then have
"\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =max n m\<Rightarrow> s'" "\<Gamma>\<turnstile>\<langle>While b c,s'\<rangle> =max n m\<Rightarrow> s''"
by (auto elim!: execn_mono intro: max.cobounded1 max.cobounded2)
with WhileTrue
show ?case
by (iprover intro: execn.intros)
next
case WhileFalse thus ?case by (iprover intro: execn.intros)
next
case Call thus ?case by (iprover intro: execn.intros)
next
case CallUndefined thus ?case by (iprover intro: execn.intros)
next
case StuckProp thus ?case by (iprover intro: execn.intros)
next
case DynCom thus ?case by (iprover intro: execn.intros)
next
case Throw thus ?case by (iprover intro: execn.intros)
next
case AbruptProp thus ?case by (iprover intro: execn.intros)
next
case (CatchMatch c1 s s' c2 s'')
then obtain n m where
"\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'" "\<Gamma>\<turnstile>\<langle>c2,Normal s'\<rangle> =m\<Rightarrow> s''"
by blast
then have
"\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =max n m\<Rightarrow> Abrupt s'"
"\<Gamma>\<turnstile>\<langle>c2,Normal s'\<rangle> =max n m\<Rightarrow> s''"
by (auto elim!: execn_mono intro: max.cobounded1 max.cobounded2)
with CatchMatch.hyps show ?case
by (iprover intro: execn.intros)
next
case CatchMiss thus ?case by (iprover intro: execn.intros)
qed
theorem exec_iff_execn: "(\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t) = (\<exists>n. \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t)"
by (iprover intro: exec_to_execn execn_to_exec)
definition nfinal_notin:: "('s,'p,'f) body \<Rightarrow> ('s,'p,'f) com \<Rightarrow> ('s,'f) xstate \<Rightarrow> nat
\<Rightarrow> ('s,'f) xstate set \<Rightarrow> bool"
("_\<turnstile> \<langle>_,_\<rangle> =_\<Rightarrow>\<notin>_" [60,20,98,65,60] 89) where
"\<Gamma>\<turnstile> \<langle>c,s\<rangle> =n\<Rightarrow>\<notin>T = (\<forall>t. \<Gamma>\<turnstile> \<langle>c,s\<rangle> =n\<Rightarrow> t \<longrightarrow> t\<notin>T)"
definition final_notin:: "('s,'p,'f) body \<Rightarrow> ('s,'p,'f) com \<Rightarrow> ('s,'f) xstate
\<Rightarrow> ('s,'f) xstate set \<Rightarrow> bool"
("_\<turnstile> \<langle>_,_\<rangle> \<Rightarrow>\<notin>_" [60,20,98,60] 89) where
"\<Gamma>\<turnstile> \<langle>c,s\<rangle> \<Rightarrow>\<notin>T = (\<forall>t. \<Gamma>\<turnstile> \<langle>c,s\<rangle> \<Rightarrow>t \<longrightarrow> t\<notin>T)"
lemma final_notinI: "\<lbrakk>\<And>t. \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t \<Longrightarrow> t \<notin> T\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>T"
by (simp add: final_notin_def)
lemma noFaultStuck_Call_body': "p \<in> dom \<Gamma> \<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` (-F)) =
\<Gamma>\<turnstile>\<langle>the (\<Gamma> p),Normal s\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` (-F))"
by (clarsimp simp add: final_notin_def exec_Call_body)
lemma noFault_startn:
assumes execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" and t: "t\<noteq>Fault f"
shows "s\<noteq>Fault f"
using execn t by (induct) auto
lemma noFault_start:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t" and t: "t\<noteq>Fault f"
shows "s\<noteq>Fault f"
using exec t by (induct) auto
lemma noStuck_startn:
assumes execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" and t: "t\<noteq>Stuck"
shows "s\<noteq>Stuck"
using execn t by (induct) auto
lemma noStuck_start:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t" and t: "t\<noteq>Stuck"
shows "s\<noteq>Stuck"
using exec t by (induct) auto
lemma noAbrupt_startn:
assumes execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" and t: "\<forall>t'. t\<noteq>Abrupt t'"
shows "s\<noteq>Abrupt s'"
using execn t by (induct) auto
lemma noAbrupt_start:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t" and t: "\<forall>t'. t\<noteq>Abrupt t'"
shows "s\<noteq>Abrupt s'"
using exec t by (induct) auto
lemma noFaultn_startD: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Normal t \<Longrightarrow> s \<noteq> Fault f"
by (auto dest: noFault_startn)
lemma noFaultn_startD': "t\<noteq>Fault f \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t \<Longrightarrow> s \<noteq> Fault f"
by (auto dest: noFault_startn)
lemma noFault_startD: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Normal t \<Longrightarrow> s \<noteq> Fault f"
by (auto dest: noFault_start)
lemma noFault_startD': "t\<noteq>Fault f\<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t \<Longrightarrow> s \<noteq> Fault f"
by (auto dest: noFault_start)
lemma noStuckn_startD: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Normal t \<Longrightarrow> s \<noteq> Stuck"
by (auto dest: noStuck_startn)
lemma noStuckn_startD': "t\<noteq>Stuck \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t \<Longrightarrow> s \<noteq> Stuck"
by (auto dest: noStuck_startn)
lemma noStuck_startD: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Normal t \<Longrightarrow> s \<noteq> Stuck"
by (auto dest: noStuck_start)
lemma noStuck_startD': "t\<noteq>Stuck \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t \<Longrightarrow> s \<noteq> Stuck"
by (auto dest: noStuck_start)
lemma noAbruptn_startD: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Normal t \<Longrightarrow> s \<noteq> Abrupt s'"
by (auto dest: noAbrupt_startn)
lemma noAbrupt_startD: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Normal t \<Longrightarrow> s \<noteq> Abrupt s'"
by (auto dest: noAbrupt_start)
lemma noFaultnI: "\<lbrakk>\<And>t. \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t \<Longrightarrow> t\<noteq>Fault f\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Fault f}"
by (simp add: nfinal_notin_def)
lemma noFaultnI':
assumes contr: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Fault f \<Longrightarrow> False"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Fault f}"
proof (rule noFaultnI)
fix t assume "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
with contr show "t \<noteq> Fault f"
by (cases "t=Fault f") auto
qed
lemma noFaultn_def': "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Fault f} = (\<not>\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Fault f)"
apply rule
apply (fastforce simp add: nfinal_notin_def)
apply (fastforce intro: noFaultnI')
done
lemma noStucknI':
assumes contr: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Stuck \<Longrightarrow> False"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Stuck}"
proof (rule noStucknI)
fix t assume "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
with contr show "t \<noteq> Stuck"
by (cases t) auto
qed
lemma noStuckn_def': "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Stuck} = (\<not>\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Stuck)"
apply rule
apply (fastforce simp add: nfinal_notin_def)
apply (fastforce intro: noStucknI')
done
lemma noFaultI: "\<lbrakk>\<And>t. \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>t \<Longrightarrow> t\<noteq>Fault f\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Fault f}"
by (simp add: final_notin_def)
lemma noFaultI':
assumes contr: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Fault f\<Longrightarrow> False"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Fault f}"
proof (rule noFaultI)
fix t assume "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
with contr show "t \<noteq> Fault f"
by (cases "t=Fault f") auto
qed
lemma noFaultE:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Fault f}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Fault f\<rbrakk> \<Longrightarrow> P"
by (auto simp add: final_notin_def)
lemma noStuckI: "\<lbrakk>\<And>t. \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>t \<Longrightarrow> t\<noteq>Stuck\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (simp add: final_notin_def)
lemma noStuckI':
assumes contr: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Stuck \<Longrightarrow> False"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Stuck}"
proof (rule noStuckI)
fix t assume "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
with contr show "t \<noteq> Stuck"
by (cases t) auto
qed
lemma noStuckE:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Stuck\<rbrakk> \<Longrightarrow> P"
by (auto simp add: final_notin_def)
lemma noStuck_def': "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Stuck} = (\<not>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Stuck)"
apply rule
apply (fastforce simp add: final_notin_def)
apply (fastforce intro: noStuckI')
done
lemma noFaultn_execD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Fault f}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t\<rbrakk> \<Longrightarrow> t\<noteq>Fault f"
by (simp add: nfinal_notin_def)
lemma noFault_execD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Fault f}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>t\<rbrakk> \<Longrightarrow> t\<noteq>Fault f"
by (simp add: final_notin_def)
lemma noFaultn_exec_startD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Fault f}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t\<rbrakk> \<Longrightarrow> s\<noteq>Fault f"
by (auto simp add: nfinal_notin_def dest: noFaultn_startD)
lemma noFault_exec_startD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Fault f}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>t\<rbrakk> \<Longrightarrow> s\<noteq>Fault f"
by (auto simp add: final_notin_def dest: noFault_startD)
lemma noStuckn_execD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t\<rbrakk> \<Longrightarrow> t\<noteq>Stuck"
by (simp add: nfinal_notin_def)
lemma noStuck_execD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>t\<rbrakk> \<Longrightarrow> t\<noteq>Stuck"
by (simp add: final_notin_def)
lemma noStuckn_exec_startD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t\<rbrakk> \<Longrightarrow> s\<noteq>Stuck"
by (auto simp add: nfinal_notin_def dest: noStuckn_startD)
lemma noStuck_exec_startD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>t\<rbrakk> \<Longrightarrow> s\<noteq>Stuck"
by (auto simp add: final_notin_def dest: noStuck_startD)
lemma noFaultStuckn_execD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Fault True,Fault False,Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t\<rbrakk> \<Longrightarrow>
t\<notin>{Fault True,Fault False,Stuck}"
by (simp add: nfinal_notin_def)
lemma noFaultStuck_execD: "\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Fault True,Fault False,Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>t\<rbrakk>
\<Longrightarrow> t\<notin>{Fault True,Fault False,Stuck}"
by (simp add: final_notin_def)
lemma noFaultStuckn_exec_startD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>{Fault True, Fault False,Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t\<rbrakk>
\<Longrightarrow> s\<notin>{Fault True,Fault False,Stuck}"
by (auto simp add: nfinal_notin_def )
lemma noFaultStuck_exec_startD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>{Fault True, Fault False,Stuck}; \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>t\<rbrakk>
\<Longrightarrow> s\<notin>{Fault True,Fault False,Stuck}"
by (auto simp add: final_notin_def )
lemma noStuck_Call:
assumes noStuck: "\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
shows "p \<in> dom \<Gamma>"
proof (cases "p \<in> dom \<Gamma>")
case True thus ?thesis by simp
next
case False
hence "\<Gamma> p = None" by auto
hence "\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> \<Rightarrow>Stuck"
by (rule exec.CallUndefined)
with noStuck show ?thesis
by (auto simp add: final_notin_def)
qed
lemma Guard_noFaultStuckD:
assumes "\<Gamma>\<turnstile>\<langle>Guard f g c,Normal s\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` (-F))"
assumes "f \<notin> F"
shows "s \<in> g"
using assms
by (auto simp add: final_notin_def intro: exec.intros)
lemma final_notin_to_finaln:
assumes notin: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>T"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>T"
proof (clarsimp simp add: nfinal_notin_def)
fix t assume "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" and "t\<in>T"
with notin show "False"
by (auto intro: execn_to_exec simp add: final_notin_def)
qed
lemma noFault_Call_body:
"\<Gamma> p=Some bdy\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p ,Normal s\<rangle> \<Rightarrow>\<notin>{Fault f} =
\<Gamma>\<turnstile>\<langle>the (\<Gamma> p),Normal s\<rangle> \<Rightarrow>\<notin>{Fault f}"
by (simp add: noFault_def' exec_Call_body)
lemma noStuck_Call_body:
"\<Gamma> p=Some bdy\<Longrightarrow>
\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck} =
\<Gamma>\<turnstile>\<langle>the (\<Gamma> p),Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (simp add: noStuck_def' exec_Call_body)
lemma exec_final_notin_to_execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>T \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>T"
by (auto simp add: final_notin_def nfinal_notin_def dest: execn_to_exec)
lemma execn_final_notin_to_exec: "\<forall>n. \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>T \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>T"
by (auto simp add: final_notin_def nfinal_notin_def dest: exec_to_execn)
lemma exec_final_notin_iff_execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow>\<notin>T = (\<forall>n. \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>\<notin>T)"
by (auto intro: exec_final_notin_to_execn execn_final_notin_to_exec)
lemma Seq_NoFaultStuckD2:
assumes noabort: "\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` F)"
shows "\<forall>t. \<Gamma>\<turnstile>\<langle>c1,s\<rangle> \<Rightarrow> t \<longrightarrow> t\<notin> ({Stuck} \<union> Fault ` F) \<longrightarrow>
\<Gamma>\<turnstile>\<langle>c2,t\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` F)"
using noabort
by (auto simp add: final_notin_def intro: exec_Seq') lemma Seq_NoFaultStuckD1:
assumes noabort: "\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` F)"
shows "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` F)"
proof (rule final_notinI)
fix t
assume exec_c1: "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> \<Rightarrow> t"
show "t \<notin> {Stuck} \<union> Fault ` F"
proof
assume "t \<in> {Stuck} \<union> Fault ` F"
moreover
{
assume "t = Stuck"
with exec_c1
have "\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> \<Rightarrow> Stuck"
by (auto intro: exec_Seq')
with noabort have False
by (auto simp add: final_notin_def)
hence False ..
}
moreover
{
assume "t \<in> Fault ` F"
then obtain f where
t: "t=Fault f" and f: "f \<in> F"
by auto
from t exec_c1
have "\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> \<Rightarrow> Fault f"
by (auto intro: exec_Seq')
with noabort f have False
by (auto simp add: final_notin_def)
hence False ..
}
ultimately show False by auto
qed
qed
lemma Seq_NoFaultStuckD2':
assumes noabort: "\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` F)"
shows "\<forall>t. \<Gamma>\<turnstile>\<langle>c1,s\<rangle> \<Rightarrow> t \<longrightarrow> t\<notin> ({Stuck} \<union> Fault ` F) \<longrightarrow>
\<Gamma>\<turnstile>\<langle>c2,t\<rangle> \<Rightarrow>\<notin>({Stuck} \<union> Fault ` F)"
using noabort
by (auto simp add: final_notin_def intro: exec_Seq')
(* ************************************************************************* *)
subsection \<open>Lemmas about @{const "sequence"}, @{const "flatten"} and
@{const "normalize"}\<close>
(* ************************************************************************ *)
lemma execn_sequence_app: "\<And>s s' t.
\<lbrakk>\<Gamma>\<turnstile>\<langle>sequence Seq xs,Normal s\<rangle> =n\<Rightarrow> s'; \<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow> \<Gamma>\<turnstile>\<langle>sequence Seq (xs@ys),Normal s\<rangle> =n\<Rightarrow> t"
proof (induct xs)
case Nil
thus ?case by (auto elim: execn_Normal_elim_cases)
next
case (Cons x xs)
have exec_x_xs: "\<Gamma>\<turnstile>\<langle>sequence Seq (x # xs),Normal s\<rangle> =n\<Rightarrow> s'" by fact
have exec_ys: "\<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases xs)
case Nil
with exec_x_xs have "\<Gamma>\<turnstile>\<langle>x,Normal s\<rangle> =n\<Rightarrow> s'"
by (auto elim: execn_Normal_elim_cases )
with Nil exec_ys show ?thesis
by (cases ys) (auto intro: execn.intros elim: execn_elim_cases)
next
case Cons
with exec_x_xs
obtain s'' where
exec_x: "\<Gamma>\<turnstile>\<langle>x,Normal s\<rangle> =n\<Rightarrow> s''" and
exec_xs: "\<Gamma>\<turnstile>\<langle>sequence Seq xs,s''\<rangle> =n\<Rightarrow> s'"
by (auto elim: execn_Normal_elim_cases )
show ?thesis
proof (cases s'')
case (Normal s''')
from Cons.hyps [OF exec_xs [simplified Normal] exec_ys]
have "\<Gamma>\<turnstile>\<langle>sequence Seq (xs @ ys),Normal s'''\<rangle> =n\<Rightarrow> t" .
with Cons exec_x Normal
show ?thesis
by (auto intro: execn.intros)
next
case (Abrupt s''')
with exec_xs have "s'=Abrupt s'''"
by (auto dest: execn_Abrupt_end)
with exec_ys have "t=Abrupt s'''"
by (auto dest: execn_Abrupt_end)
with exec_x Abrupt Cons show ?thesis
by (auto intro: execn.intros)
next
case (Fault f)
with exec_xs have "s'=Fault f"
by (auto dest: execn_Fault_end)
with exec_ys have "t=Fault f"
by (auto dest: execn_Fault_end)
with exec_x Fault Cons show ?thesis
by (auto intro: execn.intros)
next
case Stuck
with exec_xs have "s'=Stuck"
by (auto dest: execn_Stuck_end)
with exec_ys have "t=Stuck"
by (auto dest: execn_Stuck_end)
with exec_x Stuck Cons show ?thesis
by (auto intro: execn.intros)
qed
qed
qed
lemma execn_sequence_appD: "\<And>s t. \<Gamma>\<turnstile>\<langle>sequence Seq (xs @ ys),Normal s\<rangle> =n\<Rightarrow> t \<Longrightarrow>
\<exists>s'. \<Gamma>\<turnstile>\<langle>sequence Seq xs,Normal s\<rangle> =n\<Rightarrow> s' \<and> \<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> =n\<Rightarrow> t"
proof (induct xs)
case Nil
thus ?case
by (auto intro: execn.intros)
next
case (Cons x xs)
have exec_app: "\<Gamma>\<turnstile>\<langle>sequence Seq ((x # xs) @ ys),Normal s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases xs)
case Nil
with exec_app show ?thesis
by (cases ys) (auto elim: execn_Normal_elim_cases intro: execn_Skip')
next
case Cons
with exec_app obtain s' where
exec_x: "\<Gamma>\<turnstile>\<langle>x,Normal s\<rangle> =n\<Rightarrow> s'" and
exec_xs_ys: "\<Gamma>\<turnstile>\<langle>sequence Seq (xs @ ys),s'\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
show ?thesis
proof (cases s')
case (Normal s'')
from Cons.hyps [OF exec_xs_ys [simplified Normal]] Normal exec_x Cons
show ?thesis
by (auto intro: execn.intros)
next
case (Abrupt s'')
with exec_xs_ys have "t=Abrupt s''"
by (auto dest: execn_Abrupt_end)
with Abrupt exec_x Cons
show ?thesis
by (auto intro: execn.intros)
next
case (Fault f)
with exec_xs_ys have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault exec_x Cons
show ?thesis
by (auto intro: execn.intros)
next
case Stuck
with exec_xs_ys have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck exec_x Cons
show ?thesis
by (auto intro: execn.intros)
qed
qed
qed
lemma execn_sequence_appE [consumes 1]:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>sequence Seq (xs @ ys),Normal s\<rangle> =n\<Rightarrow> t;
\<And>s'. \<lbrakk>\<Gamma>\<turnstile>\<langle>sequence Seq xs,Normal s\<rangle> =n\<Rightarrow> s';\<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> =n\<Rightarrow> t\<rbrakk> \<Longrightarrow> P
\<rbrakk> \<Longrightarrow> P"
by (auto dest: execn_sequence_appD)
lemma execn_to_execn_sequence_flatten:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>sequence Seq (flatten c),s\<rangle> =n\<Rightarrow> t"
using exec
proof induct
case (Seq c1 c2 n s s' s'') thus ?case
by (auto intro: execn.intros execn_sequence_app)
qed (auto intro: execn.intros)
lemma execn_to_execn_normalize:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>normalize c,s\<rangle> =n\<Rightarrow> t"
using exec
proof induct
case (Seq c1 c2 n s s' s'') thus ?case
by (auto intro: execn_to_execn_sequence_flatten execn_sequence_app )
qed (auto intro: execn.intros)
lemma execn_sequence_flatten_to_execn:
shows "\<And>s t. \<Gamma>\<turnstile>\<langle>sequence Seq (flatten c),s\<rangle> =n\<Rightarrow> t \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
proof (induct c)
case (Seq c1 c2)
have exec_seq: "\<Gamma>\<turnstile>\<langle>sequence Seq (flatten (Seq c1 c2)),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases s)
case (Normal s')
with exec_seq obtain s'' where
"\<Gamma>\<turnstile>\<langle>sequence Seq (flatten c1),Normal s'\<rangle> =n\<Rightarrow> s''" and
"\<Gamma>\<turnstile>\<langle>sequence Seq (flatten c2),s''\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_sequence_appE)
with Seq.hyps Normal
show ?thesis
by (fastforce intro: execn.intros)
next
case Abrupt
with exec_seq
show ?thesis by (auto intro: execn.intros dest: execn_Abrupt_end)
next
case Fault
with exec_seq
show ?thesis by (auto intro: execn.intros dest: execn_Fault_end)
next
case Stuck
with exec_seq
show ?thesis by (auto intro: execn.intros dest: execn_Stuck_end)
qed
qed auto
lemma execn_normalize_to_execn:
shows "\<And>s t n. \<Gamma>\<turnstile>\<langle>normalize c,s\<rangle> =n\<Rightarrow> t \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
proof (induct c)
case Skip thus ?case by simp
next
case Basic thus ?case by simp
next
case Spec thus ?case by simp
next
case (Seq c1 c2)
have "\<Gamma>\<turnstile>\<langle>normalize (Seq c1 c2),s\<rangle> =n\<Rightarrow> t" by fact
hence exec_norm_seq:
"\<Gamma>\<turnstile>\<langle>sequence Seq (flatten (normalize c1) @ flatten (normalize c2)),s\<rangle> =n\<Rightarrow> t"
by simp
show ?case
proof (cases s)
case (Normal s')
with exec_norm_seq obtain s'' where
exec_norm_c1: "\<Gamma>\<turnstile>\<langle>sequence Seq (flatten (normalize c1)),Normal s'\<rangle> =n\<Rightarrow> s''" and
exec_norm_c2: "\<Gamma>\<turnstile>\<langle>sequence Seq (flatten (normalize c2)),s''\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_sequence_appE)
from execn_sequence_flatten_to_execn [OF exec_norm_c1]
execn_sequence_flatten_to_execn [OF exec_norm_c2] Seq.hyps Normal
show ?thesis
by (fastforce intro: execn.intros)
next
case (Abrupt s')
with exec_norm_seq have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by (auto intro: execn.intros)
next
case (Fault f)
with exec_norm_seq have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by (auto intro: execn.intros)
next
case Stuck
with exec_norm_seq have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by (auto intro: execn.intros)
qed
next
case Cond thus ?case
by (auto intro: execn.intros elim!: execn_elim_cases)
next
case (While b c)
have "\<Gamma>\<turnstile>\<langle>normalize (While b c),s\<rangle> =n\<Rightarrow> t" by fact
hence exec_norm_w: "\<Gamma>\<turnstile>\<langle>While b (normalize c),s\<rangle> =n\<Rightarrow> t"
by simp
{
fix s t w
assume exec_w: "\<Gamma>\<turnstile>\<langle>w,s\<rangle> =n\<Rightarrow> t"
have "w=While b (normalize c) \<Longrightarrow> \<Gamma>\<turnstile>\<langle>While b c,s\<rangle> =n\<Rightarrow> t"
using exec_w
proof (induct)
case (WhileTrue s b' c' n w t)
from WhileTrue obtain
s_in_b: "s \<in> b" and
exec_c: "\<Gamma>\<turnstile>\<langle>normalize c,Normal s\<rangle> =n\<Rightarrow> w" and
hyp_w: "\<Gamma>\<turnstile>\<langle>While b c,w\<rangle> =n\<Rightarrow> t"
by simp
from While.hyps [OF exec_c]
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with hyp_w s_in_b
have "\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> =n\<Rightarrow> t"
by (auto intro: execn.intros)
with WhileTrue show ?case by simp
qed (auto intro: execn.intros)
}
from this [OF exec_norm_w]
show ?case
by simp
next
case Call thus ?case by simp
next
case DynCom thus ?case by (auto intro: execn.intros elim!: execn_elim_cases)
next
case Guard thus ?case by (auto intro: execn.intros elim!: execn_elim_cases)
next
case Throw thus ?case by simp
next
case Catch thus ?case by (fastforce intro: execn.intros elim!: execn_elim_cases)
qed
lemma execn_normalize_iff_execn:
"\<Gamma>\<turnstile>\<langle>normalize c,s\<rangle> =n\<Rightarrow> t = \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
by (auto intro: execn_to_execn_normalize execn_normalize_to_execn)
lemma exec_sequence_app:
assumes exec_xs: "\<Gamma>\<turnstile>\<langle>sequence Seq xs,Normal s\<rangle> \<Rightarrow> s'"
assumes exec_ys: "\<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> \<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>sequence Seq (xs@ys),Normal s\<rangle> \<Rightarrow> t"
proof -
from exec_to_execn [OF exec_xs]
obtain n where
execn_xs: "\<Gamma>\<turnstile>\<langle>sequence Seq xs,Normal s\<rangle> =n\<Rightarrow> s'"..
from exec_to_execn [OF exec_ys]
obtain m where
execn_ys: "\<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> =m\<Rightarrow> t"..
with execn_xs obtain
"\<Gamma>\<turnstile>\<langle>sequence Seq xs,Normal s\<rangle> =max n m\<Rightarrow> s'"
"\<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> =max n m\<Rightarrow> t"
by (auto intro: execn_mono max.cobounded1 max.cobounded2)
from execn_sequence_app [OF this]
have "\<Gamma>\<turnstile>\<langle>sequence Seq (xs @ ys),Normal s\<rangle> =max n m\<Rightarrow> t" .
thus ?thesis
by (rule execn_to_exec)
qed
lemma exec_sequence_appD:
assumes exec_xs_ys: "\<Gamma>\<turnstile>\<langle>sequence Seq (xs @ ys),Normal s\<rangle> \<Rightarrow> t"
shows "\<exists>s'. \<Gamma>\<turnstile>\<langle>sequence Seq xs,Normal s\<rangle> \<Rightarrow> s' \<and> \<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> \<Rightarrow> t"
proof -
from exec_to_execn [OF exec_xs_ys]
obtain n where "\<Gamma>\<turnstile>\<langle>sequence Seq (xs @ ys),Normal s\<rangle> =n\<Rightarrow> t"..
thus ?thesis
by (cases rule: execn_sequence_appE) (auto intro: execn_to_exec)
qed
lemma exec_sequence_appE [consumes 1]:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>sequence Seq (xs @ ys),Normal s\<rangle> \<Rightarrow> t;
\<And>s'. \<lbrakk>\<Gamma>\<turnstile>\<langle>sequence Seq xs,Normal s\<rangle> \<Rightarrow> s';\<Gamma>\<turnstile>\<langle>sequence Seq ys,s'\<rangle> \<Rightarrow> t\<rbrakk> \<Longrightarrow> P
\<rbrakk> \<Longrightarrow> P"
by (auto dest: exec_sequence_appD)
lemma exec_to_exec_sequence_flatten:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>sequence Seq (flatten c),s\<rangle> \<Rightarrow> t"
proof -
from exec_to_execn [OF exec]
obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"..
from execn_to_execn_sequence_flatten [OF this]
show ?thesis
by (rule execn_to_exec)
qed
lemma exec_sequence_flatten_to_exec:
assumes exec_seq: "\<Gamma>\<turnstile>\<langle>sequence Seq (flatten c),s\<rangle> \<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
proof -
from exec_to_execn [OF exec_seq]
obtain n where "\<Gamma>\<turnstile>\<langle>sequence Seq (flatten c),s\<rangle> =n\<Rightarrow> t"..
from execn_sequence_flatten_to_execn [OF this]
show ?thesis
by (rule execn_to_exec)
qed
lemma exec_to_exec_normalize:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>normalize c,s\<rangle> \<Rightarrow> t"
proof -
from exec_to_execn [OF exec] obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"..
hence "\<Gamma>\<turnstile>\<langle>normalize c,s\<rangle> =n\<Rightarrow> t"
by (rule execn_to_execn_normalize)
thus ?thesis
by (rule execn_to_exec)
qed
lemma exec_normalize_to_exec:
assumes exec: "\<Gamma>\<turnstile>\<langle>normalize c,s\<rangle> \<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
proof -
from exec_to_execn [OF exec] obtain n where "\<Gamma>\<turnstile>\<langle>normalize c,s\<rangle> =n\<Rightarrow> t"..
hence "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
by (rule execn_normalize_to_execn)
thus ?thesis
by (rule execn_to_exec)
qed
lemma execn_to_execn_subseteq_guards: "\<And>c s t n. \<lbrakk>c \<subseteq>\<^sub>g c'; \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t\<rbrakk>
\<Longrightarrow> \<exists>t'. \<Gamma>\<turnstile>\<langle>c',s\<rangle> =n\<Rightarrow> t' \<and>
(isFault t \<longrightarrow> isFault t') \<and> (\<not> isFault t' \<longrightarrow> t'=t)"
proof (induct c')
case Skip thus ?case
by (fastforce dest: subseteq_guardsD elim: execn_elim_cases)
next
case Basic thus ?case
by (fastforce dest: subseteq_guardsD elim: execn_elim_cases)
next
case Spec thus ?case
by (fastforce dest: subseteq_guardsD elim: execn_elim_cases)
next
case (Seq c1' c2')
have "c \<subseteq>\<^sub>g Seq c1' c2'" by fact
from subseteq_guards_Seq [OF this]
obtain c1 c2 where
c: "c = Seq c1 c2" and
c1_c1': "c1 \<subseteq>\<^sub>g c1'" and
c2_c2': "c2 \<subseteq>\<^sub>g c2'"
by blast
have exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" by fact
with c obtain w where
exec_c1: "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> =n\<Rightarrow> w" and
exec_c2: "\<Gamma>\<turnstile>\<langle>c2,w\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_elim_cases)
from exec_c1 Seq.hyps c1_c1'
obtain w' where
exec_c1': "\<Gamma>\<turnstile>\<langle>c1',s\<rangle> =n\<Rightarrow> w'" and
w_Fault: "isFault w \<longrightarrow> isFault w'" and
w'_noFault: "\<not> isFault w' \<longrightarrow> w'=w"
by blast
show ?case
proof (cases "s")
case (Fault f)
with exec have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
show ?thesis
proof (cases "isFault w")
case True
then obtain f where w': "w=Fault f"..
moreover with exec_c2
have t: "t=Fault f"
by (auto dest: execn_Fault_end)
ultimately show ?thesis
using Normal w_Fault exec_c1'
by (fastforce intro: execn.intros elim: isFaultE)
next
case False
note noFault_w = this
show ?thesis
proof (cases "isFault w'")
case True
then obtain f' where w': "w'=Fault f'"..
with Normal exec_c1'
have exec: "\<Gamma>\<turnstile>\<langle>Seq c1' c2',s\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
then show ?thesis
by auto
next
case False
with w'_noFault have w': "w'=w" by simp
from Seq.hyps exec_c2 c2_c2'
obtain t' where
"\<Gamma>\<turnstile>\<langle>c2',w\<rangle> =n\<Rightarrow> t'" and
"isFault t \<longrightarrow> isFault t'" and
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with Normal exec_c1' w'
show ?thesis
by (fastforce intro: execn.intros)
qed
qed
qed
next
case (Cond b c1' c2')
have exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" by fact
have "c \<subseteq>\<^sub>g Cond b c1' c2'" by fact
from subseteq_guards_Cond [OF this]
obtain c1 c2 where
c: "c = Cond b c1 c2" and
c1_c1': "c1 \<subseteq>\<^sub>g c1'" and
c2_c2': "c2 \<subseteq>\<^sub>g c2'"
by blast
show ?case
proof (cases "s")
case (Fault f)
with exec have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
from exec [simplified c Normal]
show ?thesis
proof (cases)
assume s'_in_b: "s' \<in> b"
assume "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> t"
with c1_c1' Normal Cond.hyps obtain t' where
"\<Gamma>\<turnstile>\<langle>c1',Normal s'\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"\<not> isFault t' \<longrightarrow> t' = t"
by blast
with s'_in_b Normal show ?thesis
by (fastforce intro: execn.intros)
next
assume s'_notin_b: "s' \<notin> b"
assume "\<Gamma>\<turnstile>\<langle>c2,Normal s'\<rangle> =n\<Rightarrow> t"
with c2_c2' Normal Cond.hyps obtain t' where
"\<Gamma>\<turnstile>\<langle>c2',Normal s'\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"\<not> isFault t' \<longrightarrow> t' = t"
by blast
with s'_notin_b Normal show ?thesis
by (fastforce intro: execn.intros)
qed
qed
next
case (While b c')
have exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" by fact
have "c \<subseteq>\<^sub>g While b c'" by fact
from subseteq_guards_While [OF this]
obtain c'' where
c: "c = While b c''" and
c''_c': "c'' \<subseteq>\<^sub>g c'"
by blast
{
fix c r w
assume exec: "\<Gamma>\<turnstile>\<langle>c,r\<rangle> =n\<Rightarrow> w"
assume c: "c=While b c''"
have "\<exists>w'. \<Gamma>\<turnstile>\<langle>While b c',r\<rangle> =n\<Rightarrow> w' \<and>
(isFault w \<longrightarrow> isFault w') \<and> (\<not> isFault w' \<longrightarrow> w'=w)"
using exec c
proof (induct)
case (WhileTrue r b' ca n u w)
have eqs: "While b' ca = While b c''" by fact
from WhileTrue have r_in_b: "r \<in> b" by simp
from WhileTrue have exec_c'': "\<Gamma>\<turnstile>\<langle>c'',Normal r\<rangle> =n\<Rightarrow> u" by simp
from While.hyps [OF c''_c' exec_c''] obtain u' where
exec_c': "\<Gamma>\<turnstile>\<langle>c',Normal r\<rangle> =n\<Rightarrow> u'" and
u_Fault: "isFault u \<longrightarrow> isFault u' "and
u'_noFault: "\<not> isFault u' \<longrightarrow> u' = u"
by blast
from WhileTrue obtain w' where
exec_w: "\<Gamma>\<turnstile>\<langle>While b c',u\<rangle> =n\<Rightarrow> w'" and
w_Fault: "isFault w \<longrightarrow> isFault w'" and
w'_noFault: "\<not> isFault w' \<longrightarrow> w' = w"
by blast
show ?case
proof (cases "isFault u'")
case True
with exec_c' r_in_b
show ?thesis
by (fastforce intro: execn.intros elim: isFaultE)
next
case False
with exec_c' r_in_b u'_noFault exec_w w_Fault w'_noFault
show ?thesis
by (fastforce intro: execn.intros)
qed
next
case WhileFalse thus ?case by (fastforce intro: execn.intros)
qed auto
}
from this [OF exec c]
show ?case .
next
case Call thus ?case
by (fastforce dest: subseteq_guardsD elim: execn_elim_cases)
next
case (DynCom C')
have exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" by fact
have "c \<subseteq>\<^sub>g DynCom C'" by fact
from subseteq_guards_DynCom [OF this] obtain C where
c: "c = DynCom C" and
C_C': "\<forall>s. C s \<subseteq>\<^sub>g C' s"
by blast
show ?case
proof (cases "s")
case (Fault f)
with exec have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
from exec [simplified c Normal]
have "\<Gamma>\<turnstile>\<langle>C s',Normal s'\<rangle> =n\<Rightarrow> t"
by cases
from DynCom.hyps C_C' [rule_format] this obtain t' where
"\<Gamma>\<turnstile>\<langle>C' s',Normal s'\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"\<not> isFault t' \<longrightarrow> t' = t"
by blast
with Normal show ?thesis
by (fastforce intro: execn.intros)
qed
next
case (Guard f' g' c')
have exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" by fact
have "c \<subseteq>\<^sub>g Guard f' g' c'" by fact
hence subset_cases: "(c \<subseteq>\<^sub>g c') \<or> (\<exists>c''. c = Guard f' g' c'' \<and> (c'' \<subseteq>\<^sub>g c'))"
by (rule subseteq_guards_Guard)
show ?case
proof (cases "s")
case (Fault f)
with exec have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
from subset_cases show ?thesis
proof
assume c_c': "c \<subseteq>\<^sub>g c'"
from Guard.hyps [OF this exec] Normal obtain t' where
exec_c': "\<Gamma>\<turnstile>\<langle>c',Normal s'\<rangle> =n\<Rightarrow> t'" and
t_Fault: "isFault t \<longrightarrow> isFault t'" and
t_noFault: "\<not> isFault t' \<longrightarrow> t' = t"
by blast
with Normal
show ?thesis
by (cases "s' \<in> g'") (fastforce intro: execn.intros)+
next
assume "\<exists>c''. c = Guard f' g' c'' \<and> (c'' \<subseteq>\<^sub>g c')"
then obtain c'' where
c: "c = Guard f' g' c''" and
c''_c': "c'' \<subseteq>\<^sub>g c'"
by blast
from c exec Normal
have exec_Guard': "\<Gamma>\<turnstile>\<langle>Guard f' g' c'',Normal s'\<rangle> =n\<Rightarrow> t"
by simp
thus ?thesis
proof (cases)
assume s'_in_g': "s' \<in> g'"
assume exec_c'': "\<Gamma>\<turnstile>\<langle>c'',Normal s'\<rangle> =n\<Rightarrow> t"
from Guard.hyps [OF c''_c' exec_c''] obtain t' where
exec_c': "\<Gamma>\<turnstile>\<langle>c',Normal s'\<rangle> =n\<Rightarrow> t'" and
t_Fault: "isFault t \<longrightarrow> isFault t'" and
t_noFault: "\<not> isFault t' \<longrightarrow> t' = t"
by blast
with Normal s'_in_g'
show ?thesis
by (fastforce intro: execn.intros)
next
assume "s' \<notin> g'" "t=Fault f'"
with Normal show ?thesis
by (fastforce intro: execn.intros)
qed
qed
qed
next
case Throw thus ?case
by (fastforce dest: subseteq_guardsD intro: execn.intros
elim: execn_elim_cases)
next
case (Catch c1' c2')
have "c \<subseteq>\<^sub>g Catch c1' c2'" by fact
from subseteq_guards_Catch [OF this]
obtain c1 c2 where
c: "c = Catch c1 c2" and
c1_c1': "c1 \<subseteq>\<^sub>g c1'" and
c2_c2': "c2 \<subseteq>\<^sub>g c2'"
by blast
have exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases "s")
case (Fault f)
with exec have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
from exec [simplified c Normal]
show ?thesis
proof (cases)
fix w
assume exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> Abrupt w"
assume exec_c2: "\<Gamma>\<turnstile>\<langle>c2,Normal w\<rangle> =n\<Rightarrow> t"
from Normal exec_c1 c1_c1' Catch.hyps obtain w' where
exec_c1': "\<Gamma>\<turnstile>\<langle>c1',Normal s'\<rangle> =n\<Rightarrow> w'" and
w'_noFault: "\<not> isFault w' \<longrightarrow> w' = Abrupt w"
by blast
show ?thesis
proof (cases "isFault w'")
case True
with exec_c1' Normal show ?thesis
by (fastforce intro: execn.intros elim: isFaultE)
next
case False
with w'_noFault have w': "w'=Abrupt w" by simp
from Normal exec_c2 c2_c2' Catch.hyps obtain t' where
"\<Gamma>\<turnstile>\<langle>c2',Normal w\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"\<not> isFault t' \<longrightarrow> t' = t"
by blast
with exec_c1' w' Normal
show ?thesis
by (fastforce intro: execn.intros )
qed
next
assume exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> t"
assume t: "\<not> isAbr t"
from Normal exec_c1 c1_c1' Catch.hyps obtain t' where
exec_c1': "\<Gamma>\<turnstile>\<langle>c1',Normal s'\<rangle> =n\<Rightarrow> t'" and
t_Fault: "isFault t \<longrightarrow> isFault t'" and
t'_noFault: "\<not> isFault t' \<longrightarrow> t' = t"
by blast
show ?thesis
proof (cases "isFault t'")
case True
with exec_c1' Normal show ?thesis
by (fastforce intro: execn.intros elim: isFaultE)
next
case False
with exec_c1' Normal t_Fault t'_noFault t
show ?thesis
by (fastforce intro: execn.intros)
qed
qed
qed
qed
lemma exec_to_exec_subseteq_guards:
assumes c_c': "c \<subseteq>\<^sub>g c'"
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
shows "\<exists>t'. \<Gamma>\<turnstile>\<langle>c',s\<rangle> \<Rightarrow> t' \<and>
(isFault t \<longrightarrow> isFault t') \<and> (\<not> isFault t' \<longrightarrow> t'=t)"
proof -
from exec_to_execn [OF exec] obtain n where
"\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" ..
from execn_to_execn_subseteq_guards [OF c_c' this]
show ?thesis
by (blast intro: execn_to_exec)
qed
(* ************************************************************************* *)
subsection \<open>Lemmas about @{const "merge_guards"}\<close>
(* ************************************************************************ *)
theorem execn_to_execn_merge_guards:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
shows "\<Gamma>\<turnstile>\<langle>merge_guards c,s\<rangle> =n\<Rightarrow> t "
using exec_c
proof (induct)
case (Guard s g c n t f)
have s_in_g: "s \<in> g" by fact
have exec_merge_c: "\<Gamma>\<turnstile>\<langle>merge_guards c,Normal s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases "\<exists>f' g' c'. merge_guards c = Guard f' g' c'")
case False
with exec_merge_c s_in_g
show ?thesis
by (cases "merge_guards c") (auto intro: execn.intros simp add: Let_def)
next
case True
then obtain f' g' c' where
merge_guards_c: "merge_guards c = Guard f' g' c'"
by iprover
show ?thesis
proof (cases "f=f'")
case False
from exec_merge_c s_in_g merge_guards_c False show ?thesis
by (auto intro: execn.intros simp add: Let_def)
next
case True
from exec_merge_c s_in_g merge_guards_c True show ?thesis
by (fastforce intro: execn.intros elim: execn.cases)
qed
qed
next
case (GuardFault s g f c n)
have s_notin_g: "s \<notin> g" by fact
show ?case
proof (cases "\<exists>f' g' c'. merge_guards c = Guard f' g' c'")
case False
with s_notin_g
show ?thesis
by (cases "merge_guards c") (auto intro: execn.intros simp add: Let_def)
next
case True
then obtain f' g' c' where
merge_guards_c: "merge_guards c = Guard f' g' c'"
by iprover
show ?thesis
proof (cases "f=f'")
case False
from s_notin_g merge_guards_c False show ?thesis
by (auto intro: execn.intros simp add: Let_def)
next
case True
from s_notin_g merge_guards_c True show ?thesis
by (fastforce intro: execn.intros)
qed
qed
qed (fastforce intro: execn.intros)+
lemma execn_merge_guards_to_execn_Normal:
"\<And>s n t. \<Gamma>\<turnstile>\<langle>merge_guards c,Normal s\<rangle> =n\<Rightarrow> t \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t"
proof (induct c)
case Skip thus ?case by auto
next
case Basic thus ?case by auto
next
case Spec thus ?case by auto
next
case (Seq c1 c2)
have "\<Gamma>\<turnstile>\<langle>merge_guards (Seq c1 c2),Normal s\<rangle> =n\<Rightarrow> t" by fact
hence exec_merge: "\<Gamma>\<turnstile>\<langle>Seq (merge_guards c1) (merge_guards c2),Normal s\<rangle> =n\<Rightarrow> t"
by simp
then obtain s' where
exec_merge_c1: "\<Gamma>\<turnstile>\<langle>merge_guards c1,Normal s\<rangle> =n\<Rightarrow> s'" and
exec_merge_c2: "\<Gamma>\<turnstile>\<langle>merge_guards c2,s'\<rangle> =n\<Rightarrow> t"
by cases
from exec_merge_c1
have exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> s'"
by (rule Seq.hyps)
show ?case
proof (cases s')
case (Normal s'')
with exec_merge_c2
have "\<Gamma>\<turnstile>\<langle>c2,s'\<rangle> =n\<Rightarrow> t"
by (auto intro: Seq.hyps)
with exec_c1 show ?thesis
by (auto intro: execn.intros)
next
case (Abrupt s'')
with exec_merge_c2 have "t=Abrupt s''"
by (auto dest: execn_Abrupt_end)
with exec_c1 Abrupt
show ?thesis
by (auto intro: execn.intros)
next
case (Fault f)
with exec_merge_c2 have "t=Fault f"
by (auto dest: execn_Fault_end)
with exec_c1 Fault
show ?thesis
by (auto intro: execn.intros)
next
case Stuck
with exec_merge_c2 have "t=Stuck"
by (auto dest: execn_Stuck_end)
with exec_c1 Stuck
show ?thesis
by (auto intro: execn.intros)
qed
next
case Cond thus ?case
by (fastforce intro: execn.intros elim: execn_Normal_elim_cases)
next
case (While b c)
{
fix c' r w
assume exec_c': "\<Gamma>\<turnstile>\<langle>c',r\<rangle> =n\<Rightarrow> w"
assume c': "c'=While b (merge_guards c)"
have "\<Gamma>\<turnstile>\<langle>While b c,r\<rangle> =n\<Rightarrow> w"
using exec_c' c'
proof (induct)
case (WhileTrue r b' c'' n u w)
have eqs: "While b' c'' = While b (merge_guards c)" by fact
from WhileTrue
have r_in_b: "r \<in> b"
by simp
from WhileTrue While.hyps have exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal r\<rangle> =n\<Rightarrow> u"
by simp
from WhileTrue have exec_w: "\<Gamma>\<turnstile>\<langle>While b c,u\<rangle> =n\<Rightarrow> w"
by simp
from r_in_b exec_c exec_w
show ?case
by (rule execn.WhileTrue)
next
case WhileFalse thus ?case by (auto intro: execn.WhileFalse)
qed auto
}
with While.prems show ?case
by (auto)
next
case Call thus ?case by simp
next
case DynCom thus ?case
by (fastforce intro: execn.intros elim: execn_Normal_elim_cases)
next
case (Guard f g c)
have exec_merge: "\<Gamma>\<turnstile>\<langle>merge_guards (Guard f g c),Normal s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases "s \<in> g")
case False
with exec_merge have "t=Fault f"
by (auto split: com.splits if_split_asm elim: execn_Normal_elim_cases
simp add: Let_def is_Guard_def)
with False show ?thesis
by (auto intro: execn.intros)
next
case True
note s_in_g = this
show ?thesis
proof (cases "\<exists>f' g' c'. merge_guards c = Guard f' g' c'")
case False
then
have "merge_guards (Guard f g c) = Guard f g (merge_guards c)"
by (cases "merge_guards c") (auto simp add: Let_def)
with exec_merge s_in_g
obtain "\<Gamma>\<turnstile>\<langle>merge_guards c,Normal s\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
from Guard.hyps [OF this] s_in_g
show ?thesis
by (auto intro: execn.intros)
next
case True
then obtain f' g' c' where
merge_guards_c: "merge_guards c = Guard f' g' c'"
by iprover
show ?thesis
proof (cases "f=f'")
case False
with merge_guards_c
have "merge_guards (Guard f g c) = Guard f g (merge_guards c)"
by (simp add: Let_def)
with exec_merge s_in_g
obtain "\<Gamma>\<turnstile>\<langle>merge_guards c,Normal s\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
from Guard.hyps [OF this] s_in_g
show ?thesis
by (auto intro: execn.intros)
next
case True
note f_eq_f' = this
with merge_guards_c have
merge_guards_Guard: "merge_guards (Guard f g c) = Guard f (g \<inter> g') c'"
by simp
show ?thesis
proof (cases "s \<in> g'")
case True
with exec_merge merge_guards_Guard merge_guards_c s_in_g
have "\<Gamma>\<turnstile>\<langle>merge_guards c,Normal s\<rangle> =n\<Rightarrow> t"
by (auto intro: execn.intros elim: execn_Normal_elim_cases)
with Guard.hyps [OF this] s_in_g
show ?thesis
by (auto intro: execn.intros)
next
case False
with exec_merge merge_guards_Guard
have "t=Fault f"
by (auto elim: execn_Normal_elim_cases)
with merge_guards_c f_eq_f' False
have "\<Gamma>\<turnstile>\<langle>merge_guards c,Normal s\<rangle> =n\<Rightarrow> t"
by (auto intro: execn.intros)
from Guard.hyps [OF this] s_in_g
show ?thesis
by (auto intro: execn.intros)
qed
qed
qed
qed
next
case Throw thus ?case by simp
next
case (Catch c1 c2)
have "\<Gamma>\<turnstile>\<langle>merge_guards (Catch c1 c2),Normal s\<rangle> =n\<Rightarrow> t" by fact
hence "\<Gamma>\<turnstile>\<langle>Catch (merge_guards c1) (merge_guards c2),Normal s\<rangle> =n\<Rightarrow> t" by simp
thus ?case
by cases (auto intro: execn.intros Catch.hyps)
qed
theorem execn_merge_guards_to_execn:
"\<Gamma>\<turnstile>\<langle>merge_guards c,s\<rangle> =n\<Rightarrow> t \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c, s\<rangle> =n\<Rightarrow> t"
apply (cases s)
apply (fastforce intro: execn_merge_guards_to_execn_Normal)
apply (fastforce dest: execn_Abrupt_end)
apply (fastforce dest: execn_Fault_end)
apply (fastforce dest: execn_Stuck_end)
done
corollary execn_iff_execn_merge_guards:
"\<Gamma>\<turnstile>\<langle>c, s\<rangle> =n\<Rightarrow> t = \<Gamma>\<turnstile>\<langle>merge_guards c,s\<rangle> =n\<Rightarrow> t"
by (blast intro: execn_merge_guards_to_execn execn_to_execn_merge_guards)
theorem exec_iff_exec_merge_guards:
"\<Gamma>\<turnstile>\<langle>c, s\<rangle> \<Rightarrow> t = \<Gamma>\<turnstile>\<langle>merge_guards c,s\<rangle> \<Rightarrow> t"
by (blast dest: exec_to_execn intro: execn_to_exec
intro: execn_to_execn_merge_guards
execn_merge_guards_to_execn)
corollary exec_to_exec_merge_guards:
"\<Gamma>\<turnstile>\<langle>c, s\<rangle> \<Rightarrow> t \<Longrightarrow> \<Gamma>\<turnstile>\<langle>merge_guards c,s\<rangle> \<Rightarrow> t"
by (rule iffD1 [OF exec_iff_exec_merge_guards])
corollary exec_merge_guards_to_exec:
"\<Gamma>\<turnstile>\<langle>merge_guards c,s\<rangle> \<Rightarrow> t \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c, s\<rangle> \<Rightarrow> t"
by (rule iffD2 [OF exec_iff_exec_merge_guards])
(* ************************************************************************* *)
subsection \<open>Lemmas about @{const "mark_guards"}\<close>
(* ************************************************************************ *)
lemma execn_to_execn_mark_guards:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes t_not_Fault: "\<not> isFault t"
shows "\<Gamma>\<turnstile>\<langle>mark_guards f c,s\<rangle> =n\<Rightarrow> t "
using exec_c t_not_Fault [simplified not_isFault_iff]
by (induct) (auto intro: execn.intros dest: noFaultn_startD')
lemma execn_to_execn_mark_guards_Fault:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
shows "\<And>f. \<lbrakk>t=Fault f\<rbrakk> \<Longrightarrow> \<exists>f'. \<Gamma>\<turnstile>\<langle>mark_guards x c,s\<rangle> =n\<Rightarrow> Fault f'"
using exec_c
proof (induct)
case Skip thus ?case by auto
next
case Guard thus ?case by (fastforce intro: execn.intros)
next
case GuardFault thus ?case by (fastforce intro: execn.intros)
next
case FaultProp thus ?case by auto
next
case Basic thus ?case by auto
next
case Spec thus ?case by auto
next
case SpecStuck thus ?case by auto
next
case (Seq c1 s n w c2 t)
have exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> w" by fact
have exec_c2: "\<Gamma>\<turnstile>\<langle>c2,w\<rangle> =n\<Rightarrow> t" by fact
have t: "t=Fault f" by fact
show ?case
proof (cases w)
case (Fault f')
with exec_c2 t have "f'=f"
by (auto dest: execn_Fault_end)
with Fault Seq.hyps obtain f'' where
"\<Gamma>\<turnstile>\<langle>mark_guards x c1,Normal s\<rangle> =n\<Rightarrow> Fault f''"
by auto
moreover have "\<Gamma>\<turnstile>\<langle>mark_guards x c2,Fault f''\<rangle> =n\<Rightarrow> Fault f''"
by auto
ultimately show ?thesis
by (auto intro: execn.intros)
next
case (Normal s')
with execn_to_execn_mark_guards [OF exec_c1]
have exec_mark_c1: "\<Gamma>\<turnstile>\<langle>mark_guards x c1,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with Seq.hyps t obtain f' where
"\<Gamma>\<turnstile>\<langle>mark_guards x c2,w\<rangle> =n\<Rightarrow> Fault f'"
by blast
with exec_mark_c1 show ?thesis
by (auto intro: execn.intros)
next
case (Abrupt s')
with execn_to_execn_mark_guards [OF exec_c1]
have exec_mark_c1: "\<Gamma>\<turnstile>\<langle>mark_guards x c1,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with Seq.hyps t obtain f' where
"\<Gamma>\<turnstile>\<langle>mark_guards x c2,w\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
with exec_mark_c1 show ?thesis
by (auto intro: execn.intros)
next
case Stuck
with exec_c2 have "t=Stuck"
by (auto dest: execn_Stuck_end)
with t show ?thesis by simp
qed
next
case CondTrue thus ?case by (fastforce intro: execn.intros)
next
case CondFalse thus ?case by (fastforce intro: execn.intros)
next
case (WhileTrue s b c n w t)
have exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> w" by fact
have exec_w: "\<Gamma>\<turnstile>\<langle>While b c,w\<rangle> =n\<Rightarrow> t" by fact
have t: "t = Fault f" by fact
have s_in_b: "s \<in> b" by fact
show ?case
proof (cases w)
case (Fault f')
with exec_w t have "f'=f"
by (auto dest: execn_Fault_end)
with Fault WhileTrue.hyps obtain f'' where
"\<Gamma>\<turnstile>\<langle>mark_guards x c,Normal s\<rangle> =n\<Rightarrow> Fault f''"
by auto
moreover have "\<Gamma>\<turnstile>\<langle>mark_guards x (While b c),Fault f''\<rangle> =n\<Rightarrow> Fault f''"
by auto
ultimately show ?thesis
using s_in_b by (auto intro: execn.intros)
next
case (Normal s')
with execn_to_execn_mark_guards [OF exec_c]
have exec_mark_c: "\<Gamma>\<turnstile>\<langle>mark_guards x c,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with WhileTrue.hyps t obtain f' where
"\<Gamma>\<turnstile>\<langle>mark_guards x (While b c),w\<rangle> =n\<Rightarrow> Fault f'"
by blast
with exec_mark_c s_in_b show ?thesis
by (auto intro: execn.intros)
next
case (Abrupt s')
with execn_to_execn_mark_guards [OF exec_c]
have exec_mark_c: "\<Gamma>\<turnstile>\<langle>mark_guards x c,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with WhileTrue.hyps t obtain f' where
"\<Gamma>\<turnstile>\<langle>mark_guards x (While b c),w\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
with exec_mark_c s_in_b show ?thesis
by (auto intro: execn.intros)
next
case Stuck
with exec_w have "t=Stuck"
by (auto dest: execn_Stuck_end)
with t show ?thesis by simp
qed
next
case WhileFalse thus ?case by (fastforce intro: execn.intros)
next
case Call thus ?case by (fastforce intro: execn.intros)
next
case CallUndefined thus ?case by simp
next
case StuckProp thus ?case by simp
next
case DynCom thus ?case by (fastforce intro: execn.intros)
next
case Throw thus ?case by simp
next
case AbruptProp thus ?case by simp
next
case (CatchMatch c1 s n w c2 t)
have exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> Abrupt w" by fact
have exec_c2: "\<Gamma>\<turnstile>\<langle>c2,Normal w\<rangle> =n\<Rightarrow> t" by fact
have t: "t = Fault f" by fact
from execn_to_execn_mark_guards [OF exec_c1]
have exec_mark_c1: "\<Gamma>\<turnstile>\<langle>mark_guards x c1,Normal s\<rangle> =n\<Rightarrow> Abrupt w"
by simp
with CatchMatch.hyps t obtain f' where
"\<Gamma>\<turnstile>\<langle>mark_guards x c2,Normal w\<rangle> =n\<Rightarrow> Fault f'"
by blast
with exec_mark_c1 show ?case
by (auto intro: execn.intros)
next
case CatchMiss thus ?case by (fastforce intro: execn.intros)
qed
lemma execn_mark_guards_to_execn:
"\<And>s n t. \<Gamma>\<turnstile>\<langle>mark_guards f c,s\<rangle> =n\<Rightarrow> t
\<Longrightarrow> \<exists>t'. \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t' \<and>
(isFault t \<longrightarrow> isFault t') \<and>
(t' = Fault f \<longrightarrow> t'=t) \<and>
(isFault t' \<longrightarrow> isFault t) \<and>
(\<not> isFault t' \<longrightarrow> t'=t)"
proof (induct c)
case Skip thus ?case by auto
next
case Basic thus ?case by auto
next
case Spec thus ?case by auto
next
case (Seq c1 c2 s n t)
have exec_mark: "\<Gamma>\<turnstile>\<langle>mark_guards f (Seq c1 c2),s\<rangle> =n\<Rightarrow> t" by fact
then obtain w where
exec_mark_c1: "\<Gamma>\<turnstile>\<langle>mark_guards f c1,s\<rangle> =n\<Rightarrow> w" and
exec_mark_c2: "\<Gamma>\<turnstile>\<langle>mark_guards f c2,w\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_elim_cases)
from Seq.hyps exec_mark_c1
obtain w' where
exec_c1: "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> =n\<Rightarrow> w'" and
w_Fault: "isFault w \<longrightarrow> isFault w'" and
w'_Fault_f: "w' = Fault f \<longrightarrow> w'=w" and
w'_Fault: "isFault w' \<longrightarrow> isFault w" and
w'_noFault: "\<not> isFault w' \<longrightarrow> w'=w"
by blast
show ?case
proof (cases "s")
case (Fault f)
with exec_mark have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_mark have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_mark have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
show ?thesis
proof (cases "isFault w")
case True
then obtain f where w': "w=Fault f"..
moreover with exec_mark_c2
have t: "t=Fault f"
by (auto dest: execn_Fault_end)
ultimately show ?thesis
using Normal w_Fault w'_Fault_f exec_c1
by (fastforce intro: execn.intros elim: isFaultE)
next
case False
note noFault_w = this
show ?thesis
proof (cases "isFault w'")
case True
then obtain f' where w': "w'=Fault f'"..
with Normal exec_c1
have exec: "\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
from w'_Fault_f w' noFault_w
have "f' \<noteq> f"
by (cases w) auto
moreover
from w' w'_Fault exec_mark_c2 have "isFault t"
by (auto dest: execn_Fault_end elim: isFaultE)
ultimately
show ?thesis
using exec
by auto
next
case False
with w'_noFault have w': "w'=w" by simp
from Seq.hyps exec_mark_c2
obtain t' where
"\<Gamma>\<turnstile>\<langle>c2,w\<rangle> =n\<Rightarrow> t'" and
"isFault t \<longrightarrow> isFault t'" and
"t' = Fault f \<longrightarrow> t'=t" and
"isFault t' \<longrightarrow> isFault t" and
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with Normal exec_c1 w'
show ?thesis
by (fastforce intro: execn.intros)
qed
qed
qed
next
case (Cond b c1 c2 s n t)
have exec_mark: "\<Gamma>\<turnstile>\<langle>mark_guards f (Cond b c1 c2),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases s)
case (Fault f)
with exec_mark have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_mark have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_mark have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
show ?thesis
proof (cases "s'\<in> b")
case True
with Normal exec_mark
have "\<Gamma>\<turnstile>\<langle>mark_guards f c1 ,Normal s'\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
with Normal True Cond.hyps obtain t'
where "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"t' = Fault f \<longrightarrow> t'=t"
"isFault t' \<longrightarrow> isFault t"
"\<not> isFault t' \<longrightarrow> t' = t"
by blast
with Normal True
show ?thesis
by (blast intro: execn.intros)
next
case False
with Normal exec_mark
have "\<Gamma>\<turnstile>\<langle>mark_guards f c2 ,Normal s'\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
with Normal False Cond.hyps obtain t'
where "\<Gamma>\<turnstile>\<langle>c2,Normal s'\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"t' = Fault f \<longrightarrow> t'=t"
"isFault t' \<longrightarrow> isFault t"
"\<not> isFault t' \<longrightarrow> t' = t"
by blast
with Normal False
show ?thesis
by (blast intro: execn.intros)
qed
qed
next
case (While b c s n t)
have exec_mark: "\<Gamma>\<turnstile>\<langle>mark_guards f (While b c),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases s)
case (Fault f)
with exec_mark have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_mark have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_mark have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
{
fix c' r w
assume exec_c': "\<Gamma>\<turnstile>\<langle>c',r\<rangle> =n\<Rightarrow> w"
assume c': "c'=While b (mark_guards f c)"
have "\<exists>w'. \<Gamma>\<turnstile>\<langle>While b c,r\<rangle> =n\<Rightarrow> w' \<and> (isFault w \<longrightarrow> isFault w') \<and>
(w' = Fault f \<longrightarrow> w'=w) \<and> (isFault w' \<longrightarrow> isFault w) \<and>
(\<not> isFault w' \<longrightarrow> w'=w)"
using exec_c' c'
proof (induct)
case (WhileTrue r b' c'' n u w)
have eqs: "While b' c'' = While b (mark_guards f c)" by fact
from WhileTrue.hyps eqs
have r_in_b: "r\<in>b" by simp
from WhileTrue.hyps eqs
have exec_mark_c: "\<Gamma>\<turnstile>\<langle>mark_guards f c,Normal r\<rangle> =n\<Rightarrow> u" by simp
from WhileTrue.hyps eqs
have exec_mark_w: "\<Gamma>\<turnstile>\<langle>While b (mark_guards f c),u\<rangle> =n\<Rightarrow> w"
by simp
show ?case
proof -
from WhileTrue.hyps eqs have "\<Gamma>\<turnstile>\<langle>mark_guards f c,Normal r\<rangle> =n\<Rightarrow> u"
by simp
with While.hyps
obtain u' where
exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal r\<rangle> =n\<Rightarrow> u'" and
u_Fault: "isFault u \<longrightarrow> isFault u'" and
u'_Fault_f: "u' = Fault f \<longrightarrow> u'=u" and
u'_Fault: "isFault u' \<longrightarrow> isFault u" and
u'_noFault: "\<not> isFault u' \<longrightarrow> u'=u"
by blast
show ?thesis
proof (cases "isFault u'")
case False
with u'_noFault have u': "u'=u" by simp
from WhileTrue.hyps eqs obtain w' where
"\<Gamma>\<turnstile>\<langle>While b c,u\<rangle> =n\<Rightarrow> w'"
"isFault w \<longrightarrow> isFault w'"
"w' = Fault f \<longrightarrow> w'=w"
"isFault w' \<longrightarrow> isFault w"
"\<not> isFault w' \<longrightarrow> w' = w"
by blast
with u' exec_c r_in_b
show ?thesis
by (blast intro: execn.WhileTrue)
next
case True
then obtain f' where u': "u'=Fault f'"..
with exec_c r_in_b
have exec: "\<Gamma>\<turnstile>\<langle>While b c,Normal r\<rangle> =n\<Rightarrow> Fault f'"
by (blast intro: execn.intros)
from True u'_Fault have "isFault u"
by simp
then obtain f where u: "u=Fault f"..
with exec_mark_w have "w=Fault f"
by (auto dest: execn_Fault_end)
with exec u' u u'_Fault_f
show ?thesis
by auto
qed
qed
next
case (WhileFalse r b' c'' n)
have eqs: "While b' c'' = While b (mark_guards f c)" by fact
from WhileFalse.hyps eqs
have r_not_in_b: "r\<notin>b" by simp
show ?case
proof -
from r_not_in_b
have "\<Gamma>\<turnstile>\<langle>While b c,Normal r\<rangle> =n\<Rightarrow> Normal r"
by (rule execn.WhileFalse)
thus ?thesis
by blast
qed
qed auto
} note hyp_while = this
show ?thesis
proof (cases "s'\<in>b")
case False
with Normal exec_mark
have "t=s"
by (auto elim: execn_Normal_elim_cases)
with Normal False show ?thesis
by (auto intro: execn.intros)
next
case True note s'_in_b = this
with Normal exec_mark obtain r where
exec_mark_c: "\<Gamma>\<turnstile>\<langle>mark_guards f c,Normal s'\<rangle> =n\<Rightarrow> r" and
exec_mark_w: "\<Gamma>\<turnstile>\<langle>While b (mark_guards f c),r\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
from While.hyps exec_mark_c obtain r' where
exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal s'\<rangle> =n\<Rightarrow> r'" and
r_Fault: "isFault r \<longrightarrow> isFault r'" and
r'_Fault_f: "r' = Fault f \<longrightarrow> r'=r" and
r'_Fault: "isFault r' \<longrightarrow> isFault r" and
r'_noFault: "\<not> isFault r' \<longrightarrow> r'=r"
by blast
show ?thesis
proof (cases "isFault r'")
case False
with r'_noFault have r': "r'=r" by simp
from hyp_while exec_mark_w
obtain t' where
"\<Gamma>\<turnstile>\<langle>While b c,r\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"t' = Fault f \<longrightarrow> t'=t"
"isFault t' \<longrightarrow> isFault t"
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with r' exec_c Normal s'_in_b
show ?thesis
by (blast intro: execn.intros)
next
case True
then obtain f' where r': "r'=Fault f'"..
hence "\<Gamma>\<turnstile>\<langle>While b c,r'\<rangle> =n\<Rightarrow> Fault f'"
by auto
with Normal s'_in_b exec_c
have exec: "\<Gamma>\<turnstile>\<langle>While b c,Normal s'\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
from True r'_Fault
have "isFault r"
by simp
then obtain f where r: "r=Fault f"..
with exec_mark_w have "t=Fault f"
by (auto dest: execn_Fault_end)
with Normal exec r' r r'_Fault_f
show ?thesis
by auto
qed
qed
qed
next
case Call thus ?case by auto
next
case DynCom thus ?case
by (fastforce elim!: execn_elim_cases intro: execn.intros)
next
case (Guard f' g c s n t)
have exec_mark: "\<Gamma>\<turnstile>\<langle>mark_guards f (Guard f' g c),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases s)
case (Fault f)
with exec_mark have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_mark have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_mark have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
show ?thesis
proof (cases "s'\<in>g")
case False
with Normal exec_mark have t: "t=Fault f"
by (auto elim: execn_Normal_elim_cases)
from False
have "\<Gamma>\<turnstile>\<langle>Guard f' g c,Normal s'\<rangle> =n\<Rightarrow> Fault f'"
by (blast intro: execn.intros)
with Normal t show ?thesis
by auto
next
case True
with exec_mark Normal
have "\<Gamma>\<turnstile>\<langle>mark_guards f c,Normal s'\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
with Guard.hyps obtain t' where
"\<Gamma>\<turnstile>\<langle>c,Normal s'\<rangle> =n\<Rightarrow> t'" and
"isFault t \<longrightarrow> isFault t'" and
"t' = Fault f \<longrightarrow> t'=t" and
"isFault t' \<longrightarrow> isFault t" and
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with Normal True
show ?thesis
by (blast intro: execn.intros)
qed
qed
next
case Throw thus ?case by auto
next
case (Catch c1 c2 s n t)
have exec_mark: "\<Gamma>\<turnstile>\<langle>mark_guards f (Catch c1 c2),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases "s")
case (Fault f)
with exec_mark have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_mark have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_mark have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s') note s=this
with exec_mark have
"\<Gamma>\<turnstile>\<langle>Catch (mark_guards f c1) (mark_guards f c2),Normal s'\<rangle> =n\<Rightarrow> t" by simp
thus ?thesis
proof (cases)
fix w
assume exec_mark_c1: "\<Gamma>\<turnstile>\<langle>mark_guards f c1,Normal s'\<rangle> =n\<Rightarrow> Abrupt w"
assume exec_mark_c2: "\<Gamma>\<turnstile>\<langle>mark_guards f c2,Normal w\<rangle> =n\<Rightarrow> t"
from exec_mark_c1 Catch.hyps
obtain w' where
exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> w'" and
w'_Fault_f: "w' = Fault f \<longrightarrow> w'=Abrupt w" and
w'_Fault: "isFault w' \<longrightarrow> isFault (Abrupt w)" and
w'_noFault: "\<not> isFault w' \<longrightarrow> w'=Abrupt w"
by fastforce
show ?thesis
proof (cases "w'")
case (Fault f')
with Normal exec_c1 have "\<Gamma>\<turnstile>\<langle>Catch c1 c2,s\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
with w'_Fault Fault show ?thesis
by auto
next
case Stuck
with w'_noFault have False
by simp
thus ?thesis ..
next
case (Normal w'')
with w'_noFault have False by simp thus ?thesis ..
next
case (Abrupt w'')
with w'_noFault have w'': "w''=w" by simp
from exec_mark_c2 Catch.hyps
obtain t' where
"\<Gamma>\<turnstile>\<langle>c2,Normal w\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"t' = Fault f \<longrightarrow> t'=t"
"isFault t' \<longrightarrow> isFault t"
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with w'' Abrupt s exec_c1
show ?thesis
by (blast intro: execn.intros)
qed
next
assume t: "\<not> isAbr t"
assume "\<Gamma>\<turnstile>\<langle>mark_guards f c1,Normal s'\<rangle> =n\<Rightarrow> t"
with Catch.hyps
obtain t' where
exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> t'" and
t_Fault: "isFault t \<longrightarrow> isFault t'" and
t'_Fault_f: "t' = Fault f \<longrightarrow> t'=t" and
t'_Fault: "isFault t' \<longrightarrow> isFault t" and
t'_noFault: "\<not> isFault t' \<longrightarrow> t'=t"
by blast
show ?thesis
proof (cases "isFault t'")
case True
then obtain f' where t': "t'=Fault f'"..
with exec_c1 have "\<Gamma>\<turnstile>\<langle>Catch c1 c2,Normal s'\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
with t'_Fault_f t'_Fault t' s show ?thesis
by auto
next
case False
with t'_noFault have "t'=t" by simp
with t exec_c1 s show ?thesis
by (blast intro: execn.intros)
qed
qed
qed
qed
lemma exec_to_exec_mark_guards:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes t_not_Fault: "\<not> isFault t"
shows "\<Gamma>\<turnstile>\<langle>mark_guards f c,s\<rangle> \<Rightarrow> t "
proof -
from exec_to_execn [OF exec_c] obtain n where
"\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t" ..
from execn_to_execn_mark_guards [OF this t_not_Fault]
show ?thesis
by (blast intro: execn_to_exec)
qed
lemma exec_to_exec_mark_guards_Fault:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Fault f"
shows "\<exists>f'. \<Gamma>\<turnstile>\<langle>mark_guards x c,s\<rangle> \<Rightarrow> Fault f'"
proof -
from exec_to_execn [OF exec_c] obtain n where
"\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Fault f" ..
from execn_to_execn_mark_guards_Fault [OF this]
show ?thesis
by (blast intro: execn_to_exec)
qed
lemma exec_mark_guards_to_exec:
assumes exec_mark: "\<Gamma>\<turnstile>\<langle>mark_guards f c,s\<rangle> \<Rightarrow> t"
shows "\<exists>t'. \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t' \<and>
(isFault t \<longrightarrow> isFault t') \<and>
(t' = Fault f \<longrightarrow> t'=t) \<and>
(isFault t' \<longrightarrow> isFault t) \<and>
(\<not> isFault t' \<longrightarrow> t'=t)"
proof -
from exec_to_execn [OF exec_mark] obtain n where
"\<Gamma>\<turnstile>\<langle>mark_guards f c,s\<rangle> =n\<Rightarrow> t" ..
from execn_mark_guards_to_execn [OF this]
show ?thesis
by (blast intro: execn_to_exec)
qed
(* ************************************************************************* *)
subsection \<open>Lemmas about @{const "strip_guards"}\<close>
(* ************************************************************************* *)
lemma execn_to_execn_strip_guards:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes t_not_Fault: "\<not> isFault t"
shows "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> =n\<Rightarrow> t "
using exec_c t_not_Fault [simplified not_isFault_iff]
by (induct) (auto intro: execn.intros dest: noFaultn_startD')
lemma execn_to_execn_strip_guards_Fault:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
shows "\<And>f. \<lbrakk>t=Fault f; f \<notin> F\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> =n\<Rightarrow> Fault f"
using exec_c
proof (induct)
case Skip thus ?case by auto
next
case Guard thus ?case by (fastforce intro: execn.intros)
next
case GuardFault thus ?case by (fastforce intro: execn.intros)
next
case FaultProp thus ?case by auto
next
case Basic thus ?case by auto
next
case Spec thus ?case by auto
next
case SpecStuck thus ?case by auto
next
case (Seq c1 s n w c2 t)
have exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> w" by fact
have exec_c2: "\<Gamma>\<turnstile>\<langle>c2,w\<rangle> =n\<Rightarrow> t" by fact
have t: "t=Fault f" by fact
have notinF: "f \<notin> F" by fact
show ?case
proof (cases w)
case (Fault f')
with exec_c2 t have "f'=f"
by (auto dest: execn_Fault_end)
with Fault notinF Seq.hyps
have "\<Gamma>\<turnstile>\<langle>strip_guards F c1,Normal s\<rangle> =n\<Rightarrow> Fault f"
by auto
moreover have "\<Gamma>\<turnstile>\<langle>strip_guards F c2,Fault f\<rangle> =n\<Rightarrow> Fault f"
by auto
ultimately show ?thesis
by (auto intro: execn.intros)
next
case (Normal s')
with execn_to_execn_strip_guards [OF exec_c1]
have exec_strip_c1: "\<Gamma>\<turnstile>\<langle>strip_guards F c1,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with Seq.hyps t notinF
have "\<Gamma>\<turnstile>\<langle>strip_guards F c2,w\<rangle> =n\<Rightarrow> Fault f"
by blast
with exec_strip_c1 show ?thesis
by (auto intro: execn.intros)
next
case (Abrupt s')
with execn_to_execn_strip_guards [OF exec_c1]
have exec_strip_c1: "\<Gamma>\<turnstile>\<langle>strip_guards F c1,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with Seq.hyps t notinF
have "\<Gamma>\<turnstile>\<langle>strip_guards F c2,w\<rangle> =n\<Rightarrow> Fault f"
by (auto intro: execn.intros)
with exec_strip_c1 show ?thesis
by (auto intro: execn.intros)
next
case Stuck
with exec_c2 have "t=Stuck"
by (auto dest: execn_Stuck_end)
with t show ?thesis by simp
qed
next
case CondTrue thus ?case by (fastforce intro: execn.intros)
next
case CondFalse thus ?case by (fastforce intro: execn.intros)
next
case (WhileTrue s b c n w t)
have exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> w" by fact
have exec_w: "\<Gamma>\<turnstile>\<langle>While b c,w\<rangle> =n\<Rightarrow> t" by fact
have t: "t = Fault f" by fact
have notinF: "f \<notin> F" by fact
have s_in_b: "s \<in> b" by fact
show ?case
proof (cases w)
case (Fault f')
with exec_w t have "f'=f"
by (auto dest: execn_Fault_end)
with Fault notinF WhileTrue.hyps
have "\<Gamma>\<turnstile>\<langle>strip_guards F c,Normal s\<rangle> =n\<Rightarrow> Fault f"
by auto
moreover have "\<Gamma>\<turnstile>\<langle>strip_guards F (While b c),Fault f\<rangle> =n\<Rightarrow> Fault f"
by auto
ultimately show ?thesis
using s_in_b by (auto intro: execn.intros)
next
case (Normal s')
with execn_to_execn_strip_guards [OF exec_c]
have exec_strip_c: "\<Gamma>\<turnstile>\<langle>strip_guards F c,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with WhileTrue.hyps t notinF
have "\<Gamma>\<turnstile>\<langle>strip_guards F (While b c),w\<rangle> =n\<Rightarrow> Fault f"
by blast
with exec_strip_c s_in_b show ?thesis
by (auto intro: execn.intros)
next
case (Abrupt s')
with execn_to_execn_strip_guards [OF exec_c]
have exec_strip_c: "\<Gamma>\<turnstile>\<langle>strip_guards F c,Normal s\<rangle> =n\<Rightarrow> w"
by simp
with WhileTrue.hyps t notinF
have "\<Gamma>\<turnstile>\<langle>strip_guards F (While b c),w\<rangle> =n\<Rightarrow> Fault f"
by (auto intro: execn.intros)
with exec_strip_c s_in_b show ?thesis
by (auto intro: execn.intros)
next
case Stuck
with exec_w have "t=Stuck"
by (auto dest: execn_Stuck_end)
with t show ?thesis by simp
qed
next
case WhileFalse thus ?case by (fastforce intro: execn.intros)
next
case Call thus ?case by (fastforce intro: execn.intros)
next
case CallUndefined thus ?case by simp
next
case StuckProp thus ?case by simp
next
case DynCom thus ?case by (fastforce intro: execn.intros)
next
case Throw thus ?case by simp
next
case AbruptProp thus ?case by simp
next
case (CatchMatch c1 s n w c2 t)
have exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> Abrupt w" by fact
have exec_c2: "\<Gamma>\<turnstile>\<langle>c2,Normal w\<rangle> =n\<Rightarrow> t" by fact
have t: "t = Fault f" by fact
have notinF: "f \<notin> F" by fact
from execn_to_execn_strip_guards [OF exec_c1]
have exec_strip_c1: "\<Gamma>\<turnstile>\<langle>strip_guards F c1,Normal s\<rangle> =n\<Rightarrow> Abrupt w"
by simp
with CatchMatch.hyps t notinF
have "\<Gamma>\<turnstile>\<langle>strip_guards F c2,Normal w\<rangle> =n\<Rightarrow> Fault f"
by blast
with exec_strip_c1 show ?case
by (auto intro: execn.intros)
next
case CatchMiss thus ?case by (fastforce intro: execn.intros)
qed
lemma execn_to_execn_strip_guards':
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes t_not_Fault: "t \<notin> Fault ` F"
shows "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> =n\<Rightarrow> t"
proof (cases t)
case (Fault f)
with t_not_Fault exec_c show ?thesis
by (auto intro: execn_to_execn_strip_guards_Fault)
qed (insert exec_c, auto intro: execn_to_execn_strip_guards)
lemma execn_strip_guards_to_execn:
"\<And>s n t. \<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> =n\<Rightarrow> t
\<Longrightarrow> \<exists>t'. \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t' \<and>
(isFault t \<longrightarrow> isFault t') \<and>
(t' \<in> Fault ` (- F) \<longrightarrow> t'=t) \<and>
(\<not> isFault t' \<longrightarrow> t'=t)"
proof (induct c)
case Skip thus ?case by auto
next
case Basic thus ?case by auto
next
case Spec thus ?case by auto
next
case (Seq c1 c2 s n t)
have exec_strip: "\<Gamma>\<turnstile>\<langle>strip_guards F (Seq c1 c2),s\<rangle> =n\<Rightarrow> t" by fact
then obtain w where
exec_strip_c1: "\<Gamma>\<turnstile>\<langle>strip_guards F c1,s\<rangle> =n\<Rightarrow> w" and
exec_strip_c2: "\<Gamma>\<turnstile>\<langle>strip_guards F c2,w\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_elim_cases)
from Seq.hyps exec_strip_c1
obtain w' where
exec_c1: "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> =n\<Rightarrow> w'" and
w_Fault: "isFault w \<longrightarrow> isFault w'" and
w'_Fault: "w' \<in> Fault ` (- F) \<longrightarrow> w'=w" and
w'_noFault: "\<not> isFault w' \<longrightarrow> w'=w"
by blast
show ?case
proof (cases "s")
case (Fault f)
with exec_strip have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_strip have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_strip have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
show ?thesis
proof (cases "isFault w")
case True
then obtain f where w': "w=Fault f"..
moreover with exec_strip_c2
have t: "t=Fault f"
by (auto dest: execn_Fault_end)
ultimately show ?thesis
using Normal w_Fault w'_Fault exec_c1
by (fastforce intro: execn.intros elim: isFaultE)
next
case False
note noFault_w = this
show ?thesis
proof (cases "isFault w'")
case True
then obtain f' where w': "w'=Fault f'"..
with Normal exec_c1
have exec: "\<Gamma>\<turnstile>\<langle>Seq c1 c2,s\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
from w'_Fault w' noFault_w
have "f' \<in> F"
by (cases w) auto
with exec
show ?thesis
by auto
next
case False
with w'_noFault have w': "w'=w" by simp
from Seq.hyps exec_strip_c2
obtain t' where
"\<Gamma>\<turnstile>\<langle>c2,w\<rangle> =n\<Rightarrow> t'" and
"isFault t \<longrightarrow> isFault t'" and
"t' \<in> Fault ` (-F) \<longrightarrow> t'=t" and
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with Normal exec_c1 w'
show ?thesis
by (fastforce intro: execn.intros)
qed
qed
qed
next
next
case (Cond b c1 c2 s n t)
have exec_strip: "\<Gamma>\<turnstile>\<langle>strip_guards F (Cond b c1 c2),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases s)
case (Fault f)
with exec_strip have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_strip have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_strip have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
show ?thesis
proof (cases "s'\<in> b")
case True
with Normal exec_strip
have "\<Gamma>\<turnstile>\<langle>strip_guards F c1 ,Normal s'\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
with Normal True Cond.hyps obtain t'
where "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"t' \<in> Fault ` (-F) \<longrightarrow> t'=t"
"\<not> isFault t' \<longrightarrow> t' = t"
by blast
with Normal True
show ?thesis
by (blast intro: execn.intros)
next
case False
with Normal exec_strip
have "\<Gamma>\<turnstile>\<langle>strip_guards F c2 ,Normal s'\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
with Normal False Cond.hyps obtain t'
where "\<Gamma>\<turnstile>\<langle>c2,Normal s'\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"t' \<in> Fault ` (-F) \<longrightarrow> t'=t"
"\<not> isFault t' \<longrightarrow> t' = t"
by blast
with Normal False
show ?thesis
by (blast intro: execn.intros)
qed
qed
next
case (While b c s n t)
have exec_strip: "\<Gamma>\<turnstile>\<langle>strip_guards F (While b c),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases s)
case (Fault f)
with exec_strip have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_strip have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_strip have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
{
fix c' r w
assume exec_c': "\<Gamma>\<turnstile>\<langle>c',r\<rangle> =n\<Rightarrow> w"
assume c': "c'=While b (strip_guards F c)"
have "\<exists>w'. \<Gamma>\<turnstile>\<langle>While b c,r\<rangle> =n\<Rightarrow> w' \<and> (isFault w \<longrightarrow> isFault w') \<and>
(w' \<in> Fault ` (-F) \<longrightarrow> w'=w) \<and>
(\<not> isFault w' \<longrightarrow> w'=w)"
using exec_c' c'
proof (induct)
case (WhileTrue r b' c'' n u w)
have eqs: "While b' c'' = While b (strip_guards F c)" by fact
from WhileTrue.hyps eqs
have r_in_b: "r\<in>b" by simp
from WhileTrue.hyps eqs
have exec_strip_c: "\<Gamma>\<turnstile>\<langle>strip_guards F c,Normal r\<rangle> =n\<Rightarrow> u" by simp
from WhileTrue.hyps eqs
have exec_strip_w: "\<Gamma>\<turnstile>\<langle>While b (strip_guards F c),u\<rangle> =n\<Rightarrow> w"
by simp
show ?case
proof -
from WhileTrue.hyps eqs have "\<Gamma>\<turnstile>\<langle>strip_guards F c,Normal r\<rangle> =n\<Rightarrow> u"
by simp
with While.hyps
obtain u' where
exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal r\<rangle> =n\<Rightarrow> u'" and
u_Fault: "isFault u \<longrightarrow> isFault u'" and
u'_Fault: "u' \<in> Fault ` (-F) \<longrightarrow> u'=u" and
u'_noFault: "\<not> isFault u' \<longrightarrow> u'=u"
by blast
show ?thesis
proof (cases "isFault u'")
case False
with u'_noFault have u': "u'=u" by simp
from WhileTrue.hyps eqs obtain w' where
"\<Gamma>\<turnstile>\<langle>While b c,u\<rangle> =n\<Rightarrow> w'"
"isFault w \<longrightarrow> isFault w'"
"w' \<in> Fault ` (-F) \<longrightarrow> w'=w"
"\<not> isFault w' \<longrightarrow> w' = w"
by blast
with u' exec_c r_in_b
show ?thesis
by (blast intro: execn.WhileTrue)
next
case True
then obtain f' where u': "u'=Fault f'"..
with exec_c r_in_b
have exec: "\<Gamma>\<turnstile>\<langle>While b c,Normal r\<rangle> =n\<Rightarrow> Fault f'"
by (blast intro: execn.intros)
show ?thesis
proof (cases "isFault u")
case True
then obtain f where u: "u=Fault f"..
with exec_strip_w have "w=Fault f"
by (auto dest: execn_Fault_end)
with exec u' u u'_Fault
show ?thesis
by auto
next
case False
with u'_Fault u' have "f' \<in> F"
by (cases u) auto
with exec show ?thesis
by auto
qed
qed
qed
next
case (WhileFalse r b' c'' n)
have eqs: "While b' c'' = While b (strip_guards F c)" by fact
from WhileFalse.hyps eqs
have r_not_in_b: "r\<notin>b" by simp
show ?case
proof -
from r_not_in_b
have "\<Gamma>\<turnstile>\<langle>While b c,Normal r\<rangle> =n\<Rightarrow> Normal r"
by (rule execn.WhileFalse)
thus ?thesis
by blast
qed
qed auto
} note hyp_while = this
show ?thesis
proof (cases "s'\<in>b")
case False
with Normal exec_strip
have "t=s"
by (auto elim: execn_Normal_elim_cases)
with Normal False show ?thesis
by (auto intro: execn.intros)
next
case True note s'_in_b = this
with Normal exec_strip obtain r where
exec_strip_c: "\<Gamma>\<turnstile>\<langle>strip_guards F c,Normal s'\<rangle> =n\<Rightarrow> r" and
exec_strip_w: "\<Gamma>\<turnstile>\<langle>While b (strip_guards F c),r\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
from While.hyps exec_strip_c obtain r' where
exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal s'\<rangle> =n\<Rightarrow> r'" and
r_Fault: "isFault r \<longrightarrow> isFault r'" and
r'_Fault: "r' \<in> Fault ` (-F) \<longrightarrow> r'=r" and
r'_noFault: "\<not> isFault r' \<longrightarrow> r'=r"
by blast
show ?thesis
proof (cases "isFault r'")
case False
with r'_noFault have r': "r'=r" by simp
from hyp_while exec_strip_w
obtain t' where
"\<Gamma>\<turnstile>\<langle>While b c,r\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"t' \<in> Fault ` (-F) \<longrightarrow> t'=t"
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with r' exec_c Normal s'_in_b
show ?thesis
by (blast intro: execn.intros)
next
case True
then obtain f' where r': "r'=Fault f'"..
hence "\<Gamma>\<turnstile>\<langle>While b c,r'\<rangle> =n\<Rightarrow> Fault f'"
by auto
with Normal s'_in_b exec_c
have exec: "\<Gamma>\<turnstile>\<langle>While b c,Normal s'\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
show ?thesis
proof (cases "isFault r")
case True
then obtain f where r: "r=Fault f"..
with exec_strip_w have "t=Fault f"
by (auto dest: execn_Fault_end)
with Normal exec r' r r'_Fault
show ?thesis
by auto
next
case False
with r'_Fault r' have "f' \<in> F"
by (cases r) auto
with Normal exec show ?thesis
by auto
qed
qed
qed
qed
next
case Call thus ?case by auto
next
case DynCom thus ?case
by (fastforce elim!: execn_elim_cases intro: execn.intros)
next
case (Guard f g c s n t)
have exec_strip: "\<Gamma>\<turnstile>\<langle>strip_guards F (Guard f g c),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases s)
case (Fault f)
with exec_strip have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_strip have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_strip have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s')
show ?thesis
proof (cases "f\<in>F")
case True
with exec_strip Normal
have exec_strip_c: "\<Gamma>\<turnstile>\<langle>strip_guards F c,Normal s'\<rangle> =n\<Rightarrow> t"
by simp
with Guard.hyps obtain t' where
"\<Gamma>\<turnstile>\<langle>c,Normal s'\<rangle> =n\<Rightarrow> t'" and
"isFault t \<longrightarrow> isFault t'" and
"t' \<in> Fault ` (-F) \<longrightarrow> t'=t" and
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with Normal True
show ?thesis
by (cases "s'\<in> g") (fastforce intro: execn.intros)+
next
case False
note f_notin_F = this
show ?thesis
proof (cases "s'\<in>g")
case False
with Normal exec_strip f_notin_F have t: "t=Fault f"
by (auto elim: execn_Normal_elim_cases)
from False
have "\<Gamma>\<turnstile>\<langle>Guard f g c,Normal s'\<rangle> =n\<Rightarrow> Fault f"
by (blast intro: execn.intros)
with False Normal t show ?thesis
by auto
next
case True
with exec_strip Normal f_notin_F
have "\<Gamma>\<turnstile>\<langle>strip_guards F c,Normal s'\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
with Guard.hyps obtain t' where
"\<Gamma>\<turnstile>\<langle>c,Normal s'\<rangle> =n\<Rightarrow> t'" and
"isFault t \<longrightarrow> isFault t'" and
"t' \<in> Fault ` (-F) \<longrightarrow> t'=t" and
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with Normal True
show ?thesis
by (blast intro: execn.intros)
qed
qed
qed
next
case Throw thus ?case by auto
next
case (Catch c1 c2 s n t)
have exec_strip: "\<Gamma>\<turnstile>\<langle>strip_guards F (Catch c1 c2),s\<rangle> =n\<Rightarrow> t" by fact
show ?case
proof (cases "s")
case (Fault f)
with exec_strip have "t=Fault f"
by (auto dest: execn_Fault_end)
with Fault show ?thesis
by auto
next
case Stuck
with exec_strip have "t=Stuck"
by (auto dest: execn_Stuck_end)
with Stuck show ?thesis
by auto
next
case (Abrupt s')
with exec_strip have "t=Abrupt s'"
by (auto dest: execn_Abrupt_end)
with Abrupt show ?thesis
by auto
next
case (Normal s') note s=this
with exec_strip have
"\<Gamma>\<turnstile>\<langle>Catch (strip_guards F c1) (strip_guards F c2),Normal s'\<rangle> =n\<Rightarrow> t" by simp
thus ?thesis
proof (cases)
fix w
assume exec_strip_c1: "\<Gamma>\<turnstile>\<langle>strip_guards F c1,Normal s'\<rangle> =n\<Rightarrow> Abrupt w"
assume exec_strip_c2: "\<Gamma>\<turnstile>\<langle>strip_guards F c2,Normal w\<rangle> =n\<Rightarrow> t"
from exec_strip_c1 Catch.hyps
obtain w' where
exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> w'" and
w'_Fault: "w' \<in> Fault ` (-F) \<longrightarrow> w'=Abrupt w" and
w'_noFault: "\<not> isFault w' \<longrightarrow> w'=Abrupt w"
by blast
show ?thesis
proof (cases "w'")
case (Fault f')
with Normal exec_c1 have "\<Gamma>\<turnstile>\<langle>Catch c1 c2,s\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
with w'_Fault Fault show ?thesis
by auto
next
case Stuck
with w'_noFault have False
by simp
thus ?thesis ..
next
case (Normal w'')
with w'_noFault have False by simp thus ?thesis ..
next
case (Abrupt w'')
with w'_noFault have w'': "w''=w" by simp
from exec_strip_c2 Catch.hyps
obtain t' where
"\<Gamma>\<turnstile>\<langle>c2,Normal w\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'"
"t' \<in> Fault ` (-F) \<longrightarrow> t'=t"
"\<not> isFault t' \<longrightarrow> t'=t"
by blast
with w'' Abrupt s exec_c1
show ?thesis
by (blast intro: execn.intros)
qed
next
assume t: "\<not> isAbr t"
assume "\<Gamma>\<turnstile>\<langle>strip_guards F c1,Normal s'\<rangle> =n\<Rightarrow> t"
with Catch.hyps
obtain t' where
exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s'\<rangle> =n\<Rightarrow> t'" and
t_Fault: "isFault t \<longrightarrow> isFault t'" and
t'_Fault: "t' \<in> Fault ` (-F) \<longrightarrow> t'=t" and
t'_noFault: "\<not> isFault t' \<longrightarrow> t'=t"
by blast
show ?thesis
proof (cases "isFault t'")
case True
then obtain f' where t': "t'=Fault f'"..
with exec_c1 have "\<Gamma>\<turnstile>\<langle>Catch c1 c2,Normal s'\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
with t'_Fault t' s show ?thesis
by auto
next
case False
with t'_noFault have "t'=t" by simp
with t exec_c1 s show ?thesis
by (blast intro: execn.intros)
qed
qed
qed
qed
lemma execn_strip_to_execn:
assumes exec_strip: "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
shows "\<exists>t'. \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t' \<and>
(isFault t \<longrightarrow> isFault t') \<and>
(t' \<in> Fault ` (- F) \<longrightarrow> t'=t) \<and>
(\<not> isFault t' \<longrightarrow> t'=t)"
using exec_strip
proof (induct)
case Skip thus ?case by (blast intro: execn.intros)
next
case Guard thus ?case by (blast intro: execn.intros)
next
case GuardFault thus ?case by (blast intro: execn.intros)
next
case FaultProp thus ?case by (blast intro: execn.intros)
next
case Basic thus ?case by (blast intro: execn.intros)
next
case Spec thus ?case by (blast intro: execn.intros)
next
case SpecStuck thus ?case by (blast intro: execn.intros)
next
case Seq thus ?case by (blast intro: execn.intros elim: isFaultE)
next
case CondTrue thus ?case by (blast intro: execn.intros)
next
case CondFalse thus ?case by (blast intro: execn.intros)
next
case WhileTrue thus ?case by (blast intro: execn.intros elim: isFaultE)
next
case WhileFalse thus ?case by (blast intro: execn.intros)
next
case Call thus ?case
by simp (blast intro: execn.intros dest: execn_strip_guards_to_execn)
next
case CallUndefined thus ?case
by simp (blast intro: execn.intros)
next
case StuckProp thus ?case
by blast
next
case DynCom thus ?case by (blast intro: execn.intros)
next
case Throw thus ?case by (blast intro: execn.intros)
next
case AbruptProp thus ?case by (blast intro: execn.intros)
next
case (CatchMatch c1 s n r c2 t)
then obtain r' t' where
exec_c1: "\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> r'" and
r'_Fault: "r' \<in> Fault ` (-F) \<longrightarrow> r' = Abrupt r" and
r'_noFault: "\<not> isFault r' \<longrightarrow> r' = Abrupt r" and
exec_c2: "\<Gamma>\<turnstile>\<langle>c2,Normal r\<rangle> =n\<Rightarrow> t'" and
t_Fault: "isFault t \<longrightarrow> isFault t'" and
t'_Fault: "t' \<in> Fault ` (-F) \<longrightarrow> t' = t" and
t'_noFault: "\<not> isFault t' \<longrightarrow> t' = t"
by blast
show ?case
proof (cases "isFault r'")
case True
then obtain f' where r': "r'=Fault f'"..
with exec_c1 have "\<Gamma>\<turnstile>\<langle>Catch c1 c2,Normal s\<rangle> =n\<Rightarrow> Fault f'"
by (auto intro: execn.intros)
with r' r'_Fault show ?thesis
by (auto intro: execn.intros)
next
case False
with r'_noFault have "r'=Abrupt r" by simp
with exec_c1 exec_c2 t_Fault t'_noFault t'_Fault
show ?thesis
by (blast intro: execn.intros)
qed
next
case CatchMiss thus ?case by (fastforce intro: execn.intros elim: isFaultE)
qed
lemma exec_strip_guards_to_exec:
assumes exec_strip: "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> \<Rightarrow> t"
shows "\<exists>t'. \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t' \<and>
(isFault t \<longrightarrow> isFault t') \<and>
(t' \<in> Fault ` (-F) \<longrightarrow> t'=t) \<and>
(\<not> isFault t' \<longrightarrow> t'=t)"
proof -
from exec_strip obtain n where
execn_strip: "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> =n\<Rightarrow> t"
by (auto simp add: exec_iff_execn)
then obtain t' where
"\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'" "t' \<in> Fault ` (-F) \<longrightarrow> t'=t" "\<not> isFault t' \<longrightarrow> t'=t"
by (blast dest: execn_strip_guards_to_execn)
thus ?thesis
by (blast intro: execn_to_exec)
qed
lemma exec_strip_to_exec:
assumes exec_strip: "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
shows "\<exists>t'. \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t' \<and>
(isFault t \<longrightarrow> isFault t') \<and>
(t' \<in> Fault ` (-F) \<longrightarrow> t'=t) \<and>
(\<not> isFault t' \<longrightarrow> t'=t)"
proof -
from exec_strip obtain n where
execn_strip: "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
by (auto simp add: exec_iff_execn)
then obtain t' where
"\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t'"
"isFault t \<longrightarrow> isFault t'" "t' \<in> Fault ` (-F) \<longrightarrow> t'=t" "\<not> isFault t' \<longrightarrow> t'=t"
by (blast dest: execn_strip_to_execn)
thus ?thesis
by (blast intro: execn_to_exec)
qed
lemma exec_to_exec_strip_guards:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes t_not_Fault: "\<not> isFault t"
shows "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> \<Rightarrow> t"
proof -
from exec_c obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t"
by (auto simp add: exec_iff_execn)
from this t_not_Fault
have "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> =n\<Rightarrow> t"
by (rule execn_to_execn_strip_guards )
thus "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> \<Rightarrow> t"
by (rule execn_to_exec)
qed
lemma exec_to_exec_strip_guards':
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes t_not_Fault: "t \<notin> Fault ` F"
shows "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> \<Rightarrow> t"
proof -
from exec_c obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t"
by (auto simp add: exec_iff_execn)
from this t_not_Fault
have "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> =n\<Rightarrow> t"
by (rule execn_to_execn_strip_guards' )
thus "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> \<Rightarrow> t"
by (rule execn_to_exec)
qed
lemma execn_to_execn_strip:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes t_not_Fault: "\<not> isFault t"
shows "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
using exec_c t_not_Fault
proof (induct)
case (Call p bdy s n s')
have bdy: "\<Gamma> p = Some bdy" by fact
from Call have "strip F \<Gamma>\<turnstile>\<langle>bdy,Normal s\<rangle> =n\<Rightarrow> s'"
by blast
from execn_to_execn_strip_guards [OF this] Call
have "strip F \<Gamma>\<turnstile>\<langle>strip_guards F bdy,Normal s\<rangle> =n\<Rightarrow> s'"
by simp
moreover from bdy have "(strip F \<Gamma>) p = Some (strip_guards F bdy)"
by simp
ultimately
show ?case
by (blast intro: execn.intros)
next
case CallUndefined thus ?case by (auto intro: execn.CallUndefined)
qed (auto intro: execn.intros dest: noFaultn_startD' simp add: not_isFault_iff)
lemma execn_to_execn_strip':
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes t_not_Fault: "t \<notin> Fault ` F"
shows "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
using exec_c t_not_Fault
proof (induct)
case (Call p bdy s n s')
have bdy: "\<Gamma> p = Some bdy" by fact
from Call have "strip F \<Gamma>\<turnstile>\<langle>bdy,Normal s\<rangle> =n\<Rightarrow> s'"
by blast
from execn_to_execn_strip_guards' [OF this] Call
have "strip F \<Gamma>\<turnstile>\<langle>strip_guards F bdy,Normal s\<rangle> =n\<Rightarrow> s'"
by simp
moreover from bdy have "(strip F \<Gamma>) p = Some (strip_guards F bdy)"
by simp
ultimately
show ?case
by (blast intro: execn.intros)
next
case CallUndefined thus ?case by (auto intro: execn.CallUndefined)
next
case (Seq c1 s n s' c2 t)
show ?case
proof (cases "isFault s'")
case False
with Seq show ?thesis
by (auto intro: execn.intros simp add: not_isFault_iff)
next
case True
then obtain f' where s': "s'=Fault f'" by (auto simp add: isFault_def)
with Seq obtain "t=Fault f'" and "f' \<notin> F"
by (force dest: execn_Fault_end)
with Seq s' show ?thesis
by (auto intro: execn.intros)
qed
next
case (WhileTrue b c s n s' t)
show ?case
proof (cases "isFault s'")
case False
with WhileTrue show ?thesis
by (auto intro: execn.intros simp add: not_isFault_iff)
next
case True
then obtain f' where s': "s'=Fault f'" by (auto simp add: isFault_def)
with WhileTrue obtain "t=Fault f'" and "f' \<notin> F"
by (force dest: execn_Fault_end)
with WhileTrue s' show ?thesis
by (auto intro: execn.intros)
qed
qed (auto intro: execn.intros)
lemma exec_to_exec_strip:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes t_not_Fault: "\<not> isFault t"
shows "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
proof -
from exec_c obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t"
by (auto simp add: exec_iff_execn)
from this t_not_Fault
have "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
by (rule execn_to_execn_strip)
thus "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
by (rule execn_to_exec)
qed
lemma exec_to_exec_strip':
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes t_not_Fault: "t \<notin> Fault ` F"
shows "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
proof -
from exec_c obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>t"
by (auto simp add: exec_iff_execn)
from this t_not_Fault
have "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
by (rule execn_to_execn_strip' )
thus "strip F \<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
by (rule execn_to_exec)
qed
lemma exec_to_exec_strip_guards_Fault:
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Fault f"
assumes f_notin_F: "f \<notin> F"
shows"\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> \<Rightarrow> Fault f"
proof -
from exec_c obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow>Fault f"
by (auto simp add: exec_iff_execn)
from execn_to_execn_strip_guards_Fault [OF this _ f_notin_F]
have "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> =n\<Rightarrow> Fault f"
by simp
thus "\<Gamma>\<turnstile>\<langle>strip_guards F c,s\<rangle> \<Rightarrow> Fault f"
by (rule execn_to_exec)
qed
(* ************************************************************************* *)
subsection \<open>Lemmas about @{term "c\<^sub>1 \<inter>\<^sub>g c\<^sub>2"}\<close>
(* ************************************************************************* *)
lemma inter_guards_execn_Normal_noFault:
"\<And>c c2 s t n. \<lbrakk>(c1 \<inter>\<^sub>g c2) = Some c; \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t; \<not> isFault t\<rbrakk>
\<Longrightarrow> \<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> t \<and> \<Gamma>\<turnstile>\<langle>c2,Normal s\<rangle> =n\<Rightarrow> t"
proof (induct c1)
case Skip
have "(Skip \<inter>\<^sub>g c2) = Some c" by fact
then obtain c2: "c2=Skip" and c: "c=Skip"
by (simp add: inter_guards_Skip)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t" by fact
with c have "t=Normal s"
by (auto elim: execn_Normal_elim_cases)
with Skip c2
show ?case
by (auto intro: execn.intros)
next
case (Basic f)
have "(Basic f \<inter>\<^sub>g c2) = Some c" by fact
then obtain c2: "c2=Basic f" and c: "c=Basic f"
by (simp add: inter_guards_Basic)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t" by fact
with c have "t=Normal (f s)"
by (auto elim: execn_Normal_elim_cases)
with Basic c2
show ?case
by (auto intro: execn.intros)
next
case (Spec r)
have "(Spec r \<inter>\<^sub>g c2) = Some c" by fact
then obtain c2: "c2=Spec r" and c: "c=Spec r"
by (simp add: inter_guards_Spec)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t" by fact
with c have "\<Gamma>\<turnstile>\<langle>Spec r,Normal s\<rangle> =n\<Rightarrow> t" by simp
from this Spec c2 show ?case
by (cases) (auto intro: execn.intros)
next
case (Seq a1 a2)
have noFault: "\<not> isFault t" by fact
have "(Seq a1 a2 \<inter>\<^sub>g c2) = Some c" by fact
then obtain b1 b2 d1 d2 where
c2: "c2=Seq b1 b2" and
d1: "(a1 \<inter>\<^sub>g b1) = Some d1" and d2: "(a2 \<inter>\<^sub>g b2) = Some d2" and
c: "c=Seq d1 d2"
by (auto simp add: inter_guards_Seq)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t" by fact
with c obtain s' where
exec_d1: "\<Gamma>\<turnstile>\<langle>d1,Normal s\<rangle> =n\<Rightarrow> s'" and
exec_d2: "\<Gamma>\<turnstile>\<langle>d2,s'\<rangle> =n\<Rightarrow> t"
by (auto elim: execn_Normal_elim_cases)
show ?case
proof (cases s')
case (Fault f')
with exec_d2 have "t=Fault f'"
by (auto intro: execn_Fault_end)
with noFault show ?thesis by simp
next
case (Normal s'')
with d1 exec_d1 Seq.hyps
obtain
"\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Normal s''" and "\<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Normal s''"
by auto
moreover
from Normal d2 exec_d2 noFault Seq.hyps
obtain "\<Gamma>\<turnstile>\<langle>a2,Normal s''\<rangle> =n\<Rightarrow> t" and "\<Gamma>\<turnstile>\<langle>b2,Normal s''\<rangle> =n\<Rightarrow> t"
by auto
ultimately
show ?thesis
using Normal c2 by (auto intro: execn.intros)
next
case (Abrupt s'')
with exec_d2 have "t=Abrupt s''"
by (auto simp add: execn_Abrupt_end)
moreover
from Abrupt d1 exec_d1 Seq.hyps
obtain "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Abrupt s''" and "\<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Abrupt s''"
by auto
moreover
obtain
"\<Gamma>\<turnstile>\<langle>a2,Abrupt s''\<rangle> =n\<Rightarrow> Abrupt s''" and "\<Gamma>\<turnstile>\<langle>b2,Abrupt s''\<rangle> =n\<Rightarrow> Abrupt s''"
by auto
ultimately
show ?thesis
using Abrupt c2 by (auto intro: execn.intros)
next
case Stuck
with exec_d2 have "t=Stuck"
by (auto simp add: execn_Stuck_end)
moreover
from Stuck d1 exec_d1 Seq.hyps
obtain "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Stuck" and "\<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Stuck"
by auto
moreover
obtain
"\<Gamma>\<turnstile>\<langle>a2,Stuck\<rangle> =n\<Rightarrow> Stuck" and "\<Gamma>\<turnstile>\<langle>b2,Stuck\<rangle> =n\<Rightarrow> Stuck"
by auto
ultimately
show ?thesis
using Stuck c2 by (auto intro: execn.intros)
qed
next
case (Cond b t1 e1)
have noFault: "\<not> isFault t" by fact
have "(Cond b t1 e1 \<inter>\<^sub>g c2) = Some c" by fact
then obtain t2 e2 t3 e3 where
c2: "c2=Cond b t2 e2" and
t3: "(t1 \<inter>\<^sub>g t2) = Some t3" and
e3: "(e1 \<inter>\<^sub>g e2) = Some e3" and
c: "c=Cond b t3 e3"
by (auto simp add: inter_guards_Cond)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t" by fact
with c have "\<Gamma>\<turnstile>\<langle>Cond b t3 e3,Normal s\<rangle> =n\<Rightarrow> t"
by simp
then show ?case
proof (cases)
assume s_in_b: "s\<in>b"
assume "\<Gamma>\<turnstile>\<langle>t3,Normal s\<rangle> =n\<Rightarrow> t"
with Cond.hyps t3 noFault
obtain "\<Gamma>\<turnstile>\<langle>t1,Normal s\<rangle> =n\<Rightarrow> t" "\<Gamma>\<turnstile>\<langle>t2,Normal s\<rangle> =n\<Rightarrow> t"
by auto
with s_in_b c2 show ?thesis
by (auto intro: execn.intros)
next
assume s_notin_b: "s\<notin>b"
assume "\<Gamma>\<turnstile>\<langle>e3,Normal s\<rangle> =n\<Rightarrow> t"
with Cond.hyps e3 noFault
obtain "\<Gamma>\<turnstile>\<langle>e1,Normal s\<rangle> =n\<Rightarrow> t" "\<Gamma>\<turnstile>\<langle>e2,Normal s\<rangle> =n\<Rightarrow> t"
by auto
with s_notin_b c2 show ?thesis
by (auto intro: execn.intros)
qed
next
case (While b bdy1)
have noFault: "\<not> isFault t" by fact
have "(While b bdy1 \<inter>\<^sub>g c2) = Some c" by fact
then obtain bdy2 bdy where
c2: "c2=While b bdy2" and
bdy: "(bdy1 \<inter>\<^sub>g bdy2) = Some bdy" and
c: "c=While b bdy"
by (auto simp add: inter_guards_While)
have exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t" by fact
{
fix s t n w w1 w2
assume exec_w: "\<Gamma>\<turnstile>\<langle>w,Normal s\<rangle> =n\<Rightarrow> t"
assume w: "w=While b bdy"
assume noFault: "\<not> isFault t"
from exec_w w noFault
have "\<Gamma>\<turnstile>\<langle>While b bdy1,Normal s\<rangle> =n\<Rightarrow> t \<and>
\<Gamma>\<turnstile>\<langle>While b bdy2,Normal s\<rangle> =n\<Rightarrow> t"
proof (induct)
prefer 10
case (WhileTrue s b' bdy' n s' s'')
have eqs: "While b' bdy' = While b bdy" by fact
from WhileTrue have s_in_b: "s \<in> b" by simp
have noFault_s'': "\<not> isFault s''" by fact
from WhileTrue
have exec_bdy: "\<Gamma>\<turnstile>\<langle>bdy,Normal s\<rangle> =n\<Rightarrow> s'" by simp
from WhileTrue
have exec_w: "\<Gamma>\<turnstile>\<langle>While b bdy,s'\<rangle> =n\<Rightarrow> s''" by simp
show ?case
proof (cases s')
case (Fault f)
with exec_w have "s''=Fault f"
by (auto intro: execn_Fault_end)
with noFault_s'' show ?thesis by simp
next
case (Normal s''')
with exec_bdy bdy While.hyps
obtain "\<Gamma>\<turnstile>\<langle>bdy1,Normal s\<rangle> =n\<Rightarrow> Normal s'''"
"\<Gamma>\<turnstile>\<langle>bdy2,Normal s\<rangle> =n\<Rightarrow> Normal s'''"
by auto
moreover
from Normal WhileTrue
obtain
"\<Gamma>\<turnstile>\<langle>While b bdy1,Normal s'''\<rangle> =n\<Rightarrow> s''"
"\<Gamma>\<turnstile>\<langle>While b bdy2,Normal s'''\<rangle> =n\<Rightarrow> s''"
by simp
ultimately show ?thesis
using s_in_b Normal
by (auto intro: execn.intros)
next
case (Abrupt s''')
with exec_bdy bdy While.hyps
obtain "\<Gamma>\<turnstile>\<langle>bdy1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'''"
"\<Gamma>\<turnstile>\<langle>bdy2,Normal s\<rangle> =n\<Rightarrow> Abrupt s'''"
by auto
moreover
from Abrupt WhileTrue
obtain
"\<Gamma>\<turnstile>\<langle>While b bdy1,Abrupt s'''\<rangle> =n\<Rightarrow> s''"
"\<Gamma>\<turnstile>\<langle>While b bdy2,Abrupt s'''\<rangle> =n\<Rightarrow> s''"
by simp
ultimately show ?thesis
using s_in_b Abrupt
by (auto intro: execn.intros)
next
case Stuck
with exec_bdy bdy While.hyps
obtain "\<Gamma>\<turnstile>\<langle>bdy1,Normal s\<rangle> =n\<Rightarrow> Stuck"
"\<Gamma>\<turnstile>\<langle>bdy2,Normal s\<rangle> =n\<Rightarrow> Stuck"
by auto
moreover
from Stuck WhileTrue
obtain
"\<Gamma>\<turnstile>\<langle>While b bdy1,Stuck\<rangle> =n\<Rightarrow> s''"
"\<Gamma>\<turnstile>\<langle>While b bdy2,Stuck\<rangle> =n\<Rightarrow> s''"
by simp
ultimately show ?thesis
using s_in_b Stuck
by (auto intro: execn.intros)
qed
next
case WhileFalse thus ?case by (auto intro: execn.intros)
qed (simp_all)
}
with this [OF exec_c c noFault] c2
show ?case
by auto
next
case Call thus ?case by (simp add: inter_guards_Call)
next
case (DynCom f1)
have noFault: "\<not> isFault t" by fact
have "(DynCom f1 \<inter>\<^sub>g c2) = Some c" by fact
then obtain f2 f where
c2: "c2=DynCom f2" and
f_defined: "\<forall>s. ((f1 s) \<inter>\<^sub>g (f2 s)) \<noteq> None" and
c: "c=DynCom (\<lambda>s. the ((f1 s) \<inter>\<^sub>g (f2 s)))"
by (auto simp add: inter_guards_DynCom)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t" by fact
with c have "\<Gamma>\<turnstile>\<langle>DynCom (\<lambda>s. the ((f1 s) \<inter>\<^sub>g (f2 s))),Normal s\<rangle> =n\<Rightarrow> t" by simp
then show ?case
proof (cases)
assume exec_f: "\<Gamma>\<turnstile>\<langle>the (f1 s \<inter>\<^sub>g f2 s),Normal s\<rangle> =n\<Rightarrow> t"
from f_defined obtain f where "(f1 s \<inter>\<^sub>g f2 s) = Some f"
by auto
with DynCom.hyps this exec_f c2 noFault
show ?thesis
using execn.DynCom by fastforce
qed
next
case Guard thus ?case
by (fastforce elim: execn_Normal_elim_cases intro: execn.intros
simp add: inter_guards_Guard)
next
case Throw thus ?case
by (fastforce elim: execn_Normal_elim_cases
simp add: inter_guards_Throw)
next
case (Catch a1 a2)
have noFault: "\<not> isFault t" by fact
have "(Catch a1 a2 \<inter>\<^sub>g c2) = Some c" by fact
then obtain b1 b2 d1 d2 where
c2: "c2=Catch b1 b2" and
d1: "(a1 \<inter>\<^sub>g b1) = Some d1" and d2: "(a2 \<inter>\<^sub>g b2) = Some d2" and
c: "c=Catch d1 d2"
by (auto simp add: inter_guards_Catch)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> t" by fact
with c have "\<Gamma>\<turnstile>\<langle>Catch d1 d2,Normal s\<rangle> =n\<Rightarrow> t" by simp
then show ?case
proof (cases)
fix s'
assume "\<Gamma>\<turnstile>\<langle>d1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'"
with d1 Catch.hyps
obtain "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'" and "\<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'"
by auto
moreover
assume "\<Gamma>\<turnstile>\<langle>d2,Normal s'\<rangle> =n\<Rightarrow> t"
with d2 Catch.hyps noFault
obtain "\<Gamma>\<turnstile>\<langle>a2,Normal s'\<rangle> =n\<Rightarrow> t" and "\<Gamma>\<turnstile>\<langle>b2,Normal s'\<rangle> =n\<Rightarrow> t"
by auto
ultimately
show ?thesis
using c2 by (auto intro: execn.intros)
next
assume "\<not> isAbr t"
moreover
assume "\<Gamma>\<turnstile>\<langle>d1,Normal s\<rangle> =n\<Rightarrow> t"
with d1 Catch.hyps noFault
obtain "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> t" and "\<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> t"
by auto
ultimately
show ?thesis
using c2 by (auto intro: execn.intros)
qed
qed
lemma inter_guards_execn_noFault:
assumes c: "(c1 \<inter>\<^sub>g c2) = Some c"
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes noFault: "\<not> isFault t"
shows "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> =n\<Rightarrow> t \<and> \<Gamma>\<turnstile>\<langle>c2,s\<rangle> =n\<Rightarrow> t"
proof (cases s)
case (Fault f)
with exec_c have "t = Fault f"
by (auto intro: execn_Fault_end)
with noFault show ?thesis
by simp
next
case (Abrupt s')
with exec_c have "t=Abrupt s'"
by (simp add: execn_Abrupt_end)
with Abrupt show ?thesis by auto
next
case Stuck
with exec_c have "t=Stuck"
by (simp add: execn_Stuck_end)
with Stuck show ?thesis by auto
next
case (Normal s')
with exec_c noFault inter_guards_execn_Normal_noFault [OF c]
show ?thesis
by blast
qed
lemma inter_guards_exec_noFault:
assumes c: "(c1 \<inter>\<^sub>g c2) = Some c"
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes noFault: "\<not> isFault t"
shows "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> \<Rightarrow> t \<and> \<Gamma>\<turnstile>\<langle>c2,s\<rangle> \<Rightarrow> t"
proof -
from exec_c obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
by (auto simp add: exec_iff_execn)
from c this noFault
have "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> =n\<Rightarrow> t \<and> \<Gamma>\<turnstile>\<langle>c2,s\<rangle> =n\<Rightarrow> t"
by (rule inter_guards_execn_noFault)
thus ?thesis
by (auto intro: execn_to_exec)
qed
lemma inter_guards_execn_Normal_Fault:
"\<And>c c2 s n. \<lbrakk>(c1 \<inter>\<^sub>g c2) = Some c; \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> Fault f\<rbrakk>
\<Longrightarrow> (\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>c2,Normal s\<rangle> =n\<Rightarrow> Fault f)"
proof (induct c1)
case Skip thus ?case by (fastforce simp add: inter_guards_Skip)
next
case (Basic f) thus ?case by (fastforce simp add: inter_guards_Basic)
next
case (Spec r) thus ?case by (fastforce simp add: inter_guards_Spec)
next
case (Seq a1 a2)
have "(Seq a1 a2 \<inter>\<^sub>g c2) = Some c" by fact
then obtain b1 b2 d1 d2 where
c2: "c2=Seq b1 b2" and
d1: "(a1 \<inter>\<^sub>g b1) = Some d1" and d2: "(a2 \<inter>\<^sub>g b2) = Some d2" and
c: "c=Seq d1 d2"
by (auto simp add: inter_guards_Seq)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> Fault f" by fact
with c obtain s' where
exec_d1: "\<Gamma>\<turnstile>\<langle>d1,Normal s\<rangle> =n\<Rightarrow> s'" and
exec_d2: "\<Gamma>\<turnstile>\<langle>d2,s'\<rangle> =n\<Rightarrow> Fault f"
by (auto elim: execn_Normal_elim_cases)
show ?case
proof (cases s')
case (Fault f')
with exec_d2 have "f'=f"
by (auto dest: execn_Fault_end)
with Fault d1 exec_d1
have "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Fault f"
by (auto dest: Seq.hyps)
thus ?thesis
proof (cases rule: disjE [consumes 1])
assume "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Fault f"
hence "\<Gamma>\<turnstile>\<langle>Seq a1 a2,Normal s\<rangle> =n\<Rightarrow> Fault f"
by (auto intro: execn.intros)
thus ?thesis
by simp
next
assume "\<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Fault f"
hence "\<Gamma>\<turnstile>\<langle>Seq b1 b2,Normal s\<rangle> =n\<Rightarrow> Fault f"
by (auto intro: execn.intros)
with c2 show ?thesis
by simp
qed
next
case Abrupt with exec_d2 show ?thesis by (auto dest: execn_Abrupt_end)
next
case Stuck with exec_d2 show ?thesis by (auto dest: execn_Stuck_end)
next
case (Normal s'')
with inter_guards_execn_noFault [OF d1 exec_d1] obtain
exec_a1: "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Normal s''" and
exec_b1: "\<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Normal s''"
by simp
moreover from d2 exec_d2 Normal
have "\<Gamma>\<turnstile>\<langle>a2,Normal s''\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>b2,Normal s''\<rangle> =n\<Rightarrow> Fault f"
by (auto dest: Seq.hyps)
ultimately show ?thesis
using c2 by (auto intro: execn.intros)
qed
next
case (Cond b t1 e1)
have "(Cond b t1 e1 \<inter>\<^sub>g c2) = Some c" by fact
then obtain t2 e2 t e where
c2: "c2=Cond b t2 e2" and
t: "(t1 \<inter>\<^sub>g t2) = Some t" and
e: "(e1 \<inter>\<^sub>g e2) = Some e" and
c: "c=Cond b t e"
by (auto simp add: inter_guards_Cond)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> Fault f" by fact
with c have "\<Gamma>\<turnstile>\<langle>Cond b t e,Normal s\<rangle> =n\<Rightarrow> Fault f" by simp
thus ?case
proof (cases)
assume "s \<in> b"
moreover assume "\<Gamma>\<turnstile>\<langle>t,Normal s\<rangle> =n\<Rightarrow> Fault f"
with t have "\<Gamma>\<turnstile>\<langle>t1,Normal s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>t2,Normal s\<rangle> =n\<Rightarrow> Fault f"
by (auto dest: Cond.hyps)
ultimately show ?thesis using c2 c by (fastforce intro: execn.intros)
next
assume "s \<notin> b"
moreover assume "\<Gamma>\<turnstile>\<langle>e,Normal s\<rangle> =n\<Rightarrow> Fault f"
with e have "\<Gamma>\<turnstile>\<langle>e1,Normal s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>e2,Normal s\<rangle> =n\<Rightarrow> Fault f"
by (auto dest: Cond.hyps)
ultimately show ?thesis using c2 c by (fastforce intro: execn.intros)
qed
next
case (While b bdy1)
have "(While b bdy1 \<inter>\<^sub>g c2) = Some c" by fact
then obtain bdy2 bdy where
c2: "c2=While b bdy2" and
bdy: "(bdy1 \<inter>\<^sub>g bdy2) = Some bdy" and
c: "c=While b bdy"
by (auto simp add: inter_guards_While)
have exec_c: "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> Fault f" by fact
{
fix s t n w w1 w2
assume exec_w: "\<Gamma>\<turnstile>\<langle>w,Normal s\<rangle> =n\<Rightarrow> t"
assume w: "w=While b bdy"
assume Fault: "t=Fault f"
from exec_w w Fault
have "\<Gamma>\<turnstile>\<langle>While b bdy1,Normal s\<rangle> =n\<Rightarrow> Fault f\<or>
\<Gamma>\<turnstile>\<langle>While b bdy2,Normal s\<rangle> =n\<Rightarrow> Fault f"
proof (induct)
case (WhileTrue s b' bdy' n s' s'')
have eqs: "While b' bdy' = While b bdy" by fact
from WhileTrue have s_in_b: "s \<in> b" by simp
have Fault_s'': "s''=Fault f" by fact
from WhileTrue
have exec_bdy: "\<Gamma>\<turnstile>\<langle>bdy,Normal s\<rangle> =n\<Rightarrow> s'" by simp
from WhileTrue
have exec_w: "\<Gamma>\<turnstile>\<langle>While b bdy,s'\<rangle> =n\<Rightarrow> s''" by simp
show ?case
proof (cases s')
case (Fault f')
with exec_w Fault_s'' have "f'=f"
by (auto dest: execn_Fault_end)
with Fault exec_bdy bdy While.hyps
have "\<Gamma>\<turnstile>\<langle>bdy1,Normal s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>bdy2,Normal s\<rangle> =n\<Rightarrow> Fault f"
by auto
with s_in_b show ?thesis
by (fastforce intro: execn.intros)
next
case (Normal s''')
with inter_guards_execn_noFault [OF bdy exec_bdy]
obtain "\<Gamma>\<turnstile>\<langle>bdy1,Normal s\<rangle> =n\<Rightarrow> Normal s'''"
"\<Gamma>\<turnstile>\<langle>bdy2,Normal s\<rangle> =n\<Rightarrow> Normal s'''"
by auto
moreover
from Normal WhileTrue
have "\<Gamma>\<turnstile>\<langle>While b bdy1,Normal s'''\<rangle> =n\<Rightarrow> Fault f \<or>
\<Gamma>\<turnstile>\<langle>While b bdy2,Normal s'''\<rangle> =n\<Rightarrow> Fault f"
by simp
ultimately show ?thesis
using s_in_b by (fastforce intro: execn.intros)
next
case (Abrupt s''')
with exec_w Fault_s'' show ?thesis by (fastforce dest: execn_Abrupt_end)
next
case Stuck
with exec_w Fault_s'' show ?thesis by (fastforce dest: execn_Stuck_end)
qed
next
case WhileFalse thus ?case by (auto intro: execn.intros)
qed (simp_all)
}
with this [OF exec_c c] c2
show ?case
by auto
next
case Call thus ?case by (fastforce simp add: inter_guards_Call)
next
case (DynCom f1)
have "(DynCom f1 \<inter>\<^sub>g c2) = Some c" by fact
then obtain f2 where
c2: "c2=DynCom f2" and
F_defined: "\<forall>s. ((f1 s) \<inter>\<^sub>g (f2 s)) \<noteq> None" and
c: "c=DynCom (\<lambda>s. the ((f1 s) \<inter>\<^sub>g (f2 s)))"
by (auto simp add: inter_guards_DynCom)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> Fault f" by fact
with c have "\<Gamma>\<turnstile>\<langle>DynCom (\<lambda>s. the ((f1 s) \<inter>\<^sub>g (f2 s))),Normal s\<rangle> =n\<Rightarrow> Fault f" by simp
then show ?case
proof (cases)
assume exec_F: "\<Gamma>\<turnstile>\<langle>the (f1 s \<inter>\<^sub>g f2 s),Normal s\<rangle> =n\<Rightarrow> Fault f"
from F_defined obtain F where "(f1 s \<inter>\<^sub>g f2 s) = Some F"
by auto
with DynCom.hyps this exec_F c2
show ?thesis
by (fastforce intro: execn.intros)
qed
next
case (Guard m g1 bdy1)
have "(Guard m g1 bdy1 \<inter>\<^sub>g c2) = Some c" by fact
then obtain g2 bdy2 bdy where
c2: "c2=Guard m g2 bdy2" and
bdy: "(bdy1 \<inter>\<^sub>g bdy2) = Some bdy" and
c: "c=Guard m (g1 \<inter> g2) bdy"
by (auto simp add: inter_guards_Guard)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> Fault f" by fact
with c have "\<Gamma>\<turnstile>\<langle>Guard m (g1 \<inter> g2) bdy,Normal s\<rangle> =n\<Rightarrow> Fault f"
by simp
thus ?case
proof (cases)
assume f_m: "Fault f = Fault m"
assume "s \<notin> g1 \<inter> g2"
hence "s\<notin>g1 \<or> s\<notin>g2"
by blast
with c2 f_m show ?thesis
by (auto intro: execn.intros)
next
assume "s \<in> g1 \<inter> g2"
moreover
assume "\<Gamma>\<turnstile>\<langle>bdy,Normal s\<rangle> =n\<Rightarrow> Fault f"
with bdy have "\<Gamma>\<turnstile>\<langle>bdy1,Normal s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>bdy2,Normal s\<rangle> =n\<Rightarrow> Fault f"
by (rule Guard.hyps)
ultimately show ?thesis
using c2
by (auto intro: execn.intros)
qed
next
case Throw thus ?case by (fastforce simp add: inter_guards_Throw)
next
case (Catch a1 a2)
have "(Catch a1 a2 \<inter>\<^sub>g c2) = Some c" by fact
then obtain b1 b2 d1 d2 where
c2: "c2=Catch b1 b2" and
d1: "(a1 \<inter>\<^sub>g b1) = Some d1" and d2: "(a2 \<inter>\<^sub>g b2) = Some d2" and
c: "c=Catch d1 d2"
by (auto simp add: inter_guards_Catch)
have "\<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> =n\<Rightarrow> Fault f" by fact
with c have "\<Gamma>\<turnstile>\<langle>Catch d1 d2,Normal s\<rangle> =n\<Rightarrow> Fault f" by simp
thus ?case
proof (cases)
fix s'
assume "\<Gamma>\<turnstile>\<langle>d1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'"
from inter_guards_execn_noFault [OF d1 this] obtain
exec_a1: "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'" and
exec_b1: "\<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Abrupt s'"
by simp
moreover assume "\<Gamma>\<turnstile>\<langle>d2,Normal s'\<rangle> =n\<Rightarrow> Fault f"
with d2
have "\<Gamma>\<turnstile>\<langle>a2,Normal s'\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>b2,Normal s'\<rangle> =n\<Rightarrow> Fault f"
by (auto dest: Catch.hyps)
ultimately show ?thesis
using c2 by (fastforce intro: execn.intros)
next
assume "\<Gamma>\<turnstile>\<langle>d1,Normal s\<rangle> =n\<Rightarrow> Fault f"
with d1 have "\<Gamma>\<turnstile>\<langle>a1,Normal s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>b1,Normal s\<rangle> =n\<Rightarrow> Fault f"
by (auto dest: Catch.hyps)
with c2 show ?thesis
by (fastforce intro: execn.intros)
qed
qed
lemma inter_guards_execn_Fault:
assumes c: "(c1 \<inter>\<^sub>g c2) = Some c"
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Fault f"
shows "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>c2,s\<rangle> =n\<Rightarrow> Fault f"
proof (cases s)
case (Fault f)
with exec_c show ?thesis
by (auto dest: execn_Fault_end)
next
case (Abrupt s')
with exec_c show ?thesis
by (fastforce dest: execn_Abrupt_end)
next
case Stuck
with exec_c show ?thesis
by (fastforce dest: execn_Stuck_end)
next
case (Normal s')
with exec_c inter_guards_execn_Normal_Fault [OF c]
show ?thesis
by blast
qed
lemma inter_guards_exec_Fault:
assumes c: "(c1 \<inter>\<^sub>g c2) = Some c"
assumes exec_c: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> Fault f"
shows "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> \<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>c2,s\<rangle> \<Rightarrow> Fault f"
proof -
from exec_c obtain n where "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> Fault f"
by (auto simp add: exec_iff_execn)
from c this
have "\<Gamma>\<turnstile>\<langle>c1,s\<rangle> =n\<Rightarrow> Fault f \<or> \<Gamma>\<turnstile>\<langle>c2,s\<rangle> =n\<Rightarrow> Fault f"
by (rule inter_guards_execn_Fault)
thus ?thesis
by (auto intro: execn_to_exec)
qed
(* ************************************************************************* *)
subsection "Restriction of Procedure Environment"
(* ************************************************************************* *)
lemma restrict_SomeD: "(m|\<^bsub>A\<^esub>) x = Some y \<Longrightarrow> m x = Some y"
by (auto simp add: restrict_map_def split: if_split_asm)
(* FIXME: To Map *)
lemma restrict_dom_same [simp]: "m|\<^bsub>dom m\<^esub> = m"
apply (rule ext)
apply (clarsimp simp add: restrict_map_def)
apply (simp only: not_None_eq [symmetric])
apply rule
apply (drule sym)
apply blast
done
lemma restrict_in_dom: "x \<in> A \<Longrightarrow> (m|\<^bsub>A\<^esub>) x = m x"
by (auto simp add: restrict_map_def)
lemma exec_restrict_to_exec:
assumes exec_restrict: "\<Gamma>|\<^bsub>A\<^esub>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes notStuck: "t\<noteq>Stuck"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
using exec_restrict notStuck
by (induct) (auto intro: exec.intros dest: restrict_SomeD Stuck_end)
lemma execn_restrict_to_execn:
assumes exec_restrict: "\<Gamma>|\<^bsub>A\<^esub>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes notStuck: "t\<noteq>Stuck"
shows "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
using exec_restrict notStuck
by (induct) (auto intro: execn.intros dest: restrict_SomeD execn_Stuck_end)
lemma restrict_NoneD: "m x = None \<Longrightarrow> (m|\<^bsub>A\<^esub>) x = None"
by (auto simp add: restrict_map_def split: if_split_asm)
lemma exec_to_exec_restrict:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
shows "\<exists>t'. \<Gamma>|\<^bsub>P\<^esub>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t' \<and> (t=Stuck \<longrightarrow> t'=Stuck) \<and>
(\<forall>f. t=Fault f\<longrightarrow> t'\<in>{Fault f,Stuck}) \<and> (t'\<noteq>Stuck \<longrightarrow> t'=t)"
proof -
from exec obtain n where
execn_strip: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
by (auto simp add: exec_iff_execn)
from execn_to_execn_restrict [where P=P,OF this]
obtain t' where
"\<Gamma>|\<^bsub>P\<^esub>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t'"
"t=Stuck \<longrightarrow> t'=Stuck" "\<forall>f. t=Fault f\<longrightarrow> t'\<in>{Fault f,Stuck}" "t'\<noteq>Stuck \<longrightarrow> t'=t"
by blast
thus ?thesis
by (blast intro: execn_to_exec)
qed
lemma notStuck_GuardD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Guard m g c,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}; s \<in> g\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.Guard )
lemma notStuck_SeqD1:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Seq c1 c2,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.Seq )
lemma notStuck_SeqD2:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Seq c1 c2,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}; \<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> \<Rightarrow>s'\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c2,s'\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.Seq )
lemma notStuck_SeqD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Seq c1 c2,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}\<rbrakk> \<Longrightarrow>
\<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck} \<and> (\<forall>s'. \<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> \<Rightarrow>s' \<longrightarrow> \<Gamma>\<turnstile>\<langle>c2,s'\<rangle> \<Rightarrow>\<notin>{Stuck})"
by (auto simp add: final_notin_def dest: exec.Seq )
lemma notStuck_CondTrueD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Cond b c1 c2,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}; s \<in> b\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.CondTrue)
lemma notStuck_CondFalseD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Cond b c1 c2,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}; s \<notin> b\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c2,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.CondFalse)
lemma notStuck_WhileTrueD1:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}; s \<in> b\<rbrakk>
\<Longrightarrow> \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.WhileTrue)
lemma notStuck_WhileTrueD2:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>While b c,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}; \<Gamma>\<turnstile>\<langle>c,Normal s\<rangle> \<Rightarrow>s'; s \<in> b\<rbrakk>
\<Longrightarrow> \<Gamma>\<turnstile>\<langle>While b c,s'\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.WhileTrue)
lemma notStuck_CallD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Call p ,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}; \<Gamma> p = Some bdy\<rbrakk>
\<Longrightarrow> \<Gamma>\<turnstile>\<langle>bdy,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.Call)
lemma notStuck_CallDefinedD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Call p,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}\<rbrakk>
\<Longrightarrow> \<Gamma> p \<noteq> None"
by (cases "\<Gamma> p")
(auto simp add: final_notin_def dest: exec.CallUndefined)
lemma notStuck_DynComD:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>DynCom c,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}\<rbrakk>
\<Longrightarrow> \<Gamma>\<turnstile>\<langle>(c s),Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.DynCom)
lemma notStuck_CatchD1:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Catch c1 c2,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}\<rbrakk> \<Longrightarrow> \<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.CatchMatch exec.CatchMiss )
lemma notStuck_CatchD2:
"\<lbrakk>\<Gamma>\<turnstile>\<langle>Catch c1 c2,Normal s\<rangle> \<Rightarrow>\<notin>{Stuck}; \<Gamma>\<turnstile>\<langle>c1,Normal s\<rangle> \<Rightarrow>Abrupt s'\<rbrakk>
\<Longrightarrow> \<Gamma>\<turnstile>\<langle>c2,Normal s'\<rangle> \<Rightarrow>\<notin>{Stuck}"
by (auto simp add: final_notin_def dest: exec.CatchMatch)
(* ************************************************************************* *)
subsection "Miscellaneous"
(* ************************************************************************* *)
lemma execn_noguards_no_Fault:
assumes execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes noguards_c: "noguards c"
assumes noguards_\<Gamma>: "\<forall>p \<in> dom \<Gamma>. noguards (the (\<Gamma> p))"
assumes s_no_Fault: "\<not> isFault s"
shows "\<not> isFault t"
using execn noguards_c s_no_Fault
proof (induct)
case (Call p bdy n s t) with noguards_\<Gamma> show ?case
apply -
apply (drule bspec [where x=p])
apply auto
done
qed (auto)
lemma exec_noguards_no_Fault:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes noguards_c: "noguards c"
assumes noguards_\<Gamma>: "\<forall>p \<in> dom \<Gamma>. noguards (the (\<Gamma> p))"
assumes s_no_Fault: "\<not> isFault s"
shows "\<not> isFault t"
using exec noguards_c s_no_Fault
proof (induct)
case (Call p bdy s t) with noguards_\<Gamma> show ?case
apply -
apply (drule bspec [where x=p])
apply auto
done
qed auto
lemma execn_nothrows_no_Abrupt:
assumes execn: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> =n\<Rightarrow> t"
assumes nothrows_c: "nothrows c"
assumes nothrows_\<Gamma>: "\<forall>p \<in> dom \<Gamma>. nothrows (the (\<Gamma> p))"
assumes s_no_Abrupt: "\<not>(isAbr s)"
shows "\<not>(isAbr t)"
using execn nothrows_c s_no_Abrupt
proof (induct)
case (Call p bdy n s t) with nothrows_\<Gamma> show ?case
apply -
apply (drule bspec [where x=p])
apply auto
done
qed (auto)
lemma exec_nothrows_no_Abrupt:
assumes exec: "\<Gamma>\<turnstile>\<langle>c,s\<rangle> \<Rightarrow> t"
assumes nothrows_c: "nothrows c"
assumes nothrows_\<Gamma>: "\<forall>p \<in> dom \<Gamma>. nothrows (the (\<Gamma> p))"
assumes s_no_Abrupt: "\<not>(isAbr s)"
shows "\<not>(isAbr t)"
using exec nothrows_c s_no_Abrupt
proof (induct)
case (Call p bdy s t) with nothrows_\<Gamma> show ?case
apply -
apply (drule bspec [where x=p])
apply auto
done
qed (auto)
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.