Skip to content

Commit

Permalink
chore: delete fin_destr code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeizer committed May 20, 2024
1 parent cefe5e6 commit 1e0f7ea
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 110 deletions.
1 change: 0 additions & 1 deletion Qpf/Examples/_02_Tree.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Qpf
import Qpf.Examples._01_List
import Qpf.Macro.Tactic.FinDestr

open MvQPF

Expand Down
91 changes: 0 additions & 91 deletions Qpf/Macro/Tactic/FinDestr.lean

This file was deleted.

1 change: 0 additions & 1 deletion Qpf/PFunctor/Multivariate/Constructions/Arrow.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Mathlib.Data.QPF.Multivariate.Basic
import Mathlib.Tactic.FinCases

import Qpf.Util
import Qpf.Macro.Tactic.FinDestr
import Qpf.PFunctor.Multivariate.Basic

namespace MvQPF
Expand Down
1 change: 0 additions & 1 deletion Qpf/PFunctor/Multivariate/Constructions/Prod.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Mathlib.Data.QPF.Multivariate.Basic
import Mathlib.Tactic.FinCases

import Qpf.Util
import Qpf.Macro.Tactic.FinDestr
import Qpf.Qpf.Multivariate.Basic

namespace MvQPF
Expand Down
1 change: 0 additions & 1 deletion Qpf/PFunctor/Multivariate/Constructions/Sum.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import Mathlib.Data.QPF.Multivariate.Basic
import Mathlib.Tactic.FinCases

import Qpf.Macro.Tactic.FinDestr
import Qpf.Util
import Qpf.Qpf.Multivariate.Basic

Expand Down
29 changes: 14 additions & 15 deletions Qpf/Qpf/Multivariate/ofPolynomial.lean
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
import Mathlib.Data.QPF.Multivariate.Basic
import Qpf.Util
import Qpf.Macro.Tactic.FinDestr

/-!
This file provides a way to show some typefunction `F` is a QPF by establishing an isomorphism
This file provides a way to show some typefunction `F` is a QPF by establishing an isomorphism
to some polynomial functor `P`
This is especially useful to show functoriality of external type functions, which are not
easily redefined in terms of `MvPFunctor`
-/

namespace MvFunctor
namespace MvFunctor
/-- If `F` is isomorphic to a MvFunctor `F'`, then `F` is also a MvFunctor -/
def ofIsomorphism {F : TypeFun n}
(F' : TypeFun n)
[q : MvFunctor F']
(box : ∀{α}, F α → F' α)
(unbox : ∀{α}, F' α → F α)
(box : ∀{α}, F α → F' α)
(unbox : ∀{α}, F' α → F α)
: MvFunctor F
where
map f a := unbox <| q.map f <| box a
end MvFunctor

namespace MvQPF
/-- If `F` is isomorphic to a QPF `F'`, then `F` is also a QPF -/
def ofIsomorphism {F : TypeFun n}
def ofIsomorphism {F : TypeFun n}
(F' : TypeFun n)
[functor' : MvFunctor F']
[functor : MvFunctor F]
[q : MvQPF F']
(box : ∀{α}, F α → F' α)
(unbox : ∀{α}, F' α → F α)
(box : ∀{α}, F α → F' α)
(unbox : ∀{α}, F' α → F α)
(box_unbox_id : ∀{α} (x : F' α), box (unbox x) = x)
(unbox_box_id : ∀{α} (x : F α), unbox (box x) = x
(unbox_box_id : ∀{α} (x : F α), unbox (box x) = x
:= by intros; rfl
)
(map_eq : ∀ (α β : TypeVec n) (f : TypeVec.Arrow α β) (a : F α), functor.map f a = (unbox <| functor'.map f <| box a) := by intros; rfl)
Expand All @@ -41,19 +40,19 @@ namespace MvQPF
P := q.P
abs := unbox ∘ q.abs
repr := q.repr ∘ box
abs_repr := by
intros
abs_repr := by
intros
simp only [q.abs_repr, unbox_box_id, Function.comp]
abs_map f x := by
abs_map f x := by
dsimp
rw [map_eq]
apply congrArg
simp [box_unbox_id, q.abs_map]

/-- If `F` is isomorphic to a polynomial functor `P'`, then `F` is a QPF -/
def ofPolynomial {F : TypeFun n}
def ofPolynomial {F : TypeFun n}
(P : MvPFunctor n)
:= @ofIsomorphism _ F P.Obj
:= @ofIsomorphism _ F P.Obj


end MvQPF

0 comments on commit 1e0f7ea

Please sign in to comment.