lemma or_cases_to (φ ψ A : Tm) : Pf [φ ∨ ψ, φ ⇒ A, ψ ⇒ A] A := by
apply Pf.or_E
· have hmem : (φ ∨ ψ) ∈ [φ ∨ ψ, φ ⇒ A, ψ ⇒ A] := by simp
exact Pf.of_mem hmem
· apply Pf.imp_E
· have hmem : (φ ⇒ A) ∈ [φ, φ ∨ ψ, φ ⇒ A, ψ ⇒ A] := by simp
exact Pf.of_mem hmem
· exact Pf.assume
· apply Pf.imp_E
· have hmem : (ψ ⇒ A) ∈ [ψ, φ ∨ ψ, φ ⇒ A, ψ ⇒ A] := by simp
exact Pf.of_mem hmem
· exact Pf.assume
theorem multicut {Δ : Ctxt} {P : Tm} (h : Pf Δ P) :
∀ {Γ : Ctxt}, (∀ Q ∈ Δ, Pf Γ Q) → Pf Γ P := by⊢ ∀ {
Γ :
Ctxt}, (∀
Q ∈
Δ,
Pf Γ Q) →
Pf Γ P
induction h with
| assume =>assume⊢ ∀ {
Γ :
Ctxt}, (∀
Q ∈
P✝ :: Γ✝,
Pf Γ Q) →
Pf Γ P✝
intro Γ hΓassumehΓ : ∀ Q ∈ P✝ :: Γ✝, Pf Γ Q
exact hΓ _ (byhΓ : ∀ Q ∈ P✝ :: Γ✝, Pf Γ Q simp)
| wk hΔ hP ih =>wkih : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝ ⊢ ∀ {
Γ :
Ctxt}, (∀
Q ∈
Δ✝,
Pf Γ Q) →
Pf Γ P✝
intro Γ hΓwkih : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝
apply ihwk.aih : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝
intro Q hQwk.aih : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝
exact hΓ Q (hΔ.sublist.subset hQ)
| and_I hP hQ ihP ihQ =>and_IihP : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝ ihQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ Q✝
intro Γ hΓand_IihP : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝ ihQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ Q✝
exact Pf.and_I (ihP hΓ) (ihQ hΓ)
| and_E₁ hPQ ih =>and_E₁⊢ ∀ {
Γ :
Ctxt}, (∀
Q ∈
Γ✝,
Pf Γ Q) →
Pf Γ P✝
intro Γ hΓ
exact Pf.and_E₁ (ih hΓ)
| and_E₂ hPQ ih =>and_E₂⊢ ∀ {
Γ :
Ctxt}, (∀
Q ∈
Γ✝,
Pf Γ Q) →
Pf Γ Q✝
intro Γ hΓ
exact Pf.and_E₂ (ih hΓ)
| or_I₁ hP ih =>or_I₁ih : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝
intro Γ hΓor_I₁ih : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝
exact Pf.or_I₁ (ih hΓ)
| or_I₂ hQ ih =>or_I₂ih : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ Q✝
intro Γ hΓor_I₂ih : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ Q✝
exact Pf.or_I₂ (ih hΓ)
| or_E hPQ hPC hQC ihPQ ihPC ihQC =>or_EihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ⊢ ∀ {
Γ :
Ctxt}, (∀
Q ∈
Γ✝,
Pf Γ Q) →
Pf Γ C✝
intro Γ hΓor_EihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝
exact Pf.or_E (ihPQ hΓ)
(ihPC (Γ := _ :: Γ) (fun R hR => byihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝
simp at hRihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝
rcases hR with rfl | hRinlihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (R ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ R :: Γ✝, Pf Γ Q) → Pf Γ C✝ inrihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝
·inlihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (R ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ R :: Γ✝, Pf Γ Q) → Pf Γ C✝ exact Pf.assume
·inrihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ exact Pf.wk (List.suffix_cons _ Γ) (hΓ R hR)))
(ihQC (Γ := _ :: Γ) (fun R hR => byihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝
simp at hRihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝
rcases hR with rfl | hRinlihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ R) ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ R :: Γ✝, Pf Γ Q) → Pf Γ C✝ inrihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝
·inlihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ R) ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ R :: Γ✝, Pf Γ Q) → Pf Γ C✝ exact Pf.assume
·inrihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ∨ Q✝) ihPC : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ ihQC : ∀ {Γ : Ctxt}, (∀ Q ∈ Q✝ :: Γ✝, Pf Γ Q) → Pf Γ C✝ exact Pf.wk (List.suffix_cons _ Γ) (hΓ R hR)))
| imp_I hPQ ih =>imp_Iih : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ Q✝
intro Γ hΓimp_Iih : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ Q✝
exact Pf.imp_I (ih (Γ := _ :: Γ) (fun R hR => byih : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ Q✝
simp at hRih : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ Q✝
rcases hR with rfl | hRinlih : ∀ {Γ : Ctxt}, (∀ Q ∈ R :: Γ✝, Pf Γ Q) → Pf Γ Q✝ inrih : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ Q✝
·inlih : ∀ {Γ : Ctxt}, (∀ Q ∈ R :: Γ✝, Pf Γ Q) → Pf Γ Q✝ exact Pf.assume
·inrih : ∀ {Γ : Ctxt}, (∀ Q ∈ P✝ :: Γ✝, Pf Γ Q) → Pf Γ Q✝ exact Pf.wk (List.suffix_cons _ Γ) (hΓ R hR)))
| imp_E hPQ hP ihPQ ihP =>imp_EihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ⇒ Q✝) ihP : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝ ⊢ ∀ {
Γ :
Ctxt}, (∀
Q ∈
Γ✝,
Pf Γ Q) →
Pf Γ Q✝
intro Γ hΓimp_EihPQ : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ (P✝ ⇒ Q✝) ihP : ∀ {Γ : Ctxt}, (∀ Q ∈ Γ✝, Pf Γ Q) → Pf Γ P✝
exact Pf.imp_E (ihPQ hΓ) (ihP hΓ)
| ff_E hff ih =>ff_E⊢ ∀ {
Γ :
Ctxt}, (∀
Q ∈
Γ✝,
Pf Γ Q) →
Pf Γ P✝
intro Γ hΓ
exact Pf.ff_E (ih hΓ)
| tt_I =>
intro Γ hΓ
exact Pf.tt_I