Skip to content

Commit

Permalink
Use functor arguments instead of subfunctor instances.
Browse files Browse the repository at this point in the history
Make the normal functor arguments of type Set -> Set of
Distinct_Sub_Functor explicit and make the Sub_Functor
instance arguments implicit instead.
  • Loading branch information
Steven Keuchel committed May 8, 2014
1 parent c6cbec4 commit ff575e3
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Arith.v
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ Section Arith.

(* Add case. *)

Context {Dis_VI_Bot : Distinct_Sub_Functor _ Sub_NatValue_V Sub_BotValue_V}.
Context {Dis_VI_Bot : Distinct_Sub_Functor NatValue BotValue V}.

(* Inversion principles for natural number SubValues. *)
Definition SV_invertVI_P (i : SubValue_i V) :=
Expand All @@ -399,7 +399,7 @@ Section Arith.
(WF_V' : WF_Functor V' V sub_V'_V),
(forall (i : SubValue_i V) (H : SV' SV_invertVI_P i),
exists v', proj1_sig (sv_a _ i) = inject v') ->
Distinct_Sub_Functor _ Sub_NatValue_V sub_V'_V ->
Distinct_Sub_Functor NatValue V' V ->
iPAlgebra SV_invertVI_Name SV_invertVI_P SV'.
Proof.
econstructor; intros.
Expand Down
4 changes: 2 additions & 2 deletions Arith_Lambda.v
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ Section Lambda_Arith.
Variable WFV : (WFValue_i D V -> Prop) -> WFValue_i D V -> Prop.
Context {funWFV : iFunctor WFV}.

Context {Dis_VI_Clos : Distinct_Sub_Functor Fun_V Sub_NatValue_V Sub_ClosValue_V}.
Context {Dis_VI_Clos : Distinct_Sub_Functor NatValue (ClosValue E) V}.
Context {WF_Sub_ClosValue_V : WF_Functor (ClosValue E) V Sub_ClosValue_V}.
Context {WF_Sub_NatValue_V : WF_Functor NatValue V Sub_NatValue_V}.

Context {Sub_WFV_VI_WFV : Sub_iFunctor (WFValue_VI D V) WFV}.
Context {Sub_WFV_Bot_WFV : Sub_iFunctor (WFValue_Bot D V) WFV}.
Context {Dis_Clos_Bot : Distinct_Sub_Functor _ Sub_LType_D Sub_AType_D}.
Context {Dis_Clos_Bot : Distinct_Sub_Functor LType AType D}.

Context {Typeof_E : forall T, FAlgebra TypeofName T (typeofR D) (E (typeofR D))}.
Context {WF_typeof_E : forall T, @WF_FAlgebra TypeofName T _ _ _
Expand Down
4 changes: 2 additions & 2 deletions Bool.v
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Section Bool.
Context {SV : (SubValue_i V -> Prop) -> SubValue_i V -> Prop}.
Context {Sub_SV_refl_SV : Sub_iFunctor (SubValue_refl V) SV}.

Context {Dis_VB_Bot : Distinct_Sub_Functor _ Sub_BoolValue_V Sub_BotValue_V}.
Context {Dis_VB_Bot : Distinct_Sub_Functor BoolValue BotValue V}.

(* Inversion principles for natural number SubValues. *)
Definition SV_invertVB_P (i : SubValue_i V) :=
Expand All @@ -381,7 +381,7 @@ Section Bool.
(WF_V' : WF_Functor V' V sub_V'_V),
(forall (i : SubValue_i V) (H : SV' SV_invertVB_P i),
exists v', proj1_sig (sv_a _ i) = inject v') ->
Distinct_Sub_Functor _ Sub_BoolValue_V sub_V'_V ->
Distinct_Sub_Functor BoolValue V' V ->
iPAlgebra SV_invertVB_Name SV_invertVB_P SV'.
Proof.
econstructor; intros.
Expand Down
4 changes: 2 additions & 2 deletions Bool_Lambda.v
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ Section PLambda_Arith.

Context {Sub_WFV_VB_WFV : Sub_iFunctor (WFValue_VB D V) WFV}.
Context {Sub_WFV_Bot_WFV : Sub_iFunctor (WFValue_Bot D V) WFV}.
Context {Dis_Clos_Bot : Distinct_Sub_Functor _ Sub_LType_D Sub_BType_D}.
Context {Dis_Clos_Bot : Distinct_Sub_Functor LType BType D}.

Context {Dis_VB_Clos : Distinct_Sub_Functor Fun_V Sub_BoolValue_V Sub_ClosValue_V}.
Context {Dis_VB_Clos : Distinct_Sub_Functor BoolValue (ClosValue E) V}.
Context {WF_Sub_ClosValue_V : WF_Functor (ClosValue E) V Sub_ClosValue_V}.
Context {WF_Sub_BoolValue_V : WF_Functor BoolValue V Sub_BoolValue_V}.

Expand Down
22 changes: 11 additions & 11 deletions Functors.v
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,10 @@ Section Folds.
reflexivity.
Qed.

Class Distinct_Sub_Functor {F G H : Set -> Set}
(Fun_H : Functor H)
(sub_F_H : F :<: H)
(sub_G_H : G :<: H)
Class Distinct_Sub_Functor (F G H : Set -> Set)
{Fun_H : Functor H}
{sub_F_H : F :<: H}
{sub_G_H : G :<: H}
: Set :=
{ inj_discriminate :
forall A f g,
Expand All @@ -512,7 +512,7 @@ Section Folds.
(sub_F_G : F :<: G)
(sub_H_I : H :<: I)
:
@Distinct_Sub_Functor F H (G :+: I) _ _ _.
Distinct_Sub_Functor F H (G :+: I).
Proof.
econstructor; intros.
unfold not; simpl; unfold id; intros.
Expand All @@ -526,7 +526,7 @@ Section Folds.
(sub_F_G : F :<: G)
(sub_H_I : H :<: I)
:
@Distinct_Sub_Functor F H (I :+: G) _ _ _.
Distinct_Sub_Functor F H (I :+: G).
Proof.
econstructor; intros.
unfold not; simpl; unfold id; intros.
Expand All @@ -539,9 +539,9 @@ Section Folds.
(Fun_I : Functor I)
(sub_F_G : F :<: G)
(sub_H_G : H :<: G)
(Dist_inl : @Distinct_Sub_Functor F H G Fun_G sub_F_G sub_H_G)
(Dist_inl : Distinct_Sub_Functor F H G)
:
@Distinct_Sub_Functor F H (G :+: I) _ _ _.
Distinct_Sub_Functor F H (G :+: I).
Proof.
econstructor; intros.
unfold not; intros.
Expand All @@ -555,9 +555,9 @@ Section Folds.
(Fun_I : Functor I)
(sub_F_G : F :<: G)
(sub_H_G : H :<: G)
(Dist_inl : @Distinct_Sub_Functor F H G Fun_G sub_F_G sub_H_G)
(Dist_inl : Distinct_Sub_Functor F H G)
:
@Distinct_Sub_Functor F H (I :+: G) _ _ _.
Distinct_Sub_Functor F H (I :+: G).
Proof.
econstructor; intros.
unfold not; intros.
Expand All @@ -573,7 +573,7 @@ Section Folds.
{sub_G_H : G :<: H}
{WF_F : WF_Functor _ _ sub_F_H}
{WF_G : WF_Functor _ _ sub_G_H},
Distinct_Sub_Functor Fun_H sub_F_H sub_G_H ->
Distinct_Sub_Functor F G H ->
forall f g, inject (subGF := sub_F_H) f <> inject (subGF := sub_G_H) g.
Proof.
unfold inject; simpl; intros.
Expand Down
2 changes: 1 addition & 1 deletion Lambda.v
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ Section Lambda.

(* App case. *)

Context {Dis_Clos_Bot : Distinct_Sub_Functor _ Sub_ClosValue_V Sub_BotValue_V}.
Context {Dis_Clos_Bot : Distinct_Sub_Functor ClosValue BotValue V}.
Context {iFun_SV : iFunctor SV}.

Global Instance SV_proj1_b_Clos :
Expand Down
2 changes: 1 addition & 1 deletion NatCase.v
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Section NatCase.
iPAlgebra SV_invertVI_Name (SV_invertVI_P V) SV}.
Context {SV_invertVI'_SV :
iPAlgebra SV_invertVI'_Name (SV_invertVI'_P V) SV}.
Context {Dis_VI_Bot : Distinct_Sub_Functor _ Sub_NatValue_V Sub_BotValue_V}.
Context {Dis_VI_Bot : Distinct_Sub_Functor NatValue BotValue V}.
Context {SV_invertBot_SV :
iPAlgebra SV_invertBot_Name (SV_invertBot_P V) SV}.

Expand Down

0 comments on commit ff575e3

Please sign in to comment.