\begin{code}
module Examples where
open import Preliminaries
open import DataTypes
open import H
open import Dialectica
open import Simp
\end{code}
\begin{code}
Lmᴴ[st-succ] : {Γ : Cxt} {Ξ : Asmpt Γ}
→ Prf Ξ (∀ˢᵗ (st (Succ ν₀)))
Lmᴴ[st-succ] = ∀ˢᵗ-I (∀-intro (⇒-intro (st-succ κ₀)))
Φ₀ : Fml ε
Φ₀ = ∀ˢᵗ (st (Succ ν₀))
Ex₀ : Prf ε Φ₀
Ex₀ = Lmᴴ[st-succ]
t₀ : List (ℕ → List ℕ)
t₀ = extract Ex₀
length-of-t₀ : length t₀ ≡ 1
length-of-t₀ = refl
r₀ : ℕ → List ℕ
r₀ = head t₀ (≤-succ ≤-zero)
normal-form-of-r₀ : r₀ ≡ (λ x → ε ₊ succ x)
normal-form-of-r₀ = refl
\end{code}
\begin{code}
Lmᴴ[st-≤] : {Γ : Cxt} {Ξ : Asmpt Γ}
→ Prf Ξ (∀ˢᵗ (∀ᴴ (ν₀ ≤ᴴ ν₁ ⇒ᴴ st ν₀)))
Lmᴴ[st-≤] = IRˢᵗ base step
where
base : Prf _ (∀ᴴ (ν₀ ≤ᴴ Zero ⇒ᴴ st ν₀))
base = ∀-intro (⇒-intro (st-eq (st-cl Zero) (Sym (Lmᴴ[n≤0→n=0] κ₀))))
step : Prf _ (∀ˢᵗ (∀ᴴ (ν₀ ≤ᴴ ν₁ ⇒ᴴ st ν₀) ⇒ᴴ (∀ᴴ (ν₀ ≤ᴴ Succ ν₁ ⇒ᴴ st ν₀))))
step = ∀ˢᵗ-I (∀-intro (⇒-intro (⇒-intro (∀-intro (⇒-intro (∨-elim cL cR (Lmᴴ[≤-Succ-∨] κ₀)))))))
where
cL : Prf _ (ν₀ =ᴴ Succ ν₁ ⇒ᴴ st ν₀)
cL = ⇒-intro (st-eq (st-succ κ₃) (Sym κ₀))
cR : Prf _ (ν₀ ≤ᴴ ν₁ ⇒ᴴ st ν₀)
cR = ⇒-intro (⇒-elim (∀-elim κ₂ ν₀) κ₀)
Φ₁ : Fml ε
Φ₁ = ∀ˢᵗ (∀ᴴ (ν₀ ≤ᴴ ν₁ ⇒ᴴ st ν₀))
Ex₁ : Prf ε Φ₁
Ex₁ = Lmᴴ[st-≤]
t₁ : List (ℕ → List ((List 𝟙 → List ℕ) × (List 𝟙 → 𝟙 → List 𝟙)))
t₁ = extract Ex₁
length-of-t₁ : length t₁ ≡ 1
length-of-t₁ = refl
r₁ : ℕ → List ((List 𝟙 → List ℕ) × (List 𝟙 → 𝟙 → List 𝟙))
r₁ = head t₁ (≤-succ ≤-zero)
sr₁ : ℕ → List (List ℕ)
sr₁ = simpᴹ _ r₁
sr₁[0] : sr₁ 0 ≡ ⟨ ε ₊ 0 ⟩
sr₁[0] = refl
sr₁[7] : sr₁ 7 ≡ ⟨ ε ₊ 7 ₊ 6 ₊ 5 ₊ 4 ₊ 3 ₊ 2 ₊ 1 ₊ 0 ⟩
sr₁[7] = refl
sr₁[12] : sr₁ 12 ≡ ⟨ ε ₊ 12 ₊ 11 ₊ 10 ₊ 9 ₊ 8 ₊ 7 ₊ 6 ₊ 5 ₊ 4 ₊ 3 ₊ 2 ₊ 1 ₊ 0 ⟩
sr₁[12] = refl
\end{code}
\begin{code}
Ex₂ : {Γ : Cxt} {Ξ : Asmpt Γ}
→ Prf Ξ (∀ᴴ (∃ᴴ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀)))
Ex₂ = ∀-intro (∃-intro Zero (∧-intro ≤-Zero EvenZ))
t₂ : List (𝟙 × 𝟙)
t₂ = extract (Ex₂ {ε} {ε})
normal-form-of-t₂ : t₂ ≡ ⟨ (⋆ , ⋆) ⟩
normal-form-of-t₂ = refl
Ex₂' : {Γ : Cxt} {Ξ : Asmpt Γ}
→ Prf Ξ (∀ᴴ (∃ᴴ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀)))
Ex₂' = IR (int-∃ (int-∧ int-≤ int-E))
(∃-intro Zero (∧-intro ≤-Zero EvenZ))
(∀-intro (⇒-intro (∃-intro Zero (∧-intro ≤-Zero EvenZ))))
t₂' : List (𝟙 × 𝟙)
t₂' = extract (Ex₂' {ε} {ε})
normal-form-of-t₂' : t₂' ≡ ⟨ (⋆ , ⋆) ⟩
normal-form-of-t₂' = refl
\end{code}
\begin{code}
Ex₃ : {Γ : Cxt} {Ξ : Asmpt Γ}
→ Prf Ξ (∀ˢᵗ (∃ˢᵗ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀)))
Ex₃ = ∀ˢᵗ-I (∀-intro (⇒-intro (∃ˢᵗ-I (∃-intro Zero (∧-intro (st-cl Zero) (∧-intro ≤-Zero EvenZ))))))
t₃ : List (ℕ → List ℕ)
t₃ = simpExtract Ex₃
length-of-t₃ : length t₃ ≡ 1
length-of-t₃ = refl
r₃ : ℕ → List ℕ
r₃ = head t₃ (≤-succ ≤-zero)
normal-form-of-r₃ : r₃ ≡ (λ _ → ⟨ 0 ⟩)
normal-form-of-r₃ = refl
Ex₃' : {Γ : Cxt} {Ξ : Asmpt Γ}
→ Prf Ξ (∀ˢᵗ (∃ˢᵗ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀)))
Ex₃' = IRˢᵗ (∃ˢᵗ-I (∃-intro Zero (∧-intro (st-cl Zero) (∧-intro ≤-Zero EvenZ))))
(∀ˢᵗ-I (∀-intro (⇒-intro (⇒-intro (∃ˢᵗ-I (∃-intro Zero (∧-intro (st-cl Zero) (∧-intro ≤-Zero EvenZ))))))))
t₃' : List (ℕ → List ℕ)
t₃' = simpExtract Ex₃'
length-of-t₃' : length t₃' ≡ 1
length-of-t₃' = refl
r₃' : ℕ → List ℕ
r₃' = head t₃' (≤-succ ≤-zero)
r₃'[n]=⟨0⟩ : (n : ℕ) → r₃' n ≡ ⟨ 0 ⟩
r₃'[n]=⟨0⟩ 0 = refl
r₃'[n]=⟨0⟩ (succ n) = refl
Ex₃'' : {Γ : Cxt} {Ξ : Asmpt Γ}
→ Prf Ξ (∀ˢᵗ (∃ˢᵗ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀)))
Ex₃'' {Γ} {Ξ} = ∀ˢᵗ-I (∀-intro (⇒-intro goal))
where
claim₀ : Prf (wknᵃ (wknᵃ Ξ) ₊ st ν₁ ₊ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀)) (st ν₀)
claim₀ = ⇒-elim (∀-elim (⇒-elim (∀-elim (∀ˢᵗ-E Lmᴴ[st-≤]) ν₁) κ₁) ν₀) (∧-elim₁ κ₀)
claim₁ : Prf (wknᵃ Ξ ₊ st ν₀) (∀ᴴ ((ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀) ⇒ᴴ ∃ˢᵗ (ν₀ ≤ᴴ ν₂ ∧ᴴ Even ν₀)))
claim₁ = ∀-intro (⇒-intro (∃ˢᵗ-I (∃-intro ν₀ (∧-intro claim₀ κ₀))))
claim₂ : Prf (wknᵃ Ξ ₊ st ν₀) (∃ᴴ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀) ⇒ᴴ ∃ˢᵗ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀))
claim₂ = ∃-elim claim₁
claim₃ : Prf (wknᵃ Ξ ₊ st ν₀) (∃ᴴ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀))
claim₃ = ∀-elim Ex₂ ν₀
goal : Prf (wknᵃ Ξ ₊ st ν₀) (∃ˢᵗ (ν₀ ≤ᴴ ν₁ ∧ᴴ Even ν₀))
goal = ⇒-elim claim₂ claim₃
t₃'' : List (ℕ → List ℕ)
t₃'' = simpExtract Ex₃''
length-of-t₃'' : length t₃'' ≡ 1
length-of-t₃'' = refl
r₃'' : ℕ → List ℕ
r₃'' = head t₃'' (≤-succ ≤-zero)
r₃''[0] : r₃'' 0 ≡ ⟨ 0 ⟩
r₃''[0] = refl
r₃[0] : r₃ 0 ≡ ⟨ 0 ⟩
r₃[0] = refl
r₃'[0] : r₃' 0 ≡ ⟨ 0 ⟩
r₃'[0] = refl
r₃''[2] : r₃'' 2 ≡ ε ₊ 0 ₊ 1 ₊ 2
r₃''[2] = refl
r₃[2] : r₃ 2 ≡ ⟨ 0 ⟩
r₃[2] = refl
r₃'[2] : r₃' 2 ≡ ⟨ 0 ⟩
r₃'[2] = refl
\end{code}