Skip to content

Commit

Permalink
Distlore, now actually
Browse files Browse the repository at this point in the history
  • Loading branch information
imbrem committed Sep 28, 2024
1 parent 6a2f676 commit 0e79183
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 8 additions & 6 deletions DeBruijnSSA/BinSyntax/Rewrite/Region/Compose/Distrib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ theorem Eqv.distl_seq_injective {A B C : Ty α} {Γ : Ctx α ε}
: r = s := by
rw [<-nil_seq r, <-nil_seq s, <-distl_inv_distl, seq_assoc, h, seq_assoc]

theorem Eqv.rtimes_inj_l_seq_distl_inv {A B C : Ty α} {Γ : Ctx α ε} {L : LCtx α}
theorem Eqv.rtimes_inj_l_distl_inv {A B C : Ty α} {Γ : Ctx α ε} {L : LCtx α}
: A ⋊ inj_l ;; distl_inv (φ := φ) (A := A) (B := B) (C := C) (Γ := Γ) (L := L) = inj_l := by
sorry
rw [inj_l_eq_ret, rtimes_eq_ret, distl_inv_eq_ret, <-ret_of_seq, Term.Eqv.rtimes_inj_l_distl_inv]
rfl

theorem Eqv.rtimes_inj_r_seq_distl_inv {A B C : Ty α} {Γ : Ctx α ε} {L : LCtx α}
theorem Eqv.rtimes_inj_r_distl_inv {A B C : Ty α} {Γ : Ctx α ε} {L : LCtx α}
: A ⋊ inj_r ;; distl_inv (φ := φ) (A := A) (B := B) (C := C) (Γ := Γ) (L := L) = inj_r := by
sorry
rw [inj_r_eq_ret, rtimes_eq_ret, distl_inv_eq_ret, <-ret_of_seq, Term.Eqv.rtimes_inj_r_distl_inv]
rfl

theorem Eqv.rtimes_sum_seq_distl_inv {A B C : Ty α} {Γ : Ctx α ε} {L : LCtx α}
{l : Eqv φ ((A, ⊥)::Γ) (A'::L)} {r : Eqv φ ((B, ⊥)::Γ) (B'::L)}
Expand All @@ -109,5 +111,5 @@ theorem Eqv.rtimes_sum_seq_distl_inv {A B C : Ty α} {Γ : Ctx α ε} {L : LCtx
apply distl_seq_injective
rw [<-seq_assoc, <-seq_assoc, distl_distl_inv, nil_seq, distl, coprod_seq, coprod_seq, sum]
congr 1
· rw [rtimes_rtimes, inj_l_coprod, <-rtimes_rtimes, seq_assoc, rtimes_inj_l_seq_distl_inv]
· rw [rtimes_rtimes, inj_r_coprod, <-rtimes_rtimes, seq_assoc, rtimes_inj_r_seq_distl_inv]
· rw [rtimes_rtimes, inj_l_coprod, <-rtimes_rtimes, seq_assoc, rtimes_inj_l_distl_inv]
· rw [rtimes_rtimes, inj_r_coprod, <-rtimes_rtimes, seq_assoc, rtimes_inj_r_distl_inv]
12 changes: 6 additions & 6 deletions DeBruijnSSA/BinSyntax/Rewrite/Term/Compose/Distrib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,23 @@ theorem Eqv.distl_seq_injective {A B C : Ty α} {Γ : Ctx α ε}
: r = s := by
rw [<-nil_seq r, <-nil_seq s, <-distl_inv_distl, <-seq_assoc, h, seq_assoc]

theorem Eqv.rtimes_inj_l_seq_distl_inv_pure {A B C : Ty α} {Γ : Ctx α ε}
theorem Eqv.rtimes_inj_l_distl_inv_pure {A B C : Ty α} {Γ : Ctx α ε}
: A ⋊' inj_l ;;' distl_inv (φ := φ) (A := A) (B := B) (C := C) (Γ := Γ) (e := ⊥) = inj_l := by
rw [seq_distl_inv, rtimes, tensor, let2_let2, let2_pair]
simp [nil, let1_beta_pure, inj_l, coprod, wk2, Nat.liftnWk, case_inl, <-inl_let2, let2_eta]

theorem Eqv.rtimes_inj_r_seq_distl_inv_pure {A B C : Ty α} {Γ : Ctx α ε}
theorem Eqv.rtimes_inj_r_distl_inv_pure {A B C : Ty α} {Γ : Ctx α ε}
: A ⋊' inj_r ;;' distl_inv (φ := φ) (A := A) (B := B) (C := C) (Γ := Γ) (e := ⊥) = inj_r := by
rw [seq_distl_inv, rtimes, tensor, let2_let2, let2_pair]
simp [nil, let1_beta_pure, inj_r, coprod, wk2, Nat.liftnWk, case_inr, <-inr_let2, let2_eta]

theorem Eqv.rtimes_inj_l_seq_distl_inv {A B C : Ty α} {Γ : Ctx α ε}
theorem Eqv.rtimes_inj_l_distl_inv {A B C : Ty α} {Γ : Ctx α ε}
: A ⋊' inj_l ;;' distl_inv (φ := φ) (A := A) (B := B) (C := C) (Γ := Γ) (e := e) = inj_l
:= congrArg (wk_eff (he := bot_le)) rtimes_inj_l_seq_distl_inv_pure
:= congrArg (wk_eff (he := bot_le)) rtimes_inj_l_distl_inv_pure

theorem Eqv.rtimes_inj_r_seq_distl_inv {A B C : Ty α} {Γ : Ctx α ε}
theorem Eqv.rtimes_inj_r_distl_inv {A B C : Ty α} {Γ : Ctx α ε}
: A ⋊' inj_r ;;' distl_inv (φ := φ) (A := A) (B := B) (C := C) (Γ := Γ) (e := e) = inj_r
:= congrArg (wk_eff (he := bot_le)) rtimes_inj_r_seq_distl_inv_pure
:= congrArg (wk_eff (he := bot_le)) rtimes_inj_r_distl_inv_pure

def Eqv.distr {A B C : Ty α} {Γ : Ctx α ε}
: Eqv φ (⟨(A.prod C).coprod (B.prod C), ⊥⟩::Γ) ⟨(A.coprod B).prod C, e⟩
Expand Down

0 comments on commit 0e79183

Please sign in to comment.