Exact expanded PA statement
forall p n u v r. p = S n -> ((~(p = 1) /\ forall wip_prime_left_wpopi_prime wip_prime_right_wpopi_prime. p = wip_prime_left_wpopi_prime * wip_prime_right_wpopi_prime -> wip_prime_left_wpopi_prime = 1 \/ wip_prime_right_wpopi_prime = 1)) -> (forall wip_index_wpopi_inverse. (exists wip_gap_wpopi_inverse_prefix_bound. wip_gap_wpopi_inverse_prefix_bound + S wip_index_wpopi_inverse = n) -> exists wip_mate_wpopi_inverse. ((((exists wip_beta_height_wpopi_inverse_decoded. wip_beta_height_wpopi_inverse_decoded + S (wip_mate_wpopi_inverse) = S ((S (wip_index_wpopi_inverse)) * v)) /\ exists wip_beta_quotient_wpopi_inverse_decoded. u = wip_beta_quotient_wpopi_inverse_decoded * S ((S (wip_index_wpopi_inverse)) * v) + (wip_mate_wpopi_inverse))) /\ ((exists wip_gap_wpopi_inverse_inverse_index_bound. wip_gap_wpopi_inverse_inverse_index_bound + S wip_index_wpopi_inverse = n) /\ ((exists wip_gap_wpopi_inverse_inverse_mate_bound. wip_gap_wpopi_inverse_inverse_mate_bound + S wip_mate_wpopi_inverse = n) /\ (exists wip_mod_left_wpopi_inverse_inverse_mod wip_mod_right_wpopi_inverse_inverse_mod. ((S wip_index_wpopi_inverse) * S wip_mate_wpopi_inverse) + p * wip_mod_left_wpopi_inverse_inverse_mod = 1 + p * wip_mod_right_wpopi_inverse_inverse_mod))))) -> n = S r -> forall m k. (k + k) + S (S (m + m)) = n -> (exists b c. ((((forall wpo_position_wpopi_iteration_state_closed wpo_source_wpopi_iteration_state_closed wpo_mate_wpopi_iteration_state_closed. (exists wpo_gap_wpopi_iteration_state_closed_position_bound. wpo_gap_wpopi_iteration_state_closed_position_bound + S (wpo_position_wpopi_iteration_state_closed) = m + m) -> (((exists wpo_beta_height_wpopi_iteration_state_closed_source_entry. wpo_beta_height_wpopi_iteration_state_closed_source_entry + S (wpo_source_wpopi_iteration_state_closed) = S ((S (wpo_position_wpopi_iteration_state_closed)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_closed_source_entry. b = wpo_beta_quotient_wpopi_iteration_state_closed_source_entry * S ((S (wpo_position_wpopi_iteration_state_closed)) * c) + (wpo_source_wpopi_iteration_state_closed))) -> (((exists wpo_beta_height_wpopi_iteration_state_closed_inverse_entry. wpo_beta_height_wpopi_iteration_state_closed_inverse_entry + S (wpo_mate_wpopi_iteration_state_closed) = S ((S (wpo_source_wpopi_iteration_state_closed)) * v)) /\ exists wpo_beta_quotient_wpopi_iteration_state_closed_inverse_entry. u = wpo_beta_quotient_wpopi_iteration_state_closed_inverse_entry * S ((S (wpo_source_wpopi_iteration_state_closed)) * v) + (wpo_mate_wpopi_iteration_state_closed))) -> exists wpo_mate_position_wpopi_iteration_state_closed. ((exists wpo_gap_wpopi_iteration_state_closed_mate_bound. wpo_gap_wpopi_iteration_state_closed_mate_bound + S (wpo_mate_position_wpopi_iteration_state_closed) = m + m) /\ (((exists wpo_beta_height_wpopi_iteration_state_closed_mate_entry. wpo_beta_height_wpopi_iteration_state_closed_mate_entry + S (wpo_mate_wpopi_iteration_state_closed) = S ((S (wpo_mate_position_wpopi_iteration_state_closed)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_closed_mate_entry. b = wpo_beta_quotient_wpopi_iteration_state_closed_mate_entry * S ((S (wpo_mate_position_wpopi_iteration_state_closed)) * c) + (wpo_mate_wpopi_iteration_state_closed))))) /\ ((forall fom_index_wpopi_iteration_state_bounded. (exists fom_gap_wpopi_iteration_state_bounded_index_bound. fom_gap_wpopi_iteration_state_bounded_index_bound + S (fom_index_wpopi_iteration_state_bounded) = m + m) -> exists fom_value_wpopi_iteration_state_bounded. ((((exists fom_beta_height_wpopi_iteration_state_bounded_entry. fom_beta_height_wpopi_iteration_state_bounded_entry + S (fom_value_wpopi_iteration_state_bounded) = S ((S (fom_index_wpopi_iteration_state_bounded)) * c)) /\ exists fom_beta_quotient_wpopi_iteration_state_bounded_entry. b = fom_beta_quotient_wpopi_iteration_state_bounded_entry * S ((S (fom_index_wpopi_iteration_state_bounded)) * c) + (fom_value_wpopi_iteration_state_bounded))) /\ (exists fom_gap_wpopi_iteration_state_bounded_value_bound. fom_gap_wpopi_iteration_state_bounded_value_bound + S (fom_value_wpopi_iteration_state_bounded) = n))) /\ ((forall wpo_position_wpopi_iteration_state_nonendpoint wpo_value_wpopi_iteration_state_nonendpoint. (exists wpo_gap_wpopi_iteration_state_nonendpoint_position_bound. wpo_gap_wpopi_iteration_state_nonendpoint_position_bound + S (wpo_position_wpopi_iteration_state_nonendpoint) = m + m) -> (((exists wpo_beta_height_wpopi_iteration_state_nonendpoint_entry. wpo_beta_height_wpopi_iteration_state_nonendpoint_entry + S (wpo_value_wpopi_iteration_state_nonendpoint) = S ((S (wpo_position_wpopi_iteration_state_nonendpoint)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_nonendpoint_entry. b = wpo_beta_quotient_wpopi_iteration_state_nonendpoint_entry * S ((S (wpo_position_wpopi_iteration_state_nonendpoint)) * c) + (wpo_value_wpopi_iteration_state_nonendpoint))) -> (~(wpo_value_wpopi_iteration_state_nonendpoint = 0) /\ ~((S wpo_value_wpopi_iteration_state_nonendpoint) = n))) /\ (forall wpo_injective_left_wpopi_iteration_state_injective wpo_injective_right_wpopi_iteration_state_injective wpo_injective_value_wpopi_iteration_state_injective. (exists wpo_gap_wpopi_iteration_state_injective_left_bound. wpo_gap_wpopi_iteration_state_injective_left_bound + S (wpo_injective_left_wpopi_iteration_state_injective) = m + m) -> (exists wpo_gap_wpopi_iteration_state_injective_right_bound. wpo_gap_wpopi_iteration_state_injective_right_bound + S (wpo_injective_right_wpopi_iteration_state_injective) = m + m) -> (((exists wpo_beta_height_wpopi_iteration_state_injective_left_entry. wpo_beta_height_wpopi_iteration_state_injective_left_entry + S (wpo_injective_value_wpopi_iteration_state_injective) = S ((S (wpo_injective_left_wpopi_iteration_state_injective)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_injective_left_entry. b = wpo_beta_quotient_wpopi_iteration_state_injective_left_entry * S ((S (wpo_injective_left_wpopi_iteration_state_injective)) * c) + (wpo_injective_value_wpopi_iteration_state_injective))) -> (((exists wpo_beta_height_wpopi_iteration_state_injective_right_entry. wpo_beta_height_wpopi_iteration_state_injective_right_entry + S (wpo_injective_value_wpopi_iteration_state_injective) = S ((S (wpo_injective_right_wpopi_iteration_state_injective)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_injective_right_entry. b = wpo_beta_quotient_wpopi_iteration_state_injective_right_entry * S ((S (wpo_injective_right_wpopi_iteration_state_injective)) * c) + (wpo_injective_value_wpopi_iteration_state_injective))) -> wpo_injective_left_wpopi_iteration_state_injective = wpo_injective_right_wpopi_iteration_state_injective))))) /\ (forall wpop_pair_wpopi_iteration_history. (exists wpo_gap_wpopi_iteration_history_pair_bound. wpo_gap_wpopi_iteration_history_pair_bound + S (wpop_pair_wpopi_iteration_history) = m) -> exists wpop_left_wpopi_iteration_history wpop_right_wpopi_iteration_history. ((((exists wpo_beta_height_wpopi_iteration_history_left_entry. wpo_beta_height_wpopi_iteration_history_left_entry + S (wpop_left_wpopi_iteration_history) = S ((S (wpop_pair_wpopi_iteration_history + wpop_pair_wpopi_iteration_history)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_history_left_entry. b = wpo_beta_quotient_wpopi_iteration_history_left_entry * S ((S (wpop_pair_wpopi_iteration_history + wpop_pair_wpopi_iteration_history)) * c) + (wpop_left_wpopi_iteration_history))) /\ ((((exists wpo_beta_height_wpopi_iteration_history_right_entry. wpo_beta_height_wpopi_iteration_history_right_entry + S (wpop_right_wpopi_iteration_history) = S ((S (S (wpop_pair_wpopi_iteration_history + wpop_pair_wpopi_iteration_history))) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_history_right_entry. b = wpo_beta_quotient_wpopi_iteration_history_right_entry * S ((S (S (wpop_pair_wpopi_iteration_history + wpop_pair_wpopi_iteration_history))) * c) + (wpop_right_wpopi_iteration_history))) /\ (((exists wpo_beta_height_wpopi_iteration_history_inverse_entry. wpo_beta_height_wpopi_iteration_history_inverse_entry + S (wpop_right_wpopi_iteration_history) = S ((S (wpop_left_wpopi_iteration_history)) * v)) /\ exists wpo_beta_quotient_wpopi_iteration_history_inverse_entry. u = wpo_beta_quotient_wpopi_iteration_history_inverse_entry * S ((S (wpop_left_wpopi_iteration_history)) * v) + (wpop_right_wpopi_iteration_history))))))))Structural proof guide
Generated structural guide
Iterate pair appends while retaining both bounded state and adjacent inverse history.
Use the direct prerequisites pair_order_state_zero, paired_inverse_witness_zero, pair_order_iteration_previous_balance, pair_order_iteration_step_room, prime_pair_order_paired_state_step, pair_order_double_succ_length as previously established PA formulas.
The proof proceeds by structural induction (1), case analysis (8), intermediate claims (11), equality transport (12), certified simplification (1).
Referenced ingredients
Proof neighborhood
Direct dependencies
PA00AA pair_order_state_zero PA00AB paired_inverse_witness_zero PA00AC pair_order_iteration_previous_balance PA00AD pair_order_iteration_step_room PA00B0 prime_pair_order_paired_state_step PA009U pair_order_double_succ_lengthDirect dependents
Formal native tactic body
Dependencies are introduced as named hypotheses before line 1. Linked names are exact direct references. This Alpha-v16 checked-use theorem is independently kernel-checked when replayed; it is not a Stable theorem.
- 0001
intro p - 0002
intro n - 0003
intro u - 0004
intro v - 0005
intro r - 0006
intro hpn - 0007
intro hp - 0008
intro hprefix - 0009
intro hnr - 0010
induction m - 0011
intro k - 0012
intro hbalance - 0013
have hzero_state : exists b c. (((forall wpo_position_wpopi_zero_state_closed wpo_source_wpopi_zero_state_closed wpo_mate_wpopi_zero_state_closed. (exists wpo_gap_wpopi_zero_state_closed_position_bound. wpo_gap_wpopi_zero_state_closed_position_bound + S (wpo_position_wpopi_zero_state_closed) = 0) -> (((exists wpo_beta_height_wpopi_zero_state_closed_source_entry. wpo_beta_height_wpopi_zero_state_closed_source_entry + S (wpo_source_wpopi_zero_state_closed) = S ((S (wpo_position_wpopi_zero_state_closed)) * c)) /\ exists wpo_beta_quotient_wpopi_zero_state_closed_source_entry. b = wpo_beta_quotient_wpopi_zero_state_closed_source_entry * S ((S (wpo_position_wpopi_zero_state_closed)) * c) + (wpo_source_wpopi_zero_state_closed))) -> (((exists wpo_beta_height_wpopi_zero_state_closed_inverse_entry. wpo_beta_height_wpopi_zero_state_closed_inverse_entry + S (wpo_mate_wpopi_zero_state_closed) = S ((S (wpo_source_wpopi_zero_state_closed)) * v)) /\ exists wpo_beta_quotient_wpopi_zero_state_closed_inverse_entry. u = wpo_beta_quotient_wpopi_zero_state_closed_inverse_entry * S ((S (wpo_source_wpopi_zero_state_closed)) * v) + (wpo_mate_wpopi_zero_state_closed))) -> exists wpo_mate_position_wpopi_zero_state_closed. ((exists wpo_gap_wpopi_zero_state_closed_mate_bound. wpo_gap_wpopi_zero_state_closed_mate_bound + S (wpo_mate_position_wpopi_zero_state_closed) = 0) /\ (((exists wpo_beta_height_wpopi_zero_state_closed_mate_entry. wpo_beta_height_wpopi_zero_state_closed_mate_entry + S (wpo_mate_wpopi_zero_state_closed) = S ((S (wpo_mate_position_wpopi_zero_state_closed)) * c)) /\ exists wpo_beta_quotient_wpopi_zero_state_closed_mate_entry. b = wpo_beta_quotient_wpopi_zero_state_closed_mate_entry * S ((S (wpo_mate_position_wpopi_zero_state_closed)) * c) + (wpo_mate_wpopi_zero_state_closed))))) /\ ((forall fom_index_wpopi_zero_state_bounded. (exists fom_gap_wpopi_zero_state_bounded_index_bound. fom_gap_wpopi_zero_state_bounded_index_bound + S (fom_index_wpopi_zero_state_bounded) = 0) -> exists fom_value_wpopi_zero_state_bounded. ((((exists fom_beta_height_wpopi_zero_state_bounded_entry. fom_beta_height_wpopi_zero_state_bounded_entry + S (fom_value_wpopi_zero_state_bounded) = S ((S (fom_index_wpopi_zero_state_bounded)) * c)) /\ exists fom_beta_quotient_wpopi_zero_state_bounded_entry. b = fom_beta_quotient_wpopi_zero_state_bounded_entry * S ((S (fom_index_wpopi_zero_state_bounded)) * c) + (fom_value_wpopi_zero_state_bounded))) /\ (exists fom_gap_wpopi_zero_state_bounded_value_bound. fom_gap_wpopi_zero_state_bounded_value_bound + S (fom_value_wpopi_zero_state_bounded) = n))) /\ ((forall wpo_position_wpopi_zero_state_nonendpoint wpo_value_wpopi_zero_state_nonendpoint. (exists wpo_gap_wpopi_zero_state_nonendpoint_position_bound. wpo_gap_wpopi_zero_state_nonendpoint_position_bound + S (wpo_position_wpopi_zero_state_nonendpoint) = 0) -> (((exists wpo_beta_height_wpopi_zero_state_nonendpoint_entry. wpo_beta_height_wpopi_zero_state_nonendpoint_entry + S (wpo_value_wpopi_zero_state_nonendpoint) = S ((S (wpo_position_wpopi_zero_state_nonendpoint)) * c)) /\ exists wpo_beta_quotient_wpopi_zero_state_nonendpoint_entry. b = wpo_beta_quotient_wpopi_zero_state_nonendpoint_entry * S ((S (wpo_position_wpopi_zero_state_nonendpoint)) * c) + (wpo_value_wpopi_zero_state_nonendpoint))) -> (~(wpo_value_wpopi_zero_state_nonendpoint = 0) /\ ~((S wpo_value_wpopi_zero_state_nonendpoint) = n))) /\ (forall wpo_injective_left_wpopi_zero_state_injective wpo_injective_right_wpopi_zero_state_injective wpo_injective_value_wpopi_zero_state_injective. (exists wpo_gap_wpopi_zero_state_injective_left_bound. wpo_gap_wpopi_zero_state_injective_left_bound + S (wpo_injective_left_wpopi_zero_state_injective) = 0) -> (exists wpo_gap_wpopi_zero_state_injective_right_bound. wpo_gap_wpopi_zero_state_injective_right_bound + S (wpo_injective_right_wpopi_zero_state_injective) = 0) -> (((exists wpo_beta_height_wpopi_zero_state_injective_left_entry. wpo_beta_height_wpopi_zero_state_injective_left_entry + S (wpo_injective_value_wpopi_zero_state_injective) = S ((S (wpo_injective_left_wpopi_zero_state_injective)) * c)) /\ exists wpo_beta_quotient_wpopi_zero_state_injective_left_entry. b = wpo_beta_quotient_wpopi_zero_state_injective_left_entry * S ((S (wpo_injective_left_wpopi_zero_state_injective)) * c) + (wpo_injective_value_wpopi_zero_state_injective))) -> (((exists wpo_beta_height_wpopi_zero_state_injective_right_entry. wpo_beta_height_wpopi_zero_state_injective_right_entry + S (wpo_injective_value_wpopi_zero_state_injective) = S ((S (wpo_injective_right_wpopi_zero_state_injective)) * c)) /\ exists wpo_beta_quotient_wpopi_zero_state_injective_right_entry. b = wpo_beta_quotient_wpopi_zero_state_injective_right_entry * S ((S (wpo_injective_right_wpopi_zero_state_injective)) * c) + (wpo_injective_value_wpopi_zero_state_injective))) -> wpo_injective_left_wpopi_zero_state_injective = wpo_injective_right_wpopi_zero_state_injective))))) - 0014
specialize pair_order_state_zero u - 0015
specialize pair_order_state_zero v - 0016
specialize pair_order_state_zero n - 0017
exact pair_order_state_zero - 0018
cases hzero_state - 0019
cases hzero_state_witness - 0020
have hzero : 0 + 0 = 0 - 0021
simp - 0022
exists x - 0023
exists x1 - 0024
split - 0025
rewrite hzero - 0026
rewrite hzero - 0027
rewrite hzero - 0028
rewrite hzero - 0029
rewrite hzero - 0030
rewrite hzero - 0031
exact hzero_state_witness_witness - 0032
specialize paired_inverse_witness_zero u - 0033
specialize paired_inverse_witness_zero v - 0034
specialize paired_inverse_witness_zero x - 0035
specialize paired_inverse_witness_zero x1 - 0036
exact paired_inverse_witness_zero - 0037
intro k - 0038
intro hbalance - 0039
have hprevious_normalize : (k + k) + S (S (S m + S m)) = (S k + S k) + S (S (m + m)) - 0040
specialize pair_order_iteration_previous_balance m - 0041
specialize pair_order_iteration_previous_balance k - 0042
exact pair_order_iteration_previous_balance - 0043
have hprevious_balance : (S k + S k) + S (S (m + m)) = n - 0044
trans (k + k) + S (S (S m + S m)) - 0045
symm - 0046
exact hprevious_normalize - 0047
exact hbalance - 0048
have hprevious : exists b c. ((((forall wpo_position_wpopi_iteration_state_closed wpo_source_wpopi_iteration_state_closed wpo_mate_wpopi_iteration_state_closed. (exists wpo_gap_wpopi_iteration_state_closed_position_bound. wpo_gap_wpopi_iteration_state_closed_position_bound + S (wpo_position_wpopi_iteration_state_closed) = m + m) -> (((exists wpo_beta_height_wpopi_iteration_state_closed_source_entry. wpo_beta_height_wpopi_iteration_state_closed_source_entry + S (wpo_source_wpopi_iteration_state_closed) = S ((S (wpo_position_wpopi_iteration_state_closed)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_closed_source_entry. b = wpo_beta_quotient_wpopi_iteration_state_closed_source_entry * S ((S (wpo_position_wpopi_iteration_state_closed)) * c) + (wpo_source_wpopi_iteration_state_closed))) -> (((exists wpo_beta_height_wpopi_iteration_state_closed_inverse_entry. wpo_beta_height_wpopi_iteration_state_closed_inverse_entry + S (wpo_mate_wpopi_iteration_state_closed) = S ((S (wpo_source_wpopi_iteration_state_closed)) * v)) /\ exists wpo_beta_quotient_wpopi_iteration_state_closed_inverse_entry. u = wpo_beta_quotient_wpopi_iteration_state_closed_inverse_entry * S ((S (wpo_source_wpopi_iteration_state_closed)) * v) + (wpo_mate_wpopi_iteration_state_closed))) -> exists wpo_mate_position_wpopi_iteration_state_closed. ((exists wpo_gap_wpopi_iteration_state_closed_mate_bound. wpo_gap_wpopi_iteration_state_closed_mate_bound + S (wpo_mate_position_wpopi_iteration_state_closed) = m + m) /\ (((exists wpo_beta_height_wpopi_iteration_state_closed_mate_entry. wpo_beta_height_wpopi_iteration_state_closed_mate_entry + S (wpo_mate_wpopi_iteration_state_closed) = S ((S (wpo_mate_position_wpopi_iteration_state_closed)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_closed_mate_entry. b = wpo_beta_quotient_wpopi_iteration_state_closed_mate_entry * S ((S (wpo_mate_position_wpopi_iteration_state_closed)) * c) + (wpo_mate_wpopi_iteration_state_closed))))) /\ ((forall fom_index_wpopi_iteration_state_bounded. (exists fom_gap_wpopi_iteration_state_bounded_index_bound. fom_gap_wpopi_iteration_state_bounded_index_bound + S (fom_index_wpopi_iteration_state_bounded) = m + m) -> exists fom_value_wpopi_iteration_state_bounded. ((((exists fom_beta_height_wpopi_iteration_state_bounded_entry. fom_beta_height_wpopi_iteration_state_bounded_entry + S (fom_value_wpopi_iteration_state_bounded) = S ((S (fom_index_wpopi_iteration_state_bounded)) * c)) /\ exists fom_beta_quotient_wpopi_iteration_state_bounded_entry. b = fom_beta_quotient_wpopi_iteration_state_bounded_entry * S ((S (fom_index_wpopi_iteration_state_bounded)) * c) + (fom_value_wpopi_iteration_state_bounded))) /\ (exists fom_gap_wpopi_iteration_state_bounded_value_bound. fom_gap_wpopi_iteration_state_bounded_value_bound + S (fom_value_wpopi_iteration_state_bounded) = n))) /\ ((forall wpo_position_wpopi_iteration_state_nonendpoint wpo_value_wpopi_iteration_state_nonendpoint. (exists wpo_gap_wpopi_iteration_state_nonendpoint_position_bound. wpo_gap_wpopi_iteration_state_nonendpoint_position_bound + S (wpo_position_wpopi_iteration_state_nonendpoint) = m + m) -> (((exists wpo_beta_height_wpopi_iteration_state_nonendpoint_entry. wpo_beta_height_wpopi_iteration_state_nonendpoint_entry + S (wpo_value_wpopi_iteration_state_nonendpoint) = S ((S (wpo_position_wpopi_iteration_state_nonendpoint)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_nonendpoint_entry. b = wpo_beta_quotient_wpopi_iteration_state_nonendpoint_entry * S ((S (wpo_position_wpopi_iteration_state_nonendpoint)) * c) + (wpo_value_wpopi_iteration_state_nonendpoint))) -> (~(wpo_value_wpopi_iteration_state_nonendpoint = 0) /\ ~((S wpo_value_wpopi_iteration_state_nonendpoint) = n))) /\ (forall wpo_injective_left_wpopi_iteration_state_injective wpo_injective_right_wpopi_iteration_state_injective wpo_injective_value_wpopi_iteration_state_injective. (exists wpo_gap_wpopi_iteration_state_injective_left_bound. wpo_gap_wpopi_iteration_state_injective_left_bound + S (wpo_injective_left_wpopi_iteration_state_injective) = m + m) -> (exists wpo_gap_wpopi_iteration_state_injective_right_bound. wpo_gap_wpopi_iteration_state_injective_right_bound + S (wpo_injective_right_wpopi_iteration_state_injective) = m + m) -> (((exists wpo_beta_height_wpopi_iteration_state_injective_left_entry. wpo_beta_height_wpopi_iteration_state_injective_left_entry + S (wpo_injective_value_wpopi_iteration_state_injective) = S ((S (wpo_injective_left_wpopi_iteration_state_injective)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_injective_left_entry. b = wpo_beta_quotient_wpopi_iteration_state_injective_left_entry * S ((S (wpo_injective_left_wpopi_iteration_state_injective)) * c) + (wpo_injective_value_wpopi_iteration_state_injective))) -> (((exists wpo_beta_height_wpopi_iteration_state_injective_right_entry. wpo_beta_height_wpopi_iteration_state_injective_right_entry + S (wpo_injective_value_wpopi_iteration_state_injective) = S ((S (wpo_injective_right_wpopi_iteration_state_injective)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_state_injective_right_entry. b = wpo_beta_quotient_wpopi_iteration_state_injective_right_entry * S ((S (wpo_injective_right_wpopi_iteration_state_injective)) * c) + (wpo_injective_value_wpopi_iteration_state_injective))) -> wpo_injective_left_wpopi_iteration_state_injective = wpo_injective_right_wpopi_iteration_state_injective))))) /\ (forall wpop_pair_wpopi_iteration_history. (exists wpo_gap_wpopi_iteration_history_pair_bound. wpo_gap_wpopi_iteration_history_pair_bound + S (wpop_pair_wpopi_iteration_history) = m) -> exists wpop_left_wpopi_iteration_history wpop_right_wpopi_iteration_history. ((((exists wpo_beta_height_wpopi_iteration_history_left_entry. wpo_beta_height_wpopi_iteration_history_left_entry + S (wpop_left_wpopi_iteration_history) = S ((S (wpop_pair_wpopi_iteration_history + wpop_pair_wpopi_iteration_history)) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_history_left_entry. b = wpo_beta_quotient_wpopi_iteration_history_left_entry * S ((S (wpop_pair_wpopi_iteration_history + wpop_pair_wpopi_iteration_history)) * c) + (wpop_left_wpopi_iteration_history))) /\ ((((exists wpo_beta_height_wpopi_iteration_history_right_entry. wpo_beta_height_wpopi_iteration_history_right_entry + S (wpop_right_wpopi_iteration_history) = S ((S (S (wpop_pair_wpopi_iteration_history + wpop_pair_wpopi_iteration_history))) * c)) /\ exists wpo_beta_quotient_wpopi_iteration_history_right_entry. b = wpo_beta_quotient_wpopi_iteration_history_right_entry * S ((S (S (wpop_pair_wpopi_iteration_history + wpop_pair_wpopi_iteration_history))) * c) + (wpop_right_wpopi_iteration_history))) /\ (((exists wpo_beta_height_wpopi_iteration_history_inverse_entry. wpo_beta_height_wpopi_iteration_history_inverse_entry + S (wpop_right_wpopi_iteration_history) = S ((S (wpop_left_wpopi_iteration_history)) * v)) /\ exists wpo_beta_quotient_wpopi_iteration_history_inverse_entry. u = wpo_beta_quotient_wpopi_iteration_history_inverse_entry * S ((S (wpop_left_wpopi_iteration_history)) * v) + (wpop_right_wpopi_iteration_history))))))) - 0049
specialize IH (S k) - 0050
apply IH - 0051
exact hprevious_balance - 0052
cases hprevious - 0053
cases hprevious_witness - 0054
cases hprevious_witness_witness - 0055
have hroom_normalize : (k + k) + S (S (S m + S m)) = S (k + k) + S (S (S (m + m))) - 0056
specialize pair_order_iteration_step_room m - 0057
specialize pair_order_iteration_step_room k - 0058
exact pair_order_iteration_step_room - 0059
have hroom_eq : S (k + k) + S (S (S (m + m))) = n - 0060
trans (k + k) + S (S (S m + S m)) - 0061
symm - 0062
exact hroom_normalize - 0063
exact hbalance - 0064
have hroom : exists h. h + S (S (S (m + m))) = n - 0065
exists S (k + k) - 0066
exact hroom_eq - 0067
have hnext : exists z d. ((((forall wpo_position_wpopi_next_state_closed wpo_source_wpopi_next_state_closed wpo_mate_wpopi_next_state_closed. (exists wpo_gap_wpopi_next_state_closed_position_bound. wpo_gap_wpopi_next_state_closed_position_bound + S (wpo_position_wpopi_next_state_closed) = S (S (m + m))) -> (((exists wpo_beta_height_wpopi_next_state_closed_source_entry. wpo_beta_height_wpopi_next_state_closed_source_entry + S (wpo_source_wpopi_next_state_closed) = S ((S (wpo_position_wpopi_next_state_closed)) * d)) /\ exists wpo_beta_quotient_wpopi_next_state_closed_source_entry. z = wpo_beta_quotient_wpopi_next_state_closed_source_entry * S ((S (wpo_position_wpopi_next_state_closed)) * d) + (wpo_source_wpopi_next_state_closed))) -> (((exists wpo_beta_height_wpopi_next_state_closed_inverse_entry. wpo_beta_height_wpopi_next_state_closed_inverse_entry + S (wpo_mate_wpopi_next_state_closed) = S ((S (wpo_source_wpopi_next_state_closed)) * v)) /\ exists wpo_beta_quotient_wpopi_next_state_closed_inverse_entry. u = wpo_beta_quotient_wpopi_next_state_closed_inverse_entry * S ((S (wpo_source_wpopi_next_state_closed)) * v) + (wpo_mate_wpopi_next_state_closed))) -> exists wpo_mate_position_wpopi_next_state_closed. ((exists wpo_gap_wpopi_next_state_closed_mate_bound. wpo_gap_wpopi_next_state_closed_mate_bound + S (wpo_mate_position_wpopi_next_state_closed) = S (S (m + m))) /\ (((exists wpo_beta_height_wpopi_next_state_closed_mate_entry. wpo_beta_height_wpopi_next_state_closed_mate_entry + S (wpo_mate_wpopi_next_state_closed) = S ((S (wpo_mate_position_wpopi_next_state_closed)) * d)) /\ exists wpo_beta_quotient_wpopi_next_state_closed_mate_entry. z = wpo_beta_quotient_wpopi_next_state_closed_mate_entry * S ((S (wpo_mate_position_wpopi_next_state_closed)) * d) + (wpo_mate_wpopi_next_state_closed))))) /\ ((forall fom_index_wpopi_next_state_bounded. (exists fom_gap_wpopi_next_state_bounded_index_bound. fom_gap_wpopi_next_state_bounded_index_bound + S (fom_index_wpopi_next_state_bounded) = S (S (m + m))) -> exists fom_value_wpopi_next_state_bounded. ((((exists fom_beta_height_wpopi_next_state_bounded_entry. fom_beta_height_wpopi_next_state_bounded_entry + S (fom_value_wpopi_next_state_bounded) = S ((S (fom_index_wpopi_next_state_bounded)) * d)) /\ exists fom_beta_quotient_wpopi_next_state_bounded_entry. z = fom_beta_quotient_wpopi_next_state_bounded_entry * S ((S (fom_index_wpopi_next_state_bounded)) * d) + (fom_value_wpopi_next_state_bounded))) /\ (exists fom_gap_wpopi_next_state_bounded_value_bound. fom_gap_wpopi_next_state_bounded_value_bound + S (fom_value_wpopi_next_state_bounded) = n))) /\ ((forall wpo_position_wpopi_next_state_nonendpoint wpo_value_wpopi_next_state_nonendpoint. (exists wpo_gap_wpopi_next_state_nonendpoint_position_bound. wpo_gap_wpopi_next_state_nonendpoint_position_bound + S (wpo_position_wpopi_next_state_nonendpoint) = S (S (m + m))) -> (((exists wpo_beta_height_wpopi_next_state_nonendpoint_entry. wpo_beta_height_wpopi_next_state_nonendpoint_entry + S (wpo_value_wpopi_next_state_nonendpoint) = S ((S (wpo_position_wpopi_next_state_nonendpoint)) * d)) /\ exists wpo_beta_quotient_wpopi_next_state_nonendpoint_entry. z = wpo_beta_quotient_wpopi_next_state_nonendpoint_entry * S ((S (wpo_position_wpopi_next_state_nonendpoint)) * d) + (wpo_value_wpopi_next_state_nonendpoint))) -> (~(wpo_value_wpopi_next_state_nonendpoint = 0) /\ ~((S wpo_value_wpopi_next_state_nonendpoint) = n))) /\ (forall wpo_injective_left_wpopi_next_state_injective wpo_injective_right_wpopi_next_state_injective wpo_injective_value_wpopi_next_state_injective. (exists wpo_gap_wpopi_next_state_injective_left_bound. wpo_gap_wpopi_next_state_injective_left_bound + S (wpo_injective_left_wpopi_next_state_injective) = S (S (m + m))) -> (exists wpo_gap_wpopi_next_state_injective_right_bound. wpo_gap_wpopi_next_state_injective_right_bound + S (wpo_injective_right_wpopi_next_state_injective) = S (S (m + m))) -> (((exists wpo_beta_height_wpopi_next_state_injective_left_entry. wpo_beta_height_wpopi_next_state_injective_left_entry + S (wpo_injective_value_wpopi_next_state_injective) = S ((S (wpo_injective_left_wpopi_next_state_injective)) * d)) /\ exists wpo_beta_quotient_wpopi_next_state_injective_left_entry. z = wpo_beta_quotient_wpopi_next_state_injective_left_entry * S ((S (wpo_injective_left_wpopi_next_state_injective)) * d) + (wpo_injective_value_wpopi_next_state_injective))) -> (((exists wpo_beta_height_wpopi_next_state_injective_right_entry. wpo_beta_height_wpopi_next_state_injective_right_entry + S (wpo_injective_value_wpopi_next_state_injective) = S ((S (wpo_injective_right_wpopi_next_state_injective)) * d)) /\ exists wpo_beta_quotient_wpopi_next_state_injective_right_entry. z = wpo_beta_quotient_wpopi_next_state_injective_right_entry * S ((S (wpo_injective_right_wpopi_next_state_injective)) * d) + (wpo_injective_value_wpopi_next_state_injective))) -> wpo_injective_left_wpopi_next_state_injective = wpo_injective_right_wpopi_next_state_injective))))) /\ (forall wpop_pair_wpop_new_pairs. (exists wpo_gap_wpop_new_pairs_pair_bound. wpo_gap_wpop_new_pairs_pair_bound + S (wpop_pair_wpop_new_pairs) = S m) -> exists wpop_left_wpop_new_pairs wpop_right_wpop_new_pairs. ((((exists wpo_beta_height_wpop_new_pairs_left_entry. wpo_beta_height_wpop_new_pairs_left_entry + S (wpop_left_wpop_new_pairs) = S ((S (wpop_pair_wpop_new_pairs + wpop_pair_wpop_new_pairs)) * d)) /\ exists wpo_beta_quotient_wpop_new_pairs_left_entry. z = wpo_beta_quotient_wpop_new_pairs_left_entry * S ((S (wpop_pair_wpop_new_pairs + wpop_pair_wpop_new_pairs)) * d) + (wpop_left_wpop_new_pairs))) /\ ((((exists wpo_beta_height_wpop_new_pairs_right_entry. wpo_beta_height_wpop_new_pairs_right_entry + S (wpop_right_wpop_new_pairs) = S ((S (S (wpop_pair_wpop_new_pairs + wpop_pair_wpop_new_pairs))) * d)) /\ exists wpo_beta_quotient_wpop_new_pairs_right_entry. z = wpo_beta_quotient_wpop_new_pairs_right_entry * S ((S (S (wpop_pair_wpop_new_pairs + wpop_pair_wpop_new_pairs))) * d) + (wpop_right_wpop_new_pairs))) /\ (((exists wpo_beta_height_wpop_new_pairs_inverse_entry. wpo_beta_height_wpop_new_pairs_inverse_entry + S (wpop_right_wpop_new_pairs) = S ((S (wpop_left_wpop_new_pairs)) * v)) /\ exists wpo_beta_quotient_wpop_new_pairs_inverse_entry. u = wpo_beta_quotient_wpop_new_pairs_inverse_entry * S ((S (wpop_left_wpop_new_pairs)) * v) + (wpop_right_wpop_new_pairs))))))) - 0068
specialize prime_pair_order_paired_state_step p - 0069
specialize prime_pair_order_paired_state_step n - 0070
specialize prime_pair_order_paired_state_step u - 0071
specialize prime_pair_order_paired_state_step v - 0072
specialize prime_pair_order_paired_state_step x - 0073
specialize prime_pair_order_paired_state_step x1 - 0074
specialize prime_pair_order_paired_state_step m - 0075
specialize prime_pair_order_paired_state_step r - 0076
apply prime_pair_order_paired_state_step - 0077
exact hpn - 0078
exact hp - 0079
exact hprefix - 0080
exact hnr - 0081
exact hroom - 0082
exact hprevious_witness_witness_left - 0083
exact hprevious_witness_witness_right - 0084
cases hnext - 0085
cases hnext_witness - 0086
cases hnext_witness_witness - 0087
have hlength : S (S (m + m)) = S m + S m - 0088
specialize pair_order_double_succ_length (m + m) - 0089
specialize pair_order_double_succ_length m - 0090
apply pair_order_double_succ_length - 0091
refl - 0092
have hsuccessor_state : ((forall wpo_position_wpopi_successor_state_closed wpo_source_wpopi_successor_state_closed wpo_mate_wpopi_successor_state_closed. (exists wpo_gap_wpopi_successor_state_closed_position_bound. wpo_gap_wpopi_successor_state_closed_position_bound + S (wpo_position_wpopi_successor_state_closed) = S m + S m) -> (((exists wpo_beta_height_wpopi_successor_state_closed_source_entry. wpo_beta_height_wpopi_successor_state_closed_source_entry + S (wpo_source_wpopi_successor_state_closed) = S ((S (wpo_position_wpopi_successor_state_closed)) * x3)) /\ exists wpo_beta_quotient_wpopi_successor_state_closed_source_entry. x2 = wpo_beta_quotient_wpopi_successor_state_closed_source_entry * S ((S (wpo_position_wpopi_successor_state_closed)) * x3) + (wpo_source_wpopi_successor_state_closed))) -> (((exists wpo_beta_height_wpopi_successor_state_closed_inverse_entry. wpo_beta_height_wpopi_successor_state_closed_inverse_entry + S (wpo_mate_wpopi_successor_state_closed) = S ((S (wpo_source_wpopi_successor_state_closed)) * v)) /\ exists wpo_beta_quotient_wpopi_successor_state_closed_inverse_entry. u = wpo_beta_quotient_wpopi_successor_state_closed_inverse_entry * S ((S (wpo_source_wpopi_successor_state_closed)) * v) + (wpo_mate_wpopi_successor_state_closed))) -> exists wpo_mate_position_wpopi_successor_state_closed. ((exists wpo_gap_wpopi_successor_state_closed_mate_bound. wpo_gap_wpopi_successor_state_closed_mate_bound + S (wpo_mate_position_wpopi_successor_state_closed) = S m + S m) /\ (((exists wpo_beta_height_wpopi_successor_state_closed_mate_entry. wpo_beta_height_wpopi_successor_state_closed_mate_entry + S (wpo_mate_wpopi_successor_state_closed) = S ((S (wpo_mate_position_wpopi_successor_state_closed)) * x3)) /\ exists wpo_beta_quotient_wpopi_successor_state_closed_mate_entry. x2 = wpo_beta_quotient_wpopi_successor_state_closed_mate_entry * S ((S (wpo_mate_position_wpopi_successor_state_closed)) * x3) + (wpo_mate_wpopi_successor_state_closed))))) /\ ((forall fom_index_wpopi_successor_state_bounded. (exists fom_gap_wpopi_successor_state_bounded_index_bound. fom_gap_wpopi_successor_state_bounded_index_bound + S (fom_index_wpopi_successor_state_bounded) = S m + S m) -> exists fom_value_wpopi_successor_state_bounded. ((((exists fom_beta_height_wpopi_successor_state_bounded_entry. fom_beta_height_wpopi_successor_state_bounded_entry + S (fom_value_wpopi_successor_state_bounded) = S ((S (fom_index_wpopi_successor_state_bounded)) * x3)) /\ exists fom_beta_quotient_wpopi_successor_state_bounded_entry. x2 = fom_beta_quotient_wpopi_successor_state_bounded_entry * S ((S (fom_index_wpopi_successor_state_bounded)) * x3) + (fom_value_wpopi_successor_state_bounded))) /\ (exists fom_gap_wpopi_successor_state_bounded_value_bound. fom_gap_wpopi_successor_state_bounded_value_bound + S (fom_value_wpopi_successor_state_bounded) = n))) /\ ((forall wpo_position_wpopi_successor_state_nonendpoint wpo_value_wpopi_successor_state_nonendpoint. (exists wpo_gap_wpopi_successor_state_nonendpoint_position_bound. wpo_gap_wpopi_successor_state_nonendpoint_position_bound + S (wpo_position_wpopi_successor_state_nonendpoint) = S m + S m) -> (((exists wpo_beta_height_wpopi_successor_state_nonendpoint_entry. wpo_beta_height_wpopi_successor_state_nonendpoint_entry + S (wpo_value_wpopi_successor_state_nonendpoint) = S ((S (wpo_position_wpopi_successor_state_nonendpoint)) * x3)) /\ exists wpo_beta_quotient_wpopi_successor_state_nonendpoint_entry. x2 = wpo_beta_quotient_wpopi_successor_state_nonendpoint_entry * S ((S (wpo_position_wpopi_successor_state_nonendpoint)) * x3) + (wpo_value_wpopi_successor_state_nonendpoint))) -> (~(wpo_value_wpopi_successor_state_nonendpoint = 0) /\ ~((S wpo_value_wpopi_successor_state_nonendpoint) = n))) /\ (forall wpo_injective_left_wpopi_successor_state_injective wpo_injective_right_wpopi_successor_state_injective wpo_injective_value_wpopi_successor_state_injective. (exists wpo_gap_wpopi_successor_state_injective_left_bound. wpo_gap_wpopi_successor_state_injective_left_bound + S (wpo_injective_left_wpopi_successor_state_injective) = S m + S m) -> (exists wpo_gap_wpopi_successor_state_injective_right_bound. wpo_gap_wpopi_successor_state_injective_right_bound + S (wpo_injective_right_wpopi_successor_state_injective) = S m + S m) -> (((exists wpo_beta_height_wpopi_successor_state_injective_left_entry. wpo_beta_height_wpopi_successor_state_injective_left_entry + S (wpo_injective_value_wpopi_successor_state_injective) = S ((S (wpo_injective_left_wpopi_successor_state_injective)) * x3)) /\ exists wpo_beta_quotient_wpopi_successor_state_injective_left_entry. x2 = wpo_beta_quotient_wpopi_successor_state_injective_left_entry * S ((S (wpo_injective_left_wpopi_successor_state_injective)) * x3) + (wpo_injective_value_wpopi_successor_state_injective))) -> (((exists wpo_beta_height_wpopi_successor_state_injective_right_entry. wpo_beta_height_wpopi_successor_state_injective_right_entry + S (wpo_injective_value_wpopi_successor_state_injective) = S ((S (wpo_injective_right_wpopi_successor_state_injective)) * x3)) /\ exists wpo_beta_quotient_wpopi_successor_state_injective_right_entry. x2 = wpo_beta_quotient_wpopi_successor_state_injective_right_entry * S ((S (wpo_injective_right_wpopi_successor_state_injective)) * x3) + (wpo_injective_value_wpopi_successor_state_injective))) -> wpo_injective_left_wpopi_successor_state_injective = wpo_injective_right_wpopi_successor_state_injective)))) - 0093
rewrite <- hlength - 0094
rewrite <- hlength - 0095
rewrite <- hlength - 0096
rewrite <- hlength - 0097
rewrite <- hlength - 0098
rewrite <- hlength - 0099
exact hnext_witness_witness_left - 0100
exists x2 - 0101
exists x3 - 0102
split - 0103
exact hsuccessor_state - 0104
exact hnext_witness_witness_right