4. Let the center of circle C1 be O, and the radius be r. Connect OAi,OBi(i=1,2,⋯,n). Applying Ptolemy's inequality in quadrilateral OA1B1B2, we have OA1⋅B1B2+OO2⋅A1B1⩾OB1⋅A1B2, which means r⋅B1B2+λr⋅A1B1⩾λr(A1A2+A2B2), hence
B1B2+λA1B1⩾λ(A1A2+A2B2).
Similarly, applying Ptolemy's inequality iteratively, we have B2B3+λ′A2B2⩾λ(A2A3+A3B3); B3B4+λ⋅A3B3⩾λ(A3A4+A4B4); ⋯; Bn−1Bn+λ⋅An−1Bn−1⩾λ(An−1An+AnBn); BnB1+λAnBn⩾λ(AnA1+A1B1).
Adding these inequalities, we get B1B2+B2B3+⋯+Bn−1Bn+BnB1⩾λ(A1A2+A2A3+⋯+An−1An+AnA1), hence p2⩾λp1. The equality in Ptolemy's inequality holds if and only if the quadrilaterals OA1B1B2, OA2B2B3, ⋯, OAnBnB1 are all cyclic quadrilaterals. By the properties of cyclic quadrilaterals, we know ∠OA2A3=∠OB2B3, ∠OA2A1=∠OB3B2, but ∠OB2B3=∠OB3O2, thus ∠OA2A1=∠OA2A3, so △OA1A2≅△OA2A3, therefore, A1A2=A2A3. Similarly, A2A3=A3A4=⋯=AnA1, which means the n-sided polygon A1A2⋯An is a regular n-sided polygon.
Conversely, if A1A2⋯An is a regular n-sided polygon, rotating it counterclockwise around point O by n2π, we have A1→A2, A2→A3, ⋯, An→A1, thus B1→B2, B2→B3, ⋯, Bn→B1. Therefore, B1B2⋯Bn is also a regular n-sided polygon, so A1A2=A2A3=⋯=AnA1=2r⋅sinnπ, B1B2=B2B3=⋯=BnB1=2λr⋅sinnπ. At this point, we have p2=λp1.