/-Copyright (c) 2026 Carles Marín. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles Marín, Claude (AI assistant)-//-# encaje: integración de los Teoremas A y B del Paper III; reutiliza las pruebasde AngularThreeStep y AngularPhase2, sin repetir cálculos ni añadir axiomas.Puerta de enunciado previa a la prueba: AngularPaper3Final.-/module public import Formalizations.Combinatorics.Caballero.AngularThreeSteppublic import Formalizations.Combinatorics.Caballero.AngularPhase2 /-!# AngularPaper3Final-/ /-!## References * C. Marín, Exact angular ambiguity profile for Dyck words of divisors (Part III), Zenodo (2026), doi:10.5281/zenodo.24699411.* C. Marín, How Many Dyck Words Do the Divisors of an Integer Make? Exact Counts and Quasipolynomial Growth (Part I), Zenodo (2026), doi:10.5281/zenodo.24536372 (concept DOI).-/ @[expose] public section namespace CaballeroPaper3Final open CaballeroPeaks CaballeroExact CaballeroFase2 MeasureTheory Set /-- La ley de tres pasos probada descarga la hipótesis provisional de fase 2. -/theorem ley_tres_pasos_probada (Amb : ℤ → Palabra → Prop) : LeyTresPasos Amb := by intro b θ hθ hb hcl₀ hcl₃ exact CaballeroExact.three_step Amb b θ hθ hb hcl₀ hcl₃ /-- Perfil exacto del Teorema B, condicionado solo a la clasificación de la Parte I. -/theorem exact_profile_final (Amb : ℤ → Palabra → Prop) (hcl : ∀ b : ℤ, 3 ≤ b → ∀ w, Amb b w ↔ enLista b w) (θ : ℝ) (hθ0 : 0 < θ) (hθ1 : θ ≤ 1) (b : ℕ) (hb : (12 : ℝ) * θ + 18 ≤ (b : ℝ)) : secLen Amb b θ = (b : ℝ) * F2 θ + kappa θ + epsilon (b % 3) / 3 * delta θ ∧ (epsilon (b % 3) / 3 * delta θ ≠ 0 ↔ 2 / 3 < θ ∧ θ < 1 ∧ b % 3 ≠ 0) := by constructor · exact CaballeroFase2.exact_profile Amb hcl (ley_tres_pasos_probada Amb) θ hθ0 hθ1 b hb · exact CaballeroFase2.residuo_ne_cero_iff b θ hθ0 hθ1 /-- Primer aserto del Corolario de perfil, condicionado solo a la Parte I. -/theorem perfil_uniforme_final (Amb : ℤ → Palabra → Prop) (hcl : ∀ b : ℤ, 3 ≤ b → ∀ w, Amb b w ↔ enLista b w) (J : Set ℝ) (hJ : IsCompact J) (hJ0 : J ⊆ Ioi 0) : ∃ C : ℝ, ∀ b : ℕ, 1 ≤ b → ∀ θ ∈ J, |fracAmb Amb b θ - F2 θ| ≤ C / b := by exact CaballeroFase2.perfil_uniforme Amb hcl (ley_tres_pasos_probada Amb) J hJ hJ0 /-- Segundo aserto del Corolario de perfil, incluida la integrabilidad. -/theorem media_perfil_final (Amb : ℤ → Palabra → Prop) (hcl : ∀ b : ℤ, 3 ≤ b → ∀ w, Amb b w ↔ enLista b w) : ∃ C : ℝ, ∀ b : ℕ, 1 ≤ b → IntervalIntegrable (fracAmb Amb b) volume (7 / 50) (69 / 10) ∧ |(∫ θ in (7 / 50 : ℝ)..(69 / 10), fracAmb Amb b θ) / ((69 : ℝ) / 10 - 7 / 50) - 5809 / 152100| ≤ C / b := by exact CaballeroFase2.media_perfil Amb hcl (ley_tres_pasos_probada Amb) end CaballeroPaper3Final